Jump to content

Why isn't this simple part of my script working?


redeyesandlonghair

Recommended Posts

so this specific part of my script is failing, and a lot of other stuff depends on this part working. it's pretty simple, so I'm not sure why it's not working. there is more to the script, but I'm posting just the part that's not working. If you think you need the whole script to figure out what's wrong, lemme know

 

 

float fEnergy

 

begin GameMode

 

set fEnergy to player.getav Endurance

 

end

 

 

For some reason, this is setting fEnergy to 0. This is the only time in the script that fEnergy's value is being changed.

Link to comment
Share on other sites

Like caramellcube says, if you're attempting to access fEnergy from outside of the script, you won't get the value set by it. You should use a Global if you need access from other scripts.

 

To test you could use the FOSE command printc to spit the variable out into the console, like so:

 

set fEnergy to player.getav Endurance

printc "fEnergy : %.0f" fEnergy

Link to comment
Share on other sites

try this and see if it's still reading as 0...

 

float fEnergy

 

begin GameMode

 

set fEnergy to 10

 

end

 

if it is, then the problem must be somewhere else in the script.

Oh, also this is probably nothing but I take it you're not trying to read fEnergy outside this script?

 

 

Like caramellcube says, if you're attempting to access fEnergy from outside of the script, you won't get the value set by it. You should use a Global if you need access from other scripts.

 

To test you could use the FOSE command printc to spit the variable out into the console, like so:

 

set fEnergy to player.getav Endurance

printc "fEnergy : %.0f" fEnergy

 

I'm only trying to use the variable within the script itself. I was allready doing the thing where it shows the variable in the console, that's how I know it was staying at 0. Thank you for all the information :)

 

 

EDIT: so apparently, even tough the game will not reduce your SPECIALs to 0 when you look at them in the pipboy... if you have a natural Endurance of 1 and an effect that lowers Endurance by 1, the game will return a value of 0 if you use getav. Problem solved :laugh:

Edited by redeyesandlonghair
Link to comment
Share on other sites

Not sure If you got this fixed yet..

 

If your doing what I think your trying to .. You can use

 

player.getav EnduranceCondition, Then run a Calculation off your Base.. That way you will be able to handle the actual amount needed to add or subtract without effects present.

 

 

I think thats the way I used to do it.. been awhile..

Link to comment
Share on other sites

  • Recently Browsing   0 members

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