RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
In Battle Enemy Change Parameter

0 Members and 1 Guest are viewing this topic.

*
Rep: +0/-0Level 82
In Battle Enemy Change Parameter
12/01/2013



Summary
I need a way to change Enemies parameters during battle applying a positive or negative variable.
I searched for all similar scripts but I failed to find a script that could manage to do the Kind of operations that I need to do in my game.
In My game this kind of modification can apply to the actors too, and the function change parameter already cover everything I need to do with the Variable Operand but a similar function for enemies is missing.

Features Desired
I need a script who either
  • Allows me to add or subtract the content of a variable to an enemy stat of my choice.
  • Allows me to replace a monster stats with actor stats like in Yanfly Doppelganger script but allows me to constantly refresh the changes in that actor parameters and allows me to copy an actor that is not in the party in order to use the change parameter function on an enemy.

Mockups
I can't think of a visual that would provide any help. Feel free to ask If you need something here

Games its been in
  • None that I know of

What other scripts are you using?
  • YEA ace Core Engine
  • YEA Ace Battle Engine
I also have
  • YEA Enemy Levels
  • YEA Doppelganger
In my attept to resolve My problem. I have no real need for these and I will remove them if provided with a script that makes no use of them and delivers the effect I want.



Did you search?
yes

Where did you search?

What did you search for?
  • Replace Enemy Parameters



I would really Appreciate any help or advice on the matter.
Feel free to ask any question if you need more information on how will this script be implemented in game
Thanks

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Under what circumstances would you want the parameters to change? Just upon an event? In that case, the following code in a script call should work:

Code: [Select]
b = $game_troop.members[troop_id]
b.add_param(param_id, value)

Where:

troop ID is the enemy's index in the troop. (IE. 0 is the first enemy, 1 is the second enemy, etc..)

param_id is between 0 and 7. 0=> Max HP; 1 => Max MP; 2 => ATK; 3 => DEF; 4 => MAT; 5 => MDF; 6 => AGI; 7 => LUK.

value is the integer amount you want to add.

Examples:

Code: [Select]
b = $game_troop.members[2]
b.add_param(6, 100)

That would add 100 to the AGI of the third enemy in the troop.

Code: [Select]
b = $game_troop.members[0]
v = $game_variables[4]
b.add_param(2, v)

That would add the value of variable 4 to the ATK of the first enemy in the troop.


If you wanted to apply it to actors, you would change the b=  line to:

Code: [Select]
b = $game_party.members[x]

*
Rep: +0/-0Level 82
Thank you very much I will Try it as soon as possible.

I have a rather complex Battle system that is based on a lot of common events triggering during battles and extra statistics stored in variables.
This situation in particular will be triggered by one of these common events.

So I guess I just have to put that script into the common event.

Just 3 of questions. I'm pretty sure about the answers myself but I'll ask just to be sure...

1) Is the modifier stackable?
If it Is I will use it like it is. If is not I will simply have to store the variable and add/subtract from it instead of creating a new variable every time the event triggers. in either case there is no need for a new script, I can do the adjustements myself.

2)To subtract from a stat Should I change the word "add" to "sub" (is it sub?) or should I enter a negative variable? probably both but ... just to be sure.

3)The script does anything that will modify the stats of the basic monster? I'll try to explain better....
If I drain 10 AGI from the enemy during a battle and then I will face the same kind of enemy again would he be as good as new or would be the drain permanently imprinted in that type of enemy? (Probably not since it affects troop_id and not Enemy_id)

Thanks a lot for the help.

P.s.

Actually... another question arises that is way more important.
Using this script is it possible to lower a stat to 0 or below? If that is possible I need to anticipate or I would divide by 0 ... and you know what happens when you divide by 0....
« Last Edit: January 12, 2013, 07:45:35 PM by scarletrose »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
1. Yes.

2. You would use a negative value. Do not change the name of the method.

3. The script only affects the monster in the troop, not its basic stats. So the enemy will be as good as new next time you battle one.

4. No, the minimum value is 1 for all parameters except Max MP, in which case it is 0. But you wouldn't ordinarily divide by the max MP. (That said, the actual value you are modifying can drop below 0, it's just that the actual parameter cannot. For example, if the enemy's ATK is 20 and you drain it by 30, then the enemy's ATK would only be 1 when you retrieve it directly. However, if you wanted to then bring the enemy's ATK to 5, you would need to add 15, not 4.)
« Last Edit: January 12, 2013, 10:19:48 PM by modern algebra »