Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Skill trouble!

Snej

Member

This is my first post in this forum and I didn´t find any related topic or am bad at searching..
Anyhow. Does anyone know how to make two skills with one skill. Damn that didn't sound good but like
Hero1 cast skill on Hero2 that makes Hero2 attack enemy or somthing like that.

My attemts to make this didnt work at all or only half way. So if somone know a solution for my problem please help and you'll save my day! :thumb: 
 

Fusty

Sponsor

Well I know a way to make in in Xp but I don't know if this works in Vx.

Make a skill that uses a common event like this:

@> Force Action: Actor No.2, [ Attack ] Random, Execute Now

Hope it helps.
 

Snej

Member

Well that is the way I have done it but it doesn´t work as I want it to..
The problem is when i do so it only works the first time I cast the spell with Hero1 the next time I press it nothing happen..
Ive also tried to give the skill a state and then made a conditional branch that makes if hero status is (name of status effect) then force the action but that gave the same result..

Thanks for replying
 

Snej

Member

Yes! Finally got it to work and it was just as you said:

Make a skill that uses a common event like this:

@> Force Action: Actor No.2, [ Attack ] Random, Execute Now

<b>BIG THANKS</b>



But then i still got a problem.. how do I make it so that the actor that has been hit by the skill uses the attack?
As it is now I can only make one Actor could do this "counter" skill..

right now my common event look like this

Battle behavior change: Character 2 public notice, [Continues Attack], Random
Switch operation: [0001:CAST_OFF]=ON
 
This will set variable 5 to the target index [1-4], then you can use the variable in your common event to determine who should use the special attack.

Code:
# Extend Scene_Battle.execute_action_skill to store the target index
# so it can be accessed from a common event

class Scene_Battle

  alias orig_execute_action_skill execute_action_skill
  
  def execute_action_skill
    orig_execute_action_skill
    $game_variables[5] = @active_battler.action.target_index + 1
  end
end

Paste above 'main', in the "Insert Here" section.
 

Snej

Member

Ok so what do I do when i have pasted the script above main, sorry im not to good with rmvx nor rmxp or any other rpg maker. Could you explain it more detailed or an easier version of what you just said. I guess I am to stupid  :crazy:
 
In your common event...
Code:
@>Conditional Branch: Variable [0005] == 1
     @Force Action: Actor No.1, [Dual Attack], Random
     @>
 :  Branch End
@>Conditional Branch: Variable [0005] == 2
     @Force Action: Actor No.2, [Dual Attack], Random
     @>
 :  Branch End
@>Conditional Branch: Variable [0005] == 3
     @Force Action: Actor No.3, [Dual Attack], Random
     @>
 :  Branch End
@>Conditional Branch: Variable [0005] == 4
     @Force Action: Actor No.4, [Dual Attack], Random
     @>
 :  Branch End

If you want to use a different variable, just change the only '5' in the script to which ever variable you want to use.
I used "Dual Attack" as an example. Use whichever skill you want the 'target' to use.

Got it?
 

Snej

Member

I thougt I got it but I must have missed somthing out.. For some reason nothing happens after I use the first skill.
Could it be that I have to set up variable 5 in any way?
 
First, let's make sure the script is working.  Go into battle, execute your skill on one of your teammates. Then kill all the monsters.
When you are back on the map, hit F9 and go look at variable 5. If it's 0, then the script is not working.  If it is anything other than 0 (should be the number of the party member you used the skill on), then post your common event.
 
Where did you put the script?

In the script editor, on the left side, right-click on the empty space right above
  • [#] Main Process
Select "Insert"    Now, there should be another empty script
Type in a Name at the bottom of the left side,  "Store Target"
Paste the script into the right side.

Now, go the the first skill. (The one you want the first actor to use)
Set the "Common Event" field to the common event you are using

Set up the common event like I have it up there, except with the 2nd action you want the target of the 1st skill to use, instead of "Dual Attack".  By the way, what is it?

It should work fine, I just tested it.
 

Snej

Member

Finally got it to work. It worked just as you said but I get an error when the fight is over, I cant get out of the battle (hero1 disapears and the game freezes when enemy is slayed) Big thanks for helping me this far I think I got how most of it works now :smile:
 
I tested it on a brand new project. So, you must have something else going on there that is causing the problem. If you can't figure it out, you could upload you project somewhere, and I'll take a look.

Be Well
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top