Ok so I friend asked about an idea of theirs, and wither or not it was possible. I know that it is and had been working on it a bit, but I couldn't find any references about this particular thing anywhere I looked so I decided to make a thread here and see if anyone could help me.
So he wants to a have a skill that lets one character attack for another, while retaining the seconds character turn,
For instance if an attack from "Eric" do more damage to a particular enemy you were facing, you would want to attack with him more. So the second character "Nel" (Or something) would give up there own attack to have Eric attack again.
The script I have is nothing but there bare bones. I was trying to get the functionality out of it first, before I straightened the way it looked up. SO sorry if it looks messy. I'll explain after I show it.
def start_force_attack(id) @actor = id @target = -1 actor_info @temp2 = $game_actors[@actor].skill_cost_payable?(@skill) @temp = $game_actors.dead? end def start if @temp && @temp2 == true $game_actors.pay_skill_cost(@skill) force_skill_attack else$game_message.add("Touch luck chump.") nil end end def actor_info if @actor == 0 @skill = 80 end if @actor == 1 @skill = 85 end if @actor == 2 @skill = 90 end if @actor == 3 @skill = 1 end if @actor == 4 @skill = 1 end end def force_skill_attack battler = $game_party.members[@actor] battler.force_action(@skill, @target) BattleManager.force_action(battler) Fiber.yield while BattleManager.action_forced? end So lets break it down.
I start out with the call (start_force_attack(id) id being what actor I'm taking about.) It's used in the common event that is called by the skill to give it the choice of who is going to attack for you. I waned to make the skill target an ally and then use that to decide but I couldn't figure that out yet.
Then I set variables. @Target = -1 makes the force attack target a random enemy. And actor_info find out what skill to use based on the value of @actor. Then this is where I have the problem. The calls
.skill_cost_payable?(@skill)
.dead?
both wont work. They come from Game_BattlerBase which trickles down in this order. Game_BattlerBase >Game_Battler >(Game_Actor, Game_Enemy) >(Game_Actors, Game_Party). Of course they have the $ in front of them and aren't capitalized while I'm calling them. But they don't work right. everytime I test it, no matter with one of the above I try it says it's and un-initialized variable or method. I kinda get that it wouldn't be initialized, but if I have to recreate everything from that call, there wouldn't much point in calling a method. So I know I'm just overlooking something.
Also, I need the force_attack to not override anyone's upcoming regular attack. It's giving me a dang headache and I could use some help. Any would be appreciated.
So he wants to a have a skill that lets one character attack for another, while retaining the seconds character turn,
For instance if an attack from "Eric" do more damage to a particular enemy you were facing, you would want to attack with him more. So the second character "Nel" (Or something) would give up there own attack to have Eric attack again.
The script I have is nothing but there bare bones. I was trying to get the functionality out of it first, before I straightened the way it looked up. SO sorry if it looks messy. I'll explain after I show it.
def start_force_attack(id) @actor = id @target = -1 actor_info @temp2 = $game_actors[@actor].skill_cost_payable?(@skill) @temp = $game_actors.dead? end def start if @temp && @temp2 == true $game_actors.pay_skill_cost(@skill) force_skill_attack else$game_message.add("Touch luck chump.") nil end end def actor_info if @actor == 0 @skill = 80 end if @actor == 1 @skill = 85 end if @actor == 2 @skill = 90 end if @actor == 3 @skill = 1 end if @actor == 4 @skill = 1 end end def force_skill_attack battler = $game_party.members[@actor] battler.force_action(@skill, @target) BattleManager.force_action(battler) Fiber.yield while BattleManager.action_forced? end So lets break it down.
I start out with the call (start_force_attack(id) id being what actor I'm taking about.) It's used in the common event that is called by the skill to give it the choice of who is going to attack for you. I waned to make the skill target an ally and then use that to decide but I couldn't figure that out yet.
Then I set variables. @Target = -1 makes the force attack target a random enemy. And actor_info find out what skill to use based on the value of @actor. Then this is where I have the problem. The calls
.skill_cost_payable?(@skill)
.dead?
both wont work. They come from Game_BattlerBase which trickles down in this order. Game_BattlerBase >Game_Battler >(Game_Actor, Game_Enemy) >(Game_Actors, Game_Party). Of course they have the $ in front of them and aren't capitalized while I'm calling them. But they don't work right. everytime I test it, no matter with one of the above I try it says it's and un-initialized variable or method. I kinda get that it wouldn't be initialized, but if I have to recreate everything from that call, there wouldn't much point in calling a method. So I know I'm just overlooking something.
Also, I need the force_attack to not override anyone's upcoming regular attack. It's giving me a dang headache and I could use some help. Any would be appreciated.