Members - Reputation: 133
Posted 02 May 2004 - 01:05 AM
Members - Reputation: 158
Posted 02 May 2004 - 11:02 AM
Moderators - Reputation: 4364
Posted 02 May 2004 - 01:30 PM
In C/C++ you are allowed to define default parameters for functions, but these default parameters doesn''t really change the function interface. It''s just that the compiler fills in the missing parameters for you. The parameters are still sent to the function.
When you register a function with AngelScript you have to declare all of the parameters, even those that have default arguments, otherwise AngelScript won''t push the correct amount of data on the stack, resulting in random behaviour.
Currently AngelScript doesn''t allow you to define default parameters for function calls, but I might consider it for a future version.
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game