Substitue Attack script help

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.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Oh, sorry. I hadn't realized it wasn't the right forum.
Can no one help me at all? Seriously, any input would be appreciated.
I've had a thought - shouldn't this be in the section 'Scripts in development'?  That is where people who are interested in helping put scripts together might look more often.

As I'm not sure about the best place for this, it might be better for you to report your first post and ask if it should be moved.  Then the mod for this part of the forum can work it out.
Hm, it sounds like that would be a better place for it, but I figured Shaz knows more than I do about the forum and all. He's sure to see this, so I'll leave it in his hands. I'll continue to work on this when I have time. I've been looking at tutorials and stuff, but it's hard for to come up with something this original. My previous scripts have been made by looking at others who did similar things and working from there. I had references to work off of. I can't find anything on this. So I'll digging into as much of the meat of the battler manager and the relationship between it and other classes/methods such as $game_party and stuff. Figuring in attr_accessor have me slightly confused and simply calling methods in the same, or different classes have given me some trouble as well. It's a head scratcher, but I'll see what I can do.

So needless to say this script wont be ready soon, but I haven't given up 😉 . I just need somebody to point me in the right direction and it'll fall into place.
I know from status updates that Shaz is moving house and won't be around for a while.

Oh, and Shaz is a 'she'.

Original thread: https://forums.rpgmakerweb.com/threads/substitue-attack-script-help.41294/