About: DelayCommand   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

function DelayCommand (float fSeconds, action aActionToDelay) Delay aActionToDelay by fSeconds. * No return value, but if an error occurs, the log file will contain "DelayCommand failed.". It is suggested that functions which create effects should not be used as parameters to delayed actions. Instead, the effect should be created in the script and then passed into the action. For example: effect eDamage = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL); DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); For example:

AttributesValues
rdfs:label
  • DelayCommand
rdfs:comment
  • function DelayCommand (float fSeconds, action aActionToDelay) Delay aActionToDelay by fSeconds. * No return value, but if an error occurs, the log file will contain "DelayCommand failed.". It is suggested that functions which create effects should not be used as parameters to delayed actions. Instead, the effect should be created in the script and then passed into the action. For example: effect eDamage = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL); DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); For example:
  • The DelayCommand() NWScript command causes the indicated command (or function) to be executed after the indicated delay. The delay is a fixed number of seconds; in order to have a variable delay based upon certain actions completing, <a href="/mediawiki/ActionDoCommand" title="ActionDoCommand">ActionDoCommand</a>() should be used. Delayed commands are lost if the calling object does not exist when the delay is finished. (This can be gotten around by using <a href="/mediawiki/AssignCommand" title="AssignCommand">AssignCommand</a>() to assign the delay to a different object, often the module as returned by <a href="/mediawiki/GetModule" title="GetModule">GetModule</a>().)
dcterms:subject
dbkwik:nwn2/proper...iPageUsesTemplate
returns
Name
  • DelayCommand
param
  • action aActionToDelay
  • float fSeconds
param2desc
  • The instruction that will be executed after the delay. This must be a command or function that returns .
param1desc
  • The number of seconds by which to delay execution.
dbkwik:nwn/property/wikiPageUsesTemplate
abstract
  • function DelayCommand (float fSeconds, action aActionToDelay) Delay aActionToDelay by fSeconds. * No return value, but if an error occurs, the log file will contain "DelayCommand failed.". It is suggested that functions which create effects should not be used as parameters to delayed actions. Instead, the effect should be created in the script and then passed into the action. For example: effect eDamage = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL); DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); If you use a series of delay commands in a row, notice that the time is in seconds from the beginning, not from the last delay command. So, if you want something to happen at ten-second intervals, you need to have delays of 10, 20, 30, and so on, not a series of 10's. For example: DelayCommand(15.0, AssignCommand(oPraying,SpeakOneLinerConversation("ck_pray_maiden"))); DelayCommand(25.0, AssignCommand(oPraying,SpeakOneLinerConversation("ck_pray_mother"))); DelayCommand(35.0, AssignCommand(oPraying,SpeakOneLinerConversation("ck_pray_crone"))); * Return type: void * Include file: nwscriptdefn
  • The DelayCommand() NWScript command causes the indicated command (or function) to be executed after the indicated delay. The delay is a fixed number of seconds; in order to have a variable delay based upon certain actions completing, <a href="/mediawiki/ActionDoCommand" title="ActionDoCommand">ActionDoCommand</a>() should be used. Delayed commands are lost if the calling object does not exist when the delay is finished. (This can be gotten around by using <a href="/mediawiki/AssignCommand" title="AssignCommand">AssignCommand</a>() to assign the delay to a different object, often the module as returned by <a href="/mediawiki/GetModule" title="GetModule">GetModule</a>().) Delayed commands cannot be canceled (other than by destroying the calling object), but they can sometimes be lost under extreme server conditions (such as having thousands of concurrently delayed commands). Delayed commands are sometimes used to create pseudo-heartbeats, which in its most basic form involves a function that calls itself after a delay. Multiple delays of the same duration should not be relied upon if efficiency or the order of execution is important. Instead, those commands should be collected into a single function, and the function delayed.
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software