Help - Search - Members - Calendar
Full Version: help with force action
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Discussion
darkace77450
I'm looking to make a few skills using force action that are usable by any character and tie these skills to the use of items from the player's inventory. Am I going to have to use variablse and conditional branches to force the action subject be the correct user of the skill? Or is there another, easier way to do this that I'm just not seeing? Thanks.
Kread-EX
The only other way I can think of would be to force the action via Call Script commands. It's not that complicated: it's simply mimicking the Force Action command.
There are several steps for this:
1 - Go into the Scene_Battle section, and just under Scene_Battle < Scene_Base, add this line:
CODE
attr_reader  :active_battler
Now you can use Call Script commands when you intended to use Force Action.

2 - First, indicate the type of action. For a skill, it's 1.
CODE
$scene.active_battler.action.kind = 1


3 - Then, the ID of the skill.
CODE
$scene.active_battler.action.skill_id = 3
I used 3 as an example, but you can use whatever you want.

4 - The target of the skill. You have three possibilities.
CODE
$scene.active_battler.action.decide_last_target
The previously selected target.
CODE
$scene.active_battler.action.decide_random_target
A random one.
CODE
$scene.active_battler.action.target_index = 0
A specific target. The number is the index in the troops.

5 - Then turning the force flag on.
CODE
$scene.active_battler.action.forcing = true
$game_troop.forcing_battler = $scene.active_battler
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.