Why is a variable set in OnInit NOT good for OnUpdate?

Post » Wed Jun 20, 2012 12:39 am

Why is this NOT Working:

Scriptname aadpMainTestQuest extends Quest Actor PlayerRefEVENT onInit()   RegisterForSingleUpdate(0.2)   Playerref = Game.GetPlayer()endEVENTEVENT onUpdate()if PlayerRef.GetAVpercentage("stamina") <= 0  debug.Message("works")endifRegisterForSingleUpdate(0.2)endEVENT


But this one will work? Should not the Actor variable be set and STAY set?

This works:

Scriptname aadpMainTestQuest extends Quest Actor PlayerRefEVENT onInit()   RegisterForSingleUpdate(0.2)   endEVENTEVENT onUpdate()Playerref = Game.GetPlayer()if PlayerRef.GetAVpercentage("stamina") <= 0  debug.Message("works")endifRegisterForSingleUpdate(0.2)endEVENT
User avatar
matt
 
Posts: 3267
Joined: Wed May 30, 2007 10:17 am

Post » Tue Jun 19, 2012 5:43 pm

I had a similar problem with some functions not wanting to work inside some events, really annoying when your debug message shows up but the functions on the lines before and after it never happen mysteriously.
User avatar
Connie Thomas
 
Posts: 3362
Joined: Sun Nov 19, 2006 9:58 am

Post » Wed Jun 20, 2012 4:28 am

Thanks for letting me know, this game is going to give me grey hair. :sad:

I just found out that there is no way to get the NPC ENCUMBRANCE for gods sake!

They do not use the Inventory weight Actor Value! (they ALL have a 0 for Inventory weight. ) :banghead:

I had a similar problem with some functions not wanting to work inside some events, really annoying when your debug message shows up but the functions on the lines before and after it never happen mysteriously.
User avatar
lillian luna
 
Posts: 3432
Joined: Thu Aug 31, 2006 9:43 pm

Post » Tue Jun 19, 2012 9:28 pm

So many things that were so quick/obvious to do before are messed up now. The worst part is that they just left all the obsolete stuff there, so 9 times out of 10 you won't even know it's not supposed to work until you go in and verify it yourself.
User avatar
Janette Segura
 
Posts: 3512
Joined: Wed Aug 22, 2007 12:36 am


Return to V - Skyrim