UnderstandingUsing While LoopsArrays to do what I want to do

Post » Fri Nov 16, 2012 4:21 pm

while vs reg4Sing: the way I use the onUpdate event (usually) is kinda like a custom function.. it can be called from anywhere in the script; whereas a while loop would have to be duplicated at each point it's needed. I think Papyrus is modeled in part on C, but many languages have the same premise for their functions and commands - just different syntax and convenience (though I'm no programmer, so don't give me too much flak on that over-generalization heheh).

The platform-test I made uses two scripts, but only one writes to the globals while the other reads them. The timing is more sensitive than having it all in one script, but if in order it goes MUCH faster. I agree with the update blocks never running simultaneously (which I've found to be the case, personally) - one would either stack to the next available time-slot or simply be dumped.

What I was wondering about this and what you said about the reg4Sing cancelling a previous though was does it cancel the onUp block while it's in progress or only if it hasn't run yet. EG: the 10sec delay in script 1 means it hasn't fired the onUp yet, thus gets cancelled. But if that 10sec delay expired and the onUp DID run, will it be nixed mid-stream? THIS is what I don't think is the case... but I haven't fooled around with calling 'cross-script' functions and variables (except globals, but that's not the same).
User avatar
Kirsty Collins
 
Posts: 3441
Joined: Tue Sep 19, 2006 11:54 pm

Post » Fri Nov 16, 2012 12:54 pm

maybe cancel is the wrong word. override is closer to what i mean... that or "cockblock"


... actually cockblock is the exact definition of what 2 regsingles do to each other when called before the onupdate can run

if script 1 registers with 10 seconds and script 2 cockblocks at 9th second. script 1 is SOL and goes home empty handed

if script 1 makes it to the 10 second mark and scores with the update, script 2 is SOL, but has a chance for sloppy seconds


neither situation will allow for a menage a trois

update wont allow both scripts into the house (she's not that type of girl). if script 2 calls while script 1 and update are "closing the loop" behind closed doors, script 2 will have to leave a message on the answering machine if he ever wants to have a chance to close the loop with update
User avatar
Vincent Joe
 
Posts: 3370
Joined: Wed Sep 26, 2007 1:13 pm

Previous

Return to V - Skyrim