The Elder Scrolls

can’t change value of global variable

Content of the article: "can’t change value of global variable"

so I'm working on this mod that will have some global values to represent oblivion-style attributes but for some reason I just can't seem to get the values to change in game. I have the SetValue commands seemingly set up properly in the script but when i go in game the value remains unchanged (i.e 0.0000 or so for all the floats). I have all the globals set as floats but I'm not sure if that's the problem or not. I have a function that displays a message box for one of the globals so I know that the value just isn't changing at all despite the script having no clear errors.

does anyone have any idea how I can fix this so where the tyBaseAtt globals have their values changed and actually reflected in game? does this have something to do with the functions I put them in potentially? or is it some other issue I'm not even aware of.

here's a full rundown of my current script so you guys can take a look and tell me what's up

Scriptname tyLESAAttributeScript extends Quest race property HighElfRace auto globalvariable property tyLevelUpIncM auto globalvariable property FavorRewardSmall auto globalvariable property SpeechVeryEasy auto globalvariable property tyBaseAttSpe auto globalvariable property tyExtraPerkChance auto globalvariable property tyBaseAttInt auto globalvariable property FavorRewardMedium auto globalvariable property SpeechEasy auto globalvariable property FavorRewardLarge auto race property OrcRace auto globalvariable property tyBaseAttAgi auto globalvariable property QuestReward04Wow auto globalvariable property FavorGoldRewardSmall auto race property DarkElfRace auto globalvariable property MGR11Reward03 auto race property RedguardRace auto globalvariable property tyBaseAttStr auto globalvariable property tyBaseAttLuk auto globalvariable property tyLevelUpIncCW auto globalvariable property tyModAttSpe auto race property KhajiitRace auto globalvariable property QuestReward02Medium auto globalvariable property tyModAttWil auto globalvariable property MGR11Reward01 auto globalvariable property tyBaseAttEnd auto globalvariable property tyLevelUpIncS auto globalvariable property SpeechAverage auto globalvariable property QuestReward03Large auto globalvariable property MGR11Reward04 auto globalvariable property SpeechHard auto globalvariable property tyBaseAttWil auto globalvariable property tySavedAttributes auto globalvariable property tyModAttEnd auto race property BretonRace auto globalvariable property MGR11Reward05 auto globalvariable property tyModAttPer auto race property WoodElfRace auto globalvariable property tyModAttInt auto race property ImperialRace auto globalvariable property SpeechVeryHard auto globalvariable property tyModAttAgi auto globalvariable property tyBaseAttPer auto globalvariable property tyLevelUpIncH auto globalvariable property FavorRewardIntimidate auto race property ArgonianRace auto globalvariable property tyModAttLuk auto race property NordRace auto globalvariable property FavorRewardBribe auto actor property player auto globalvariable property tyModAttStr auto globalvariable property MGR11Reward02 auto globalvariable property QuestReward01Small auto ;-- Variables --------------------------------------- float Str float End float Itn float Wil float Spe float Luk float Agi float Per float StrMod float EndMod float ItnMod float WilMod float SpeMod float LukMod float AgiMod float PerMod :-- Not currently in use ;-- Functions --------------------------------------- Function OnUpdate() player = game.GetPlayer() race playerRace = player.GetRace() tyBaseAttStr.SetValue(6 as float) tyBaseAttEnd.SetValue(8 as float) tyBaseAttInt.SetValue(12 as float) tyBaseAttWil.SetValue(10 as float) tyBaseAttSpe.SetValue(8 as float) tyBaseAttAgi.SetValue(6 as float) tyBaseAttPer.SetValue(6 as float) tyBaseAttLuk.SetValue(10 as float) EndFunction Function OnInit() self.CalculateStatsStart() EndFunction Function CalculateStatsStart() Debug.MessageBox("Strength is " + tyBaseAttStr.GetValue()) EndFunction 

Source: reddit.com

Read:  Alignment Chart - Morality Overhaul

Similar Guides

© Post "can’t change value of global variable" for game The Elder Scrolls.




Top 7 NEW Games of June 2020

Quite a few exciting games are releasing for PC, PS4, Xbox One, and Nintendo in June. Here's what to keep an eye on.


Top 10 NEW Open World Games of 2020

Video games with open worlds continue to roll out in 2020 on PC, PS4, Xbox One, Nintendo Switch, and beyond. Here are some to look forward to!


Top 10 Best New Upcoming Games 2020-2021

The best selection of games which will be released in 2020 and 2021 for PS4, PS5, Xbox One, Xbox Series X, Google Stadia and PC - and you can watch in amazing UHD 4K and 60FPS with latest updates about all of the games in this list!


You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *