RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
What value should I enter for @active_battler ??

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 83
プログラマです
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 ^_^

**
Rep:
Level 83
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 .
You can use my scripts freely . but not for commercial use .
:ccbync:
Don't encrypt your game !!!
Want to give me credit ? Easy ,add me in your game :

**
Rep:
Level 83
プログラマです
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 :)

**
Rep:
Level 83
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 ...
You can use my scripts freely . but not for commercial use .
:ccbync:
Don't encrypt your game !!!
Want to give me credit ? Easy ,add me in your game :

**
Rep:
Level 83
プログラマです
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 :)

**
Rep:
Level 83
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
You can use my scripts freely . but not for commercial use .
:ccbync:
Don't encrypt your game !!!
Want to give me credit ? Easy ,add me in your game :

**
Rep:
Level 83
プログラマです
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?

**
Rep:
Level 83
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

   
You can use my scripts freely . but not for commercial use .
:ccbync:
Don't encrypt your game !!!
Want to give me credit ? Easy ,add me in your game :

**
Rep:
Level 83
プログラマです
YAAAAAS :D It works perfectly. Thanks for all the help dricc :)

Ps. Can I use you in my game? :P To show my thanks?

**
Rep:
Level 83
Yes , use my charset freely . I made it for that .
I can even talk lol :

Good luck with the GTBS :)
You can use my scripts freely . but not for commercial use .
:ccbync:
Don't encrypt your game !!!
Want to give me credit ? Easy ,add me in your game :