using multiple scripts with the same function name,
Members - Reputation: 122
Posted 05 May 2004 - 03:04 AM
Members - Reputation: 158
Posted 05 May 2004 - 12:54 PM
One workaround at the moment would be to to append MainAI onto the end of whatever the AI is for, e.g. if it was for a character called Grunt you would have a GruntMainAI function. Thats just a strcat in code. I''m not too fond of that solution, but it works.
Moderators - Reputation: 4332
Posted 05 May 2004 - 01:28 PM
You can create one script engine for each object type, and it shouldn''t affect your performance. The main disadvantage is that the two script engines cannot share global variables or common functions. Both engines must also be configured with the Register functions. I''m not sure about how much memory the registered functions require, but a guesstimate is about 50-100 bytes each.
Functions cannot be nested.
Version 1.8.0 will have support for modules. Each module will have it''s own namespace, which means that you will be able to reuse the function names. Each module can also be independently compiled, which means that you can add/remove modules from the engine without affecting the others.
It is my hopes that version 1.8.0 will be released next month. But this depends heavily upon how much time I will have to work on AngelScript. I will release one other version before that, v1.7.1 with support for function overloading with script functions and ExecuteStep(asEXEC_STEP_OVER). That one should be finished within a week, I hope.
As you might guess, the release dates are very vague, but hopefully I will be able to keep them. I''ve been known to finish a release before the estimated time as well.
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game