Variable Frame Updates

Post » Fri May 27, 2011 3:49 am

When variables are set in a single frame, are they not available to code until the next frame of processing? (IE)

Frame 1: Set Foo to 1
Frame 1: Foo == 0

Frame 2: Foo == 1
Frame 2: Set Foo to 2
Frame 2: Foo == 1

Frame 3: Foo == 2
Frame 3: etc etc etc
User avatar
Skivs
 
Posts: 3550
Joined: Sat Dec 01, 2007 10:06 pm

Post » Fri May 27, 2011 6:38 am

I say this because my test was:

(In a perk script)
short FooBegin MenuModeset Foo to 1if Foo == 1player.additem 0000000F 50elseif Foo == 0player.additem 0000000F 100endifEnd


This would return 100. So -- What?
User avatar
Dan Wright
 
Posts: 3308
Joined: Mon Jul 16, 2007 8:40 am

Post » Fri May 27, 2011 5:22 pm

I don't know why that thing didn't work right, but variables are available within the frame that they're assigned.

(note: perk scripts should not have Begin BlockType-type things in them in the first place, just like result scripts in conversations)
User avatar
Enny Labinjo
 
Posts: 3480
Joined: Tue Aug 01, 2006 3:04 pm

Post » Fri May 27, 2011 5:31 am

Mentioned in the other thread, but result scripts don't support variables being defined within them. To be more precise, apparently one type of result script does which is why the compiler doesn't throw up an error about it, but I don't think anyone's actually found out which type.
User avatar
Jesus Lopez
 
Posts: 3508
Joined: Thu Aug 16, 2007 10:16 pm

Post » Fri May 27, 2011 6:23 am

With a faux function call it might work, I'm not quite sure yet. I'm going to look into something posted in the other thread involving "Quest functions".

Also yes, blocktypes don't belong in result scripts. I'm still a newb. x.x

A newb who's head banging a wall. Gaaaaaaar. Badcode.
User avatar
Kristina Campbell
 
Posts: 3512
Joined: Sun Oct 15, 2006 7:08 am


Return to Fallout: New Vegas