[RMVX ACE] SIMPLE BATTLE ROWS
Posts
Pages:
1
I divide enemies into two groups with a script.
Some enemies are in front rows and the rest of enemies are in back rows.
The script basically works pretty well but the enemies in the back rows always deal the same damage as the enemies in the front rows do.
I want to know how I can weaken ATK of the enemies in the back rows.
Mr Trivel's Simple Battle Rows http://pastebin.com/MHG0HuZL
Some enemies are in front rows and the rest of enemies are in back rows.
The script basically works pretty well but the enemies in the back rows always deal the same damage as the enemies in the front rows do.
I want to know how I can weaken ATK of the enemies in the back rows.
Mr Trivel's Simple Battle Rows http://pastebin.com/MHG0HuZL
Starting at line 111 to 113, replace all this:
with just this:
Basically, just remove the if and end lines. Should do the trick.
if user.is_a?(Game_Actor) value *= MrTS::Formation::DAMAGE_BACKROW_DEALT if user.penalty_damage? end
with just this:
value *= MrTS::Formation::DAMAGE_BACKROW_DEALT if user.penalty_damage?
Basically, just remove the if and end lines. Should do the trick.
Thank you for your answer.
I simply removed the lines you mentioned and an error occurred when an enemy attacked.
The line 112 NoMethodError
undefined method `penalty_damage?'for
#<Game_Enemy:0X8866bec>
Do you know why the error occurred?
I simply removed the lines you mentioned and an error occurred when an enemy attacked.
The line 112 NoMethodError
undefined method `penalty_damage?'for
#<Game_Enemy:0X8866bec>
Do you know why the error occurred?
Just a hint, if something says theres an undefined method, it means its looking for a method that isn't defined where its looking.
In this case, the reason the original script checked for game_actor is that it has different scripts for enemies and actors. Thus, when we removed the if check, it started checking both as the same script. The original designer didn't intend for enemies to reduce damage when in the backrow, so he didn't actually include the penalty_damage method under enemy battlers.
That's the code we're missing. If you copy it to line 234ish, where we changed game_enemy, it should fix that error at least. Dunno what else will crop up though :P
Edit: Just as a note, VXACE tends to look at characters and enemies as different code entirely, so if you include something you want for both, you can include it under game_battler overall, and not game_enemy or game_actor individually. This should mean you can just change the inheritances for game_actor to game_battler generally, but I'm sure there's things the game is checking for that might cause issues. Particularly, no idea if what w.wtype_id is checking for is gonna throw errors when it tries to do it for enemy battlers.
In this case, the reason the original script checked for game_actor is that it has different scripts for enemies and actors. Thus, when we removed the if check, it started checking both as the same script. The original designer didn't intend for enemies to reduce damage when in the backrow, so he didn't actually include the penalty_damage method under enemy battlers.
def penalty_damage? weapons.each do |w| if (MrTS::Formation::NO_PENALTY_BACKROW_WEAPON_IDS.include?(w.wtype_id) && @battle_row == 1) || @battle_row == 0 return false end end return true end
That's the code we're missing. If you copy it to line 234ish, where we changed game_enemy, it should fix that error at least. Dunno what else will crop up though :P
Edit: Just as a note, VXACE tends to look at characters and enemies as different code entirely, so if you include something you want for both, you can include it under game_battler overall, and not game_enemy or game_actor individually. This should mean you can just change the inheritances for game_actor to game_battler generally, but I'm sure there's things the game is checking for that might cause issues. Particularly, no idea if what w.wtype_id is checking for is gonna throw errors when it tries to do it for enemy battlers.
Ah, didn't notice that. The error was because Enemies don't have a 'penalty_damage?' method on them (only actors do). (Luckily) It's an easy fix: if it's missing, then we make one!
Below this line:
Add all this:
Edit: Sniped by Rine
Edit2: Rine, the enemy class doesn't have weapons...
Below this line:
class Game_Enemy < Game_Battler
def penalty_damage? return @battle_row end
Edit: Sniped by Rine
Edit2: Rine, the enemy class doesn't have weapons...
So should just return true then, ideally. But avoid the issue and use Karins script, probably a more reliable source here!
Thank you for your advices.
The error didn't occur when I tried the script karins made.
It weakened enemies in a back row but weakened enemies in a front row too...
I think all the problems should be solved if I correctly take your advices.
Do you know why the enemies in the front row were weakened?
The error didn't occur when I tried the script karins made.
It weakened enemies in a back row but weakened enemies in a front row too...
I think all the problems should be solved if I correctly take your advices.
Do you know why the enemies in the front row were weakened?
That's odd. I tried testing it out and it seems that it isn't being evaluated correctly...
Change the return line to:
return @battle_row == 1
I tried it and it worked fine.
Change the return line to:
return @battle_row == 1
I tried it and it worked fine.
I tried your method with a new project and everything worked fine.
My current project has too many scripts and I should remove some of them.
Anyway,My major problem was solved.
Thank you for helping me many times :)
My current project has too many scripts and I should remove some of them.
Anyway,My major problem was solved.
Thank you for helping me many times :)
Pages:
1















