Calling convention for Actions (advanced scripting analysis)
I've been wondering - analysing it from the basics of programming. I come from C/C#/Java/Lua/VB background, so I think I should be pretty fluent by now.AssignCommand(oNPC,ActionSomething(parameters));This should, logically, generate an object of type 'action' and assign it to the NPC, placing it in its action queue or something. This should, then, also work written as:action aDoit = ActionBelch();AssignCommand(oShrek,aDoit);AssignCommand(oFiona,aDoit);... as this would assign identical actions to two NPCs - but no, Action* functions return... voids! Here comes the stump in a more profound manner:AssignCommand(oFiona,DelayCommand(1.0,ActionSpeakString("Oh golly!")));Or, even simpler
elayCommand(1.0,PrintString("Hello, I'm your friendly debug log."));Why does AssignCommand happily accept a void parameter? Why does DelayCommand gladly receive a void returned from PrintString? Do these commands use some weird interpreted syntax, instead of proper function-returning-a-value convention now?Any experienced programmers on board..?-- Sinus
I've been wondering - analysing it from the basics of programming. I come from C/C#/Java/Lua/VB background, so I think I should be pretty fluent by now.AssignCommand(oNPC,ActionSomething(parameters));This should, logically, generate an object of type 'action' and assign it to the NPC, placing it in its action queue or something. This should, then, also work written as:action aDoit = ActionBelch();AssignCommand(oShrek,aDoit);AssignCommand(oFiona,aDoit);... as this would assign identical actions to two NPCs - but no, Action* functions return... voids! Here comes the stump in a more profound manner:AssignCommand(oFiona,DelayCommand(1.0,ActionSpeakString("Oh golly!")));Or, even simpler


