PropertyValue
rdfs:label
  • AssignCommand
rdfs:comment
  • function AssignCommand (object oActionSubject,action aActionToAssign) Assign aActionToAssign to oActionSubject. * No return value, but if an error occurs, the log file will contain "AssignCommand failed." (If the object doesn't exist, nothing happens.)=== * Return type: void * Include file: nwscriptdefn
  • The AssignCommand() NWScript command causes the indicated object to execute the indicated command (or function). This execution occurs immediately after the current script finishes, but after any prior assigned commands. The most common reason for assigning a command is because some commands (notably, the "Action" commands) always affect their calling object. Assigning a command can also be useful for scripts that inflict damage, as the creator of the damaging effect is given credit for that damage (including credit for any kills resulting from that damage).
dcterms:subject
dbkwik:nwn2/property/wikiPageUsesTemplate
returns
Name
  • AssignCommand
param
  • action aActionToAssign
  • object oActionSubject
param2desc
  • The instruction that will be executed by . This must be a command or function that returns .
param1desc
  • The object that will execute the command.
dbkwik:nwn/property/wikiPageUsesTemplate
abstract
  • function AssignCommand (object oActionSubject,action aActionToAssign) Assign aActionToAssign to oActionSubject. * No return value, but if an error occurs, the log file will contain "AssignCommand failed." (If the object doesn't exist, nothing happens.)=== * Return type: void * Include file: nwscriptdefn
  • The AssignCommand() NWScript command causes the indicated object to execute the indicated command (or function). This execution occurs immediately after the current script finishes, but after any prior assigned commands. The most common reason for assigning a command is because some commands (notably, the "Action" commands) always affect their calling object. Assigning a command can also be useful for scripts that inflict damage, as the creator of the damaging effect is given credit for that damage (including credit for any kills resulting from that damage). A less common reason for assigning a command is to make use of the fact that the command is delayed until the current script finishes. This can be more efficient that using <a href="/mediawiki/DelayCommand" title="DelayCommand">DelayCommand</a>() with a delay of 0.0, and can be useful for delaying a command until certain cleanup operations are finished — such as actually destroying objects or actually removing item properties, neither of which are done while a script executes (they are merely flagged to be done when the script finishes). This is the only circumstance in which assigning a command to OBJECT_SELF has any useful result.