30th December 2003, 02:48 PM | #1 |
Senior Member
Professional user
Join Date: Jul 2003
Posts: 899
|
Parameters and templates
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. |
30th December 2003, 06:39 PM | #2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
Re: Parameters and templates
Hi Dennis,
A new command template was added in AC3D 4.0 - you can use 'argv': Code:
ac_add_command_full( "cmdname", funcname, 0 , "argv", "pdesc", "desc" ); Code:
bool funcname(int argc, const char* argv[]) Andy |
30th December 2003, 07:12 PM | #3 |
Senior Member
Professional user
Join Date: Jul 2003
Posts: 899
|
Re: Parameters and templates
Very cool --- thanks Andy!
|
|
|