[dismiss]
This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.
Difference between revisions of "Category:Tidbits"
Jump to navigation
Jump to search
→When do remote activators run?: Possible to make a remote activator loaded
imported>Haama (→Further Investigation Needed: When do remote activators run?) |
imported>Haama (→When do remote activators run?: Possible to make a remote activator loaded) |
||
Line 69: | Line 69: | ||
===When do remote activators run?=== | ===When do remote activators run?=== | ||
Generally, objects that aren't loaded (i.e., not in the player's cell) won't run their scripts. However, it seems that remote activators run for a single frame when the mod is first activated, and whenever a variable on the activator is set. Since the activator isn't activated, the onActivate block won't run, but the GameMode or MenuMode blocks will (depending on which you're in). Likewise, I imagine any other, umm... flagged block will run (ok, where's a general script tutorial so I can get this terminology right?), like, umm... onLoad? I also imagine this holds true for any remote, persistent object as well. See [http://www.bethsoft.com/bgsforums/index.php?showtopic=740961 Mod's not Changing? What the ?] for more details. | Generally, objects that aren't loaded (i.e., not in the player's cell) won't run their scripts. However, it seems that remote activators run for a single frame when the mod is first activated, and whenever a variable on the activator is set. Since the activator isn't activated, the onActivate block won't run, but the GameMode or MenuMode blocks will (depending on which you're in). Likewise, I imagine any other, umm... flagged block will run (ok, where's a general script tutorial so I can get this terminology right?), like, umm... onLoad? I also imagine this holds true for any remote, persistent object as well. See [http://www.bethsoft.com/bgsforums/index.php?showtopic=740961 Mod's not Changing? What the ?] for more details. | ||
:I've done some more tests. I've found that a remote activator will run it's script on the frame following a variable set. This can be used to make the remote activator act like a [[Loaded]] one by setting a variable at the end of the block. For instance, | |||
<pre>begin onActivate | |||
set Working to 1 | |||
end | |||
begin GameMode | |||
if Working | |||
printc "Working" | |||
set Working to 1 | |||
endif | |||
end</pre> | |||
will print "Working" every frame after being activated from another script (or setting Working to 1). To stop the script from running, simply have a condition where a variable won't be set | |||
<pre>begin GameMode | |||
printc "Counter is %g" | |||
if Working | |||
if (Counter < 10) | |||
set Counter to (Counter + 1) | |||
set Working to 1 | |||
else | |||
set Counter to 0 | |||
set Working to 0 | |||
endif | |||
endif | |||
end</pre> | |||
Remember that the script will run one more time than you would like. For instance, in the above script you would see printed "Counter is 1", "Counter is 2"... "Counter is 10", "Counter is 0" and then the script will stop processing. | |||
:I have a duplication of the activator running once when the mod is first loaded, but I didn't do any specific tests. | |||
:--[[User:Haama|Haama]] 23:00, 5 September 2007 (EDT) |