Aller au contenu

Photo

Setting variable upon a finished rest?


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

#1
Grani

Grani
  • Members
  • 554 messages

I wanted to have several items with unique powers, but make it so that not only they would be usable once per day, but that if a player uses one of them, he can't use any others in the same day.

 

So, naturally, simply choosing a unique power spell usable once per day as an item property won't cut it.

I wanted to achieve this with variables - using any of these items will set a specific integer on a PC to 1 and if the user has this variable set to 1, then he will receive a message that he needs to rest upon trying to use the item.

 

Here's where the problem lies. I wanted the variable to reset to 0 upon resting, but only if the PC actually completes the rest. A simple SetInteger in the OnRest event would reset this variable as soon as the player starts to rest.

 

What can I do to make the variable reset after a finished rest only? :)



#2
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

http://www.nwnlexico...stRestEventType

 

If I have a bit of time later I'll post some sample code, doing something similar to what you are, from our rest event. You can see how it basically works from the lexicon example, though.

 

Funky



#3
Grani

Grani
  • Members
  • 554 messages

Exactly what I needed!

Thank you.