1 The npc loads dance moves into his action Que.
2 The NPC loads a SetCommandable(TRUE); to his Action Que that will happen after the dance Moves.
3. The NPC loads a ExecuteScript("dance",OBJECT_SELF); To his action Que. The script will run as the last Action in his que. Not untill all the Actions from step 1 and 2 are finished.
4 the NPC stops anything else from being added to his Action Que. SetCommandable(FALSE); this is the only command that gets excuted before the sctipt finishes. all of the others are just loaded to the Action Que of the NPC to be ran in turn. This is what the ActionDoCommand does. It turns the command into an action.
Now since I have not tested it. If the blocking becomes a problem. And yes it might. the solution would be to assign the command to run.
ActionDoCommand(AssignCommand(OBJECT_SELF,ExecuteScript("dance",OBJECT_SELF)));
But I do not think it will be a problem. Before useing the line above line. I would trun the whole thing into an action returning function and add that to the Que to reload itsself.
Modifié par Lightfoot8, 18 mars 2011 - 05:04 .