Aller au contenu

Photo

Want to add an item to the inventory when I reach a certain level


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
rak72

rak72
  • Members
  • 2 299 messages
I want to add an item to my inventory when I reach, say, level 18.  I'm not sure how to word that line.  I guess it would go something to the effect of:

if( WR_GetPlotFlag(PLT_Player_DEFINED, Player_DEFINED_AT_LEAST_level18)
== FALSE )
return;

Any help would be apreciatedPosted Image

#2
Proleric

Proleric
  • Members
  • 2 352 messages
You'd want to trap the PLAYER_LEVELUP event in the player script.

GetLevel will tell you what level the player has achieved.

You might want to set a plot flag when the item is given, to prevent it being awarded twice (though that's belt-and-braces).

#3
rak72

rak72
  • Members
  • 2 299 messages

Proleric1 wrote...

You'd want to trap the PLAYER_LEVELUP event in the player script.

GetLevel will tell you what level the player has achieved.

You might want to set a plot flag when the item is given, to prevent it being awarded twice (though that's belt-and-braces).


Does that mean it would run the first time I level up?  Because I don't  want it to run through until I get to ie level 18

#4
Proleric

Proleric
  • Members
  • 2 352 messages
No, you'd use GetLevel to check for reaching level 18.