Hey guys.
I've been searching through the game's scripts and can't seem to find what data to actually put into the @active_battler variable.
I thought this would be in Script requests because I need it for the Conditional Branch script option ^_^
What condition do you want to make ?
The answer of this question is probably in "Scene_Battle" . @active_battler is a Game_Battler class variable .
What I'm trying to do is create a player touch event in the GubiD TBS.
I am trying to find a way to distinguish which character has stepped on the event, then apply a state to them.
So my reasoning was, find who is the active battler, then apply the state to them through eventing.
Is there a better way to do this? Or am I even going the right way about this?
Thanks for the help :)
You should have said "GTBS" first . This is always special .
I think you can apply a state to the active battler like this :
$scene.active_battler.add_state(<state_id>)
And your event should be called "battle_event" like the tower in the GTBS demo .
Not tested ...
Hm. Comes up with an error.
"NO METHOD ERROR"
"undefined method 'active_battler' for Scene_Battle_TBS"
I checked through GTBS for 'active_battler' and 'add_state' with Ctrl F and found just "battler.add_state", this didn't work either =/
And yeh, I set the event name to battle_event and player touch :)
try to add this small script under the GTBS :
class Scene_Battle_TBS
#--------------------------------------------------------------------------
# Short hand method calls
#--------------------------------------------------------------------------
def active_battler
return @active_battler
end
end
Done that, now I get the same error but with "add_state".
I checked out the GTBS battle_scene and it only ever uses battler.add_state, not active_battler.add_state.
Is that any help?
OK , so the GTBS don't know who was the latest battler .
Let's help him with this script :
class Scene_Battle_TBS
attr_accessor :active_battler_last
#--------------------------------------------------------------------------
# Short hand method calls
#--------------------------------------------------------------------------
def active_battler
return @active_battler_last
end
alias dricc_set_active_battler set_active_battler
def set_active_battler(battler)
@active_battler_last = battler
dricc_set_active_battler(battler)
end
end
YAAAAAS :D It works perfectly. Thanks for all the help dricc :)
Ps. Can I use you in my game? :P To show my thanks?
Yes , use my charset freely . I made it for that .
I can even talk lol :
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi39.servimg.com%2Fu%2Ff39%2F11%2F59%2F23%2F52%2Fdricc11.png&hash=fdc76624b9bfc836784b5564e5441f05cc9400f7)
Good luck with the GTBS :)