SenorPato Posted May 7, 2015 Share Posted May 7, 2015 (edited) For a stage in my quest I want the player to kill a couple of enemies in any order the player wants to. In order to keep track of how many are killed I tried to make a global variable as shown in this post. I made a new Global in the creation kit, added it to my quest in the 'Quest Data' tab and made the script below. But for some reason the global wont get updated and always stays 0. Anyone able to give me some advice? Thanks in advance. Scriptname ChickenQuestScript2 extends actor {objective klaar als kip dood} Quest property eenQuest auto int property nummerObjective auto GlobalVariable property globalNummertje auto int nummertje Event OnDeath(Actor akKiller) eenQuest.SetObjectiveCompleted(nummerObjective) nummertje = globalNummertje.GetValueInt() + 1 globalNummertje.SetValueInt(nummertje) eenQuest.UpdateCurrentInstanceGlobal(globalNummertje) Debug.Notification(nummertje) Debug.Notification(globalNummertje.GetValueInt()) EndEvent Edited May 7, 2015 by SenorPato Link to comment Share on other sites More sharing options...
Mattiewagg Posted May 7, 2015 Share Posted May 7, 2015 Make sure the global is NOT constant. And don't do that to add one to it - remove those lines and instead of the whole num = global.getvalue and setvalueint, just use: My global.Mod(1.0) Link to comment Share on other sites More sharing options...
SenorPato Posted May 8, 2015 Author Share Posted May 8, 2015 Thanks once again, works like a charm. Also "MyGlobal.GetValue() as int" seems to work instead of "MyGlobal.GetValueInt()". Link to comment Share on other sites More sharing options...
Recommended Posts