Jump to content

Hit a wall with papyrus global variable


Recommended Posts

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 by SenorPato
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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