Difference between revisions of "Talk:Activate"

2,210 bytes added ,  21:08, 14 July 2009
Activating an object every frame
imported>Shademe
(Weird Bugginess !)
imported>QQuix
(Activating an object every frame)
Line 141: Line 141:


''It seems as objects should not activate objects. [http://www.bethsoft.com/bgsforums/index.php?showtopic=1000091].'' Needs some more confirmation - [[User:Shademe|shadeMe]] <sup>[[User_talk:Shademe|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]]</sup> 17:17, 9 June 2009 (EDT)
''It seems as objects should not activate objects. [http://www.bethsoft.com/bgsforums/index.php?showtopic=1000091].'' Needs some more confirmation - [[User:Shademe|shadeMe]] <sup>[[User_talk:Shademe|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]]</sup> 17:17, 9 June 2009 (EDT)
==Activating an object every frame==
After some extensive tests I came to the conclusion that using the Activate functions prevents further scripts from running in the same frame. The script with the Activate function executes to the end normally. This is consistently repeatable in my game setup.
I suppose it needs confirmation from other modders in order to add it to the article, but I think it is a general problem as there is a warning in the [[Common Bugs#Activating an object every frame|Common Bugs]] article.
Therefore, using an Activate functions every frame may cause other scripts not to run. This is particularly bad in scripted objects in the player's inventory because, as the player walks around, the game may present some strange behavior (because some scripts are not running). Example (just tested): when watching an arena match from the balcony, when one of the combatants dies, the announcer does not come in. If the script stops using the Activate function, the announcer announces the winner and the game continues normally
I also concluded that, in exteriors, the game engine looks for scripted objects in a given order: from South to North and from West to East.  Example: supposing the player is in cell 3-13 and, therefore, the 25 cells around the player are loaded. Scripts in cell 1-11 are executed first, then the ones on cell 2-11, then 3-11, 4,11 and 5,11.  Since cell 6,11 is not loaded, the engine executes scripts in the next 'column'? 2-11, 2-12 … 2-15. Then 3-11 thru 3,15 and so forth until cell 5-15.
Supposing there is a scripted object in each of those cells, if any of them uses an Activate function, no other script down the line (North and East) will execute in that frame.
A little more details in the [http://www.bethsoft.com/bgsforums/index.php?showtopic=1000091 Beth Forum thread: Scripts stop running as the PC enters the cell]
OBSE's Activate2 does not cause this problem.
MoveTo also causes exactly the same problem, as reported by flippantremark in this Beth Forums thread: [http://www.bethsoft.com/bgsforums/index.php?showtopic=1013395 Beth Forums thread: Help needed - moving lightsource scipt]
[[User:QQuix|QQuix]] 22:08, 14 July 2009 (EDT)
Anonymous user