I have a level-up script associated with a feat that is supposed to fire once when leveling-up. However this one is firing when leveling-up, resting, entering another area, etc. How would i adjust the on-level up script to make it so it fires only when leveling-up and no other time?
Level-up script
#1
Posté 20 juin 2014 - 04:39
#2
Posté 20 juin 2014 - 04:54
you will have to do a multitude of if statements that check for current exp for every evolution of class and race combinations - dont fret too much there are only like 60 of them
may be a simpler way but that jumped out at me first.
#3
Posté 20 juin 2014 - 05:02
#4
Posté 20 juin 2014 - 05:24
You mean after level up or before?
To make it happen before you would have to edit the XML to trap the level up button.
To make it fire after you just attach the script to the module's On Level Up event in the module properties. It shouldn't fire under other circumstances unless you attach the same script to multiple events.
How have you made the script trigger?
#5
Posté 20 juin 2014 - 05:28
If you want to make the script only fire if they have the feat you mention, then do it in the on-level up script and use if (GetHasFeat(x))
#6
Posté 20 juin 2014 - 06:27
I have it only in the OnLevelUp script and it has the if (GetHasFeat(x)) condition but, it seems once anyone in the party has the feat it fired when leveling up, when resting, when entering another area, etc. I simply cannot explain why it is firing at all of these times when there is no reason for it to fire at these times. I was wondering it there is a way to set a detectable interger that will control it so it will only fire when leveling up as I cannot see why it is firing these other times.
Here is a copy of the level-up script:
}
#7
Posté 20 juin 2014 - 07:10
That is just completely bizarre then. We have an on level up script on our PW and it only fires when someone levels up.
Its really like you have the script firing due to something else causing it.... you didn't make the feat persistent and active did you? Then attach the level up script to that feat?
#8
Posté 20 juin 2014 - 01:34
I made it persistant but not active. I attached the script to a corresponding spell.
#9
Posté 21 juin 2014 - 04:22
Hmm.. cound be the persistent flag triggering it then.
And from what i see, you don't need to attach the the feat to a spell to trigger the script.
The level up event will trigger the script anyway. The feat then is just a placeholder, something to check for that determines what should be done in the level up script.
So, if i understand things correctly, remove the spell reference from the feat and turn off persistent.
Do everything you need to do in the on level up script.





Retour en haut







