LilSpriteX
07-13-2005, 11:09 PM
I've added aggro to my game, so actions taken by members will cause some enemies to solely attack them unless someone else accrues more aggro, or taunts. I figured I'd prefer this over doing stat checks (enemies that attack whoever has the lowest DEF, highest ATK, etc), since this way an enemy's target will change depending on the party's actions (plus it makes my Taunt ability much more useful). So far it works fine, I'm posting my scripts to see what you guys think, and if you have any suggestions.
Okay, right now it uses 7 variables (is that too much?), Aggro Total, which keeps track of the highest aggro accrued, Aggro Member 0 - 3, which is each member's individual aggro, Aggro Adder, which holds the aggro to be added to the member's variable (used for simplicity's sake, so I can just call up the Aggro script rather than copy and paste it for every single attack), and Aggro Winner, which tells which member has the highest aggro.
After each attack that accrues aggro, I add the amount (whether set or random) to [Aggro Adder], then run this script:
Script Branch: Condition: Variable [Insti Member] = 0 *or 1, 2, 3*
Data: Variable: [Aggro Member 0] + [Aggro Adder]
Script Branch: Condition: Variable [Aggro Member 0] > or = [Aggro Total]
Data: Variable [Aggro Total] = [Aggro Member 0]
Data: Variable [Aggro Winner] equals 0
Script: Condition End
Data: Variable: [Aggro Adder] = 0
Force Script End
Script: Condition End
Then do identical Script Branches, but with [Insti Member] equalling 1 or 2 or 3, depending on which member you're referring to (0 = leader), [Aggro Member *], where '*' is whichever member is being checked, and [Aggro Winner] = whichever member is being checked.
Then, put this in the Trait Script of each enemy attack you want to be affected by aggro:
Script Branch: Condition: Variable [Aggro Total] > 0
Data: Variable: [Action: Enemy] = [Aggro Winner]
*Attack info here*
Force Script End
Script: Condition End
What do you think? I'm planning to make one class have some aggro manipulation moves, so I'll probably need to do another script that checks the Aggro Winner at the end of any move that increases/decreases a member's aggro. So far, though, it seems to work nicely. Yay RPG Maker 2!
Okay, right now it uses 7 variables (is that too much?), Aggro Total, which keeps track of the highest aggro accrued, Aggro Member 0 - 3, which is each member's individual aggro, Aggro Adder, which holds the aggro to be added to the member's variable (used for simplicity's sake, so I can just call up the Aggro script rather than copy and paste it for every single attack), and Aggro Winner, which tells which member has the highest aggro.
After each attack that accrues aggro, I add the amount (whether set or random) to [Aggro Adder], then run this script:
Script Branch: Condition: Variable [Insti Member] = 0 *or 1, 2, 3*
Data: Variable: [Aggro Member 0] + [Aggro Adder]
Script Branch: Condition: Variable [Aggro Member 0] > or = [Aggro Total]
Data: Variable [Aggro Total] = [Aggro Member 0]
Data: Variable [Aggro Winner] equals 0
Script: Condition End
Data: Variable: [Aggro Adder] = 0
Force Script End
Script: Condition End
Then do identical Script Branches, but with [Insti Member] equalling 1 or 2 or 3, depending on which member you're referring to (0 = leader), [Aggro Member *], where '*' is whichever member is being checked, and [Aggro Winner] = whichever member is being checked.
Then, put this in the Trait Script of each enemy attack you want to be affected by aggro:
Script Branch: Condition: Variable [Aggro Total] > 0
Data: Variable: [Action: Enemy] = [Aggro Winner]
*Attack info here*
Force Script End
Script: Condition End
What do you think? I'm planning to make one class have some aggro manipulation moves, so I'll probably need to do another script that checks the Aggro Winner at the end of any move that increases/decreases a member's aggro. So far, though, it seems to work nicely. Yay RPG Maker 2!