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.

Calling Interpreter

So I can easily get all the targets I need and put them into variables and such, but when I have them I have to use a million conditional branches for each possible instance/value of a variable and have a forced action command hit a corresponding enemy.
Is there a way to simply call up the interpreter and put in my own values instead of using the presets they have?
Like instead of forced action: target index 1. Could I do...
forced action: target index $game_variables 
 
Got it figured out!!

if user.id != 3
if $game_variables[0005] == 3 #start Shane counterattack
$game_variables[34] += 1 #counter attack counter
$game_variables[0001] = $game_actors[003].at
$game_actors[003].current_action.force_kind = 1
$game_actors[003].current_action.force_skill_id = 9
$game_actors[003].current_action.target_index = self.index
$game_temp.forcing_battler = $game_actors[003]
#battler.current_action.skill_id = 9
#battler.current_action.target_index = user.index
#$game_switches[0004] = 1
end
end
The skill itself (here id9) needs to call a common event to call a script command that has...
$game_actors[3].at = $game_variables[1]

This is so the players CT/ATB doesn't reset after counter attacking (unless you want that). I've done it without calling a common event via the skill, but it doesn't seem to be working consistently. Though I'm sure it's very possible and easy.

This code is placed underneath...
# In case of on-target hit
if hit_result == true
around line 2846 in RTAB v1.16

EDIT!
ACK! I have a new problem now. I didn't happen as a battle event, but now it freezes. In my game I keep track of 'combos' via the enemy sp. When the combo reached a certain number a certain character would automatically attack. One skill he uses this way hits all enemies and, as you may have guess, this could cause another enemy to reach the 3rd hit in a combo so he would attack again. It worked perfectly as a battle event, but as code (very similar to the counter attack code only Game_Enemy self.sp == 3 activates it instead of a character being struck. It works fine as one execution, but if that chaining of skills occurs the battle gets caught up in a loop or something.

DOUBLE VISION EDIT TIDE NOISIV ELBUOD
Sooooorta... Got it fixed. I kept running it through an event command to get the skill chaining effect I wanted, but in order to assign id's instead of indexes, I just rewrote the interpreter within RTAB!
 

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