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.

Getting Arbitrary Player Battler #N's Name

Sodon

Member

I'm trying to use the Force Action event to have a character attack three times in one turn. However, I only want one character to be able to do this... Say, George. George could be in slot 2, 3, or 4 in the player's party... But Force Action only lets you pick by slot #. I figure the best way to do this is a conditional that tests to see which actor is named "George" and then attack with that actor...

So basically I was wondering how to do that with a script in the conditional statement (game_actor1.name == 'george' [or something]). Or, if you have a better idea how I might do this...

The idea is a triple attack, but I want it to look like George is really attacking with his equipped weapon three times (not just a skill with 300% attack power...)

Thanks!
 
This is how I'm doing it... I'm not so sure that it'll work yet if the battler spots are switched, but I'm guessing that all you have to do is put the following script into a call script in a common event. It should work... # = The ID of the character in the database.

Code:
@var = $game_actors[#].index
iterate_battler(1, @var) do |battler|
ca = battler.current_action
ca.kind = 0
ca.basic = 0
ca.decide_random_target_for_actor
battler.current_action.forcing = true
$game_temp.forcing_battler = battler
@index += 1
return false
end

If you want the player to attack thrice, all you have to do is duplicate the call script twice.

EDIT::: The script tested... It works.
 

Sodon

Member

Thanks! I don't have time to try it out right now, but I think I will end up having one question. Does anything need to be changed to suit George? Or will this just work if I put it by itself in a common event which his spell will call?
 

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