alexalexalex11314 Posted November 24, 2019 Share Posted November 24, 2019 (edited) Got this code. Compiles, but doesn't work in game. What is incorrect? PlayerRaceVar = Game.GetPlayer().GetRace() if PlayerRaceVar=="ArgonianRace" game.getplayer().setactorvalue("HealRate", 0.1); game.getplayer().setactorvalue("StaminaRate", 3); game.getplayer().setactorvalue("Lockpicking", rgx_player_skill_bonus); game.getplayer().setactorvalue("Alteration", rgx_player_skill_bonus); Debug.Notification("Argonian it is."); else ; donothing endif Also tried if Game.GetPlayer().GetRace()=="ArgonianRace" game.getplayer().setactorvalue("HealRate", 0.1); game.getplayer().setactorvalue("StaminaRate", 3); game.getplayer().setactorvalue("Lockpicking", rgx_player_skill_bonus); game.getplayer().setactorvalue("Alteration", rgx_player_skill_bonus); Debug.Notification("Argonian it is.") else ;donothing endif UPD: SOLUTION Race Property ArgonianRace Auto if Game.GetPlayer().GetRace() == ArgonianRace code else code endif Edited November 28, 2019 by alexalexalex11314 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 25, 2019 Share Posted November 25, 2019 Without the entire script cannot rule out logic issues preventing the posted snippet from running. Also make sure you test on a new game to rule out already loaded objects not recognizing the changes. Link to comment Share on other sites More sharing options...
alexalexalex11314 Posted November 26, 2019 Author Share Posted November 26, 2019 It's a stage of sqs quest script. The previous part runs just fine. ; game.getplayer().setactorvalue("HealRate", 0.1);I think it might be a syntactical issue, but can't figure it out where I'm mistaken. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 26, 2019 Share Posted November 26, 2019 Try: Quest stage fragment code - not designed for a full script - not tested for function or compilation Actor PlayerRef = Game.GetPlayer() Race PlayerRace = PlayerRef.GetRace() PlayerRef.setactorvalue("HealRate", 0.1) If PlayerRace == "ArgonianRace" PlayerRef.setactorvalue("HealRate", 0.1) PlayerRef.setactorvalue("StaminaRate", 3) PlayerRef.setactorvalue("Lockpicking", rgx_player_skill_bonus) PlayerRef.setactorvalue("Alteration", rgx_player_skill_bonus) Debug.Notification("Argonian it is.") else ; do nothing EndIf Link to comment Share on other sites More sharing options...
alexalexalex11314 Posted November 27, 2019 Author Share Posted November 27, 2019 Nothing :( Link to comment Share on other sites More sharing options...
Grospolina Posted November 27, 2019 Share Posted November 27, 2019 Try without the quotes, like this: if Game.GetPlayer().GetRace() == ArgonianRace Link to comment Share on other sites More sharing options...
alexalexalex11314 Posted November 27, 2019 Author Share Posted November 27, 2019 It's an undefined variable without the quotes. Link to comment Share on other sites More sharing options...
Grospolina Posted November 28, 2019 Share Posted November 28, 2019 Oops, you need to define it then: Race Property ArgonianRace Auto if Game.GetPlayer().GetRace() == ArgonianRace Link to comment Share on other sites More sharing options...
alexalexalex11314 Posted November 28, 2019 Author Share Posted November 28, 2019 Long live to you, wise gentleman. It worked. Link to comment Share on other sites More sharing options...
Grospolina Posted November 28, 2019 Share Posted November 28, 2019 Nice! Link to comment Share on other sites More sharing options...
Recommended Posts