summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-16 20:53:05 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-16 20:53:05 +0000
commit25a64bfba88fc3b03a6f8ebef897f447fb3fc61d (patch)
tree4fac6cd4d963eca6d31cc4f3248701472ee2dc6b /doc
parent6196f0e6d34dba214a1598d7df7ab2f07b860a07 (diff)
downloadhercules-25a64bfba88fc3b03a6f8ebef897f447fb3fc61d.tar.gz
hercules-25a64bfba88fc3b03a6f8ebef897f447fb3fc61d.tar.bz2
hercules-25a64bfba88fc3b03a6f8ebef897f447fb3fc61d.tar.xz
hercules-25a64bfba88fc3b03a6f8ebef897f447fb3fc61d.zip
- Updated the Dancer job quest to attach a player to the main timer script.
- Updated script commands startnpctimer, stopnpctimer, initnpctimer so you can attach a player to them, this is done because the attach/detach functions can't be used to attach to a different script than the one currently running. - Some script code cleaning - Updated the script_command reference with the new flag values of [start/stop/init]npctimer. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9872 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt37
1 files changed, 23 insertions, 14 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index a6293172f..4d55df25f 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -59,6 +59,10 @@
//= 3.02.20070209
//= Corrected/updated info on Xor/setd/getd/callfunc/callsub/return and
//= updated some examples to use "better" code. [FlavioJS]
+//= 3.03.20070216
+//= Expanded/clarified information on npc timers, added info about the
+//= new attach flag for script commands startnpctimer/ stopnpctimer/
+//= initnpctimer [Skotlex]
//===== Compatible With ===================================
//= LOL, can be used by anyone hopefully
//===== Description =======================================
@@ -4815,9 +4819,12 @@ is.
---------------------------------------
-*initnpctimer{ "<NPC object name>"};
-*stopnpctimer{ "<NPC object name>"};
-*startnpctimer{ "<NPC object name>"};
+*initnpctimer{ "<NPC object name>" {, <Attach Flag>} } |
+ {"<NPC object name>" | <Attach Flag> };
+*stopnpctimer{ "<NPC object name>" {, <Detach Flag>} } |
+ { "<NPC object name>" | <Detach Flag> };
+*startnpctimer{ "<NPC object name>" {, <Attach Flag>} } |
+ { "<NPC object name>" | <Attach Flag> };
*setnpctimer <tick>{,"<NPC object name>"};
*getnpctimer(<type of information>{,"<NPC object name>"});
*attachnpctimer {"<character name>"};
@@ -4844,17 +4851,19 @@ To create the timer, use the 'initnpctimer', which will start it running.
'stopnpctimer' will pause the timer, without clearing the current tick, while
'startnpctimer' will let the paused timer continue.
-It is not quite clear whether the new invocations will always have a RID.
-Apparently, the RID that was in effect when the timer was initialised will still
-be attached to these executions in some cases, but it's not quite clear -
-experiment with RID-dependent commands, like 'mes', and tell us what happens and
-who gets the message, if anyone.
-
-Even if they don't have a RID by default, 'attachnpctimer' will allow you to
-explicitly attach a character's RID to the timer, which will make them the
-target for all character-referencing commands and functions, not to mention
-variables. 'detachnpctimer' will make the RID zero, making all character-
-referencing functions fail with an error.
+By default timers do not have a RID attached, which lets the timers continue even
+if the player that started them logs off. To attach a RID to a timer, you can
+either use the "attach flag" optional value when using initnpctimer/startnpctimer,
+likewise, the optional flag of stopnpctimer detaches any RID after stopping
+the timer. One a player is attached to a timer, it stays attached to all
+timers from that script until detached manually. You can have multiple
+npctimers going on at the same time as long as each one has a different player
+attached (think of each RID being used as an independant timer).
+
+The other method to attach/detach a RID is through the script commands
+'attachnpctimer' and 'detachnpctimer'. Once attached, that will make the
+character the target for all character-referencing commands and functions,
+not to mention variables.
'setnpctimer' will explicitly set the timer to a given tick. To make it useful,
you will need the 'getnpctimer' function, which the type of information argument