AI Scripting Technical Details |
I have a few quick technical questions I was hoping someone here about might have the answers to:
Do conditional operators (and, or) overload?
Can you have multiple exitwhen clauses in a loop?
Can you use a return statement to exit a function early?
Any problems with not covering all the cases in a case statement? Is there even a default mechanism?
Should lists be cleared before use?
Must locally declared lists be cleared prior to function exit?
Does Sys_AI_Setup_Select_Racial_Trait fail safely (does nothing) if the trait has already been added?
Am I just missing it, or is Sys_Iifreal the only default trigraph function?
Is there implicit type conversion from long to real? real to long?
Is there some purpose I'm not seeing to the various operator simulating functions (Sys_Long_Add and such)?
Thanks in advance.
Re: AI Scripting Technical Details

Re: AI Scripting Technical Details
Re: AI Scripting Technical Details
OK, if all type conversions must be explicit, where is the long-to-real conversion? SyS_Trunc and Sys_Round are fine for real-to-long, but I don't see anything for the other way...

Re: AI Scripting Technical Details
There isn't one, but you could use real_var := long_var * 1.0 etc.
Re: AI Scripting Technical Details
Weird. myreal := mylong won't work but myreal := 1.0 * mylong will? Or was the earlier claim that implicit conversion is not supported either way overzealous.
Anyway, what I need to do will work fine in any case. Thanks.




Re: AI Scripting Technical Details
SpaceEmpires.net | Space Empires Wiki