NWNWiki
Advertisement
NWNWiki
3,718
pages

The ActionDoCommand() NWScript command causes the indicated command (or function) to be added to the caller's action queue. This effectively allows commands to be delayed until previously assigned actions are done, unlike DelayCommand(), which delays commands for a fixed amount of time. Another difference is that an action queue can be cleared, which would cancel any remaining entries added by ActionDoCommand(), while commands delayed by DelayCommand() are only canceled if the calling object ceases to exist.

In order to add the command to the action queue of a different creature, ActionDoCommand() must be assigned via AssignCommand().

Definition[]

void ActionDoCommand (action aActionToDo)

action aActionToDo
The instruction that will be added to the action queue. This must be a command or function that returns void.

The name of the parameter reflects the fact that the indicated command will become an action; it does not indicate that the parameter should be one of the commands whose name begins with "Action". Aside from ActionAttack(), there is no need to pass an "Action" command as a parameter to ActionDoCommand(), and in fact doing so may lead to unexpected timing issues (as the "Action" command would be delayed until its turn in the action queue, at which time it would add its action to the action queue, which could in turn result in another delay if other actions had been added to the queue in the interim).

Advertisement