Status
Not open for further replies.

Shiro-chan

Friendly Neighbourhood Neppy Maid
Veteran
Joined
Aug 7, 2018
Messages
197
Reaction score
61
First Language
German
Primarily Uses
RMVXA
Hello,
I have the following situation:
-an enemy can perform a scan on one/two of the party's actors (out of a maximum of four) via a decision-making process:
--if only one actor is available/alive, the enemy simply copies that actor's skill via the scan and then performs the skill itself (say a heal if only Natalie is available/alive)
--if at least two are available and not dead, those two are scanned via force-action and the enemy fires a special combination attack based on who those two actors are

My problem is that while everything works if all 4 actors are in the party, in case that an actor is missing, the force-action command (based on the index system the program provides) bugs out and may display the scan on the wrong actor(s); for example if Erik is missing, then Alice and Natalie are scanned when it should be Erik and Alice being scanned respectively (it's only a visual error though).

I use Yanfly Engine Ace - Ace Battle Engine for this.

So question is: is it possible to NOT use indexes for the scan skills, but instead use the actual actor numbers (2-5) rather than indexes 1-4?

Thank you very much for reading and, hopefully, providing an answer.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,849
Reaction score
9,243
First Language
Indonesian
Primarily Uses
N/A
You could try to replicate the same effect but use script calls. This is untested, taken directly from the code that handles the force action.
Code:
battler = $game_troop.members[enemy_index]
battler.force_action(skill_id, $game_actors[actor_id].index)
BattleManager.force_action(battler)
Fiber.yield while BattleManager.action_forced?
What you need to replace
enemy_index = replace with the enemy index (not id) based on how you put it in the troop
skill_id = replace with the skill id you want the enemy to use
actor_id = replace it with the actor id you want the enemy to target
 

Shiro-chan

Friendly Neighbourhood Neppy Maid
Veteran
Joined
Aug 7, 2018
Messages
197
Reaction score
61
First Language
German
Primarily Uses
RMVXA
I tried to script-call this:
Code:
battler = $game_troop.members[1]
battler.force_action(471, $game_actors[2].index)
BattleManager.force_action(battler)
Fiber.yield while BattleManager.action_forced?

Sadly it crashes outright.

Code:
---------------------------
Magical Camp 0.4.7b
---------------------------
Script 'Game_Interpreter' line 1411: NoMethodError occurred.

undefined method `force_action' for nil:NilClass
---------------------------
OK  
---------------------------
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,849
Reaction score
9,243
First Language
Indonesian
Primarily Uses
N/A
Index started from 0, not 1
 

Shiro-chan

Friendly Neighbourhood Neppy Maid
Veteran
Joined
Aug 7, 2018
Messages
197
Reaction score
61
First Language
German
Primarily Uses
RMVXA
Right, that was the error. It works perfectly now, thank you very much.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,842
Reaction score
6,258
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Voice.gif
The Voice... They usually show up to talk to you about leaving your mark on the world, which is one of the major themes of my game... How will you be remembered by society.
The only time my brother shows me any kind of support is by liking or LOL my Facebook Comments.
I finally finished the Coliseum for my game. Love how it looks. Credits for the assets goes to Kokoro Reflections, @Starbird_Resources, and @megumi014.
Colossuem.png
Mimics! Mimics everywhere!

Forum statistics

Threads
124,514
Messages
1,164,170
Members
163,349
Latest member
roydonne
Top