ref walk utility

Post » Sat Feb 19, 2011 3:21 am

There's also another way to do this if im not mistaken. It might seem a little bit more complicated, but as mentioned, once added tokens will execute in parallel and their indeterministic behaviour makes it pretty much impossible to reliably synchronize their actions. What you can do is instead of allowing mods to add their tokens, they can register stage functions by adding the containing quest to a formlist. This list then can be iterated and setStage can be called on the ref to execute the function. So the basic design would be

ClientScript:
(in a ref walk)set Dispatcher.var1 to var1....set Dispatcher.varN to varNsetStage Dispatcher 1


Dispatcher stage function: (interface variables declared in quest script)
set i to 0set n to listGetCount QuestListLabel 99if i < n	set quest to listGetNthForm QuestList i	if quest != 0		setStage quest 1	endif	set i to i + 1	goto 99endif


And the stage functions:
set var1 to Dispatcher.var1....set varN to Dispatcher.varN(do whatever you like)

So with this method the mod-added stage functions will be executed sequentially, and they could access results from their predecessor or some common state that would allow for limited coordination.
User avatar
sarah simon-rogaume
 
Posts: 3383
Joined: Thu Mar 15, 2007 4:41 am

Post » Fri Feb 18, 2011 9:29 pm

Interesting idea. I guess that once you've got a reference variable set to the actor, there's nothing you could do in an object script that you couldn't do in a quest script. But unless I'm misunderstanding something, aren't stage functions limited to just a few lines of code?
User avatar
Da Missz
 
Posts: 3438
Joined: Fri Mar 30, 2007 4:42 pm

Post » Fri Feb 18, 2011 10:22 pm

Interesting idea. I guess that once you've got a reference variable set to the actor, there's nothing you could do in an object script that you couldn't do in a quest script. But unless I'm misunderstanding something, aren't stage functions limited to just a few lines of code?

Hm no they are not, i have at least used some with up to ~500 lines i think.
User avatar
Mike Plumley
 
Posts: 3392
Joined: Wed Sep 05, 2007 10:45 pm

Previous

Return to Fallout 3