PDA

View Full Version : Parameters and templates


Dennis
30th December 2003, 01:48 PM
I have a plugin into which I want to pass 8 floating point values.

I'm currently using:

ac_add_command_full( "cmdname", funcname, 8, "ffffffff", "pdesc", "desc" );

However, I get a complaint that I must use one of the following templates:

templates are: d, f, s, sd, ff, fff, ffffff, dffffffffffffff

I can use "dffffffffffffff" and pass in dummy values, or even concat the values into a string in my TCL and sscanf the floats out in my code, but is there a better/less cludgy way of doing this?

I've tried using NULL for no template (as suggested in the error I got), but this doesn't seem pass the parameters I need correctly.

Andy
30th December 2003, 05:39 PM
Hi Dennis,

A new command template was added in AC3D 4.0 - you can use 'argv':

ac_add_command_full( "cmdname", funcname, 0 , "argv", "pdesc", "desc" );

so your function can be:

bool funcname(int argc, const char* argv[])

and you handle the parameters yourself.

Andy

Dennis
30th December 2003, 06:12 PM
Very cool --- thanks Andy!