Difference between revisions of "Talk:Activate"

Jump to navigation Jump to search
745 bytes added ,  20:54, 16 April 2008
imported>HawkFest
imported>HawkFest
Line 76: Line 76:
::''You can only nest 5-6 activations at a time. At a time is a little hard to define here, since OnActivate blocks run instantly and before the next line of code is processed. This really means that if 4 other scripts are still being processed and an activation is made during the 5th script, that last activation will be ignored (the script skips the line). This applies to any activation, even if they're different objects or different scripts.''
::''You can only nest 5-6 activations at a time. At a time is a little hard to define here, since OnActivate blocks run instantly and before the next line of code is processed. This really means that if 4 other scripts are still being processed and an activation is made during the 5th script, that last activation will be ignored (the script skips the line). This applies to any activation, even if they're different objects or different scripts.''
:Maybe that you problem is due to some limit imposed by the engine over piling (or stacking) [[onActivate]] processes : since the [[onActivate|onActivate block]] executes fully before going on to the next line of code, a stack is taking place here, as would do a recursive method... As such using the [[GameMode|GameMode block]] that executes every frame would be more appropriate imho, given the provision of some conditional control to recreate what you want to do. Be aware to put any onActivate control block before the [[GameMode|GameMode block]] for any reference involved in the chain, and which could serve as some "State observer" setting variables controling its GameMode block - and thus a chain of events that could involve multiple object references/path/scenario/story lines/effects/whatever... I'd try this using [[tokens]] instead of the actual objects needed to be manipulated during the chain of events (the scripting of these object staying thus independent from the FX or the wanted "chain reaction" in itself, making them consequently and independently reusable for some other stuff you could want them to do or behave in another stage or scenario). Note that I am not talking about an "instantaneously chained" multiple events triggered via onActive blocks - at most 4 to 5 considering what you said (which would be "normal" in regards to the "fps factor" during game playing)-, but about a chain reaction happening frame-by-frame (you could mix both methods btw). Although the later is only based over logical assumptions in regards to all the info provided around, maybe I'll try this some other time in a mod, as a "proof of concept"... --[[User:HawkFest|HawkFest]] 23:54, 11 September 2007 (EDT)
:Maybe that you problem is due to some limit imposed by the engine over piling (or stacking) [[onActivate]] processes : since the [[onActivate|onActivate block]] executes fully before going on to the next line of code, a stack is taking place here, as would do a recursive method... As such using the [[GameMode|GameMode block]] that executes every frame would be more appropriate imho, given the provision of some conditional control to recreate what you want to do. Be aware to put any onActivate control block before the [[GameMode|GameMode block]] for any reference involved in the chain, and which could serve as some "State observer" setting variables controling its GameMode block - and thus a chain of events that could involve multiple object references/path/scenario/story lines/effects/whatever... I'd try this using [[tokens]] instead of the actual objects needed to be manipulated during the chain of events (the scripting of these object staying thus independent from the FX or the wanted "chain reaction" in itself, making them consequently and independently reusable for some other stuff you could want them to do or behave in another stage or scenario). Note that I am not talking about an "instantaneously chained" multiple events triggered via onActive blocks - at most 4 to 5 considering what you said (which would be "normal" in regards to the "fps factor" during game playing)-, but about a chain reaction happening frame-by-frame (you could mix both methods btw). Although the later is only based over logical assumptions in regards to all the info provided around, maybe I'll try this some other time in a mod, as a "proof of concept"... --[[User:HawkFest|HawkFest]] 23:54, 11 September 2007 (EDT)
:::I've done it. A hint to the simplest way, not only to do it, but also to manage it: from a quest script or another object's script, use/set object variables that are triggering  your stuff, exactly when you want it... ''set refObjectID.localVar to 1'', where a conditional block on localVar, within the refObjectID's GameMode block script, would trigger whatever stuff you wish for it to render. Like a "Master script" that is managing the cascading events from one single object's script that is NOT involved into that chain reaction (which object can be hidden in the player's cell, or that would have no other use than showing itself as well as doing this "orchestration" silently). --[[User:HawkFest|HawkFest]] 21:54, 16 April 2008 (EDT)


== RunOnActivateBlock Flag ==
== RunOnActivateBlock Flag ==
Anonymous user

Navigation menu