Difference between revisions of "Talk:Activate"

Jump to navigation Jump to search
801 bytes added ,  15:24, 1 February 2008
RunOnActivateBlock Flag
imported>HawkFest
imported>Waruddar
(RunOnActivateBlock Flag)
Line 73: Line 73:
::''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)
== RunOnActivateBlock Flag ==
This flag seems to determine more than whether to run the onActivate block or not; it appears to be more of a DoNormalActivation flag (which includes running the script if it's present), than simply a RunOnActivateBlock flag.
Example: Steal an unscripted item, and drop it.  If you pick it up again, your stolen item misc count will NOT increase (since you already stole it once).  Now, take the same item, and instead of picking it up, target it in the console and do "activate player".  The stolen item misc count increases.  If you use "activate player 1", the stolen item misc count will NOT increase.  Since the item is unscripted, you wouldn't expect the RunOnActivateBlock flag to actually do anything. --[[User:Waruddar|Waruddar]] 15:24, 1 February 2008 (EST)
Anonymous user

Navigation menu