NEED HELP WITH SKILL SYSTEM
Posts
Pages:
1
Im trying to make a skill tree system where the player can choose what skills to learn. One of the skills I'm having a hard time making is a passive skill that if the player chooses to learn it, that it checks to see when the player has a shield on, it adds an additional 10 DEF on top of what the shield would normally give, and if the player takes the shield off, it takes off the 10 DEF.
I tried doing conditional branches, variables, and a parrallel process common event to check if the player has a shield equipped, but every time he has it equipped, his DEF goes all the way up to 999 because of the common event in a parallel process. any ideas? Im using RM2k3 btw.
I tried doing conditional branches, variables, and a parrallel process common event to check if the player has a shield equipped, but every time he has it equipped, his DEF goes all the way up to 999 because of the common event in a parallel process. any ideas? Im using RM2k3 btw.
You'll probably need an additional switch condition.
So test if the hero has the shield equipped, and a switch (say "BonusAdded") is off before you add the ten defense. Then turn the switch on. That way it only executes once.
Also test for the case that it isn't equipped AND the switch is ON. In that case, you'll want to remove the added defense and then turn the switch off. Again, this is to prevent the reduction from occuring multiple times. After the defense is removed, the switch is turned off so it will never reach that case again.
Hopefully that helps.
So test if the hero has the shield equipped, and a switch (say "BonusAdded") is off before you add the ten defense. Then turn the switch on. That way it only executes once.
Also test for the case that it isn't equipped AND the switch is ON. In that case, you'll want to remove the added defense and then turn the switch off. Again, this is to prevent the reduction from occuring multiple times. After the defense is removed, the switch is turned off so it will never reach that case again.
Hopefully that helps.
You'll need an 'else' statement on a conditional branch that checks for the shield, and then inside each fork, make a conditional branch that checks for a switch, which I'll call 'SHIELD'.
In the first fork (the IF shield=equipped case), make a conditional branch to see if the switch is OFF, and if so, add 10 defense, and turn the shield switch ON.
In the second fork (the ELSE case), make a conditional branch to see if the switch is ON, and if so, subtract 10 defense, and turn the switch OFF.
IF (player has shield equipped) {
IF (switch SHIELD is OFF) {
Def +10
Switch SHIELD == ON
}
ELSE (player has shield equipped)
IF (switch SHIELD is ON) {
Def -10
Switch SHIELD == OFF
}
}
That should work, I think.
You also may want to make a conditional branch around the whole thing that checks to see if he has the passive skill in question, of course.
In the first fork (the IF shield=equipped case), make a conditional branch to see if the switch is OFF, and if so, add 10 defense, and turn the shield switch ON.
In the second fork (the ELSE case), make a conditional branch to see if the switch is ON, and if so, subtract 10 defense, and turn the switch OFF.
IF (player has shield equipped) {
IF (switch SHIELD is OFF) {
Def +10
Switch SHIELD == ON
}
ELSE (player has shield equipped)
IF (switch SHIELD is ON) {
Def -10
Switch SHIELD == OFF
}
}
That should work, I think.
You also may want to make a conditional branch around the whole thing that checks to see if he has the passive skill in question, of course.
Pages:
1