Jump to content

Problem with SetValue()


Recommended Posts

Anyone with a thought as to what might be going wrong?

 

I have a global 'Raven' in a script, it is toggled between 0 and 1 (or rather it should be) and yes the properties are set.

Raven.SetValue(1) seems to do nothing... but if I console 'Set Raven to 1' that works and everything proceeds as expected.
the script then resets the globle Raven.SetValue(0) and that seems to be working.

 

I tried with Raven.SetValue(1.00) and Raven = Raven.GetValueInt() + 1 and various other combinations but it seems nothing will set the value to one.

 

I'm checking this with debug.notification( Raven.getvalueInt() ) on the next line but this always returns 0

Edited by TheWanderer001
Link to comment
Share on other sites

Okay I've spent far to long trying to get setvalue() to work and have given up on its use :sad:

 

I now have a quest which I'm resetting in order to get the toggle I want... it works but is a convoluted way to go about it :D

setvalue() should just work !!!

Edited by TheWanderer001
Link to comment
Share on other sites

SetValue does indeed work. The number one cause of SetValue not appearing to work is timing.

 

Seeing the code that you were trying to use would have been helpful for anyone wishing to assist. But it seems that you have moved on at this point.

Link to comment
Share on other sites

HI Ishara.... yes I know setvalue() works I have used in the same script and others for other globals and they all work...

I thought about timing and tried to set up a loop to trap that... but is just kept running and the value was never set...

 

the code was/is about as simple as it gets...

 

 

Event OnEquipped(Actor akActor)
  If (akActor.IsSneaking())           
     Raven.setvalue(1)
  Endif
Endevent

 


Link to comment
Share on other sites

Some things in papyrus will not run on objects when they are inside of a container. It is possible that SetValue might be one of them. You could flip the script as it were and have a reference alias pointing to the actor doing the equipping. A script on the alias would use the OnObjectEquipped event and set the value when the equipped object is the correct thing.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...