[RMXP] I have a question about the battle system

Hi everybody,

I have a question about the combat system, I would like to know if it is possible to recognize the class of the hero who is choosing his action at the beginning of the fight. By a variable or other. I would like to block a menu according to the class of the hero.


If not, is it possible to have a variable for the hero selector who making the action selection?

In short, I want to find a solution to differentiate my heroes during the choices at the beginning of the battle, but ideally with the class that would facilitate my work.

Thank you.
This is the wrong forum for this, as this is for scripts you have made and wish to share. We'll need to move it to the right forum, but for which maker are you asking about?
Oh sorry, i read too quickly... i work with RMXP.

I've moved this thread to RGSSx Script Requests. Thank you.



I don't think it can be done without a script, but if it can someone will post it here for you as well.
The short answer is: yes, it can be done. It will likely require a full script though. What exactly are you trying to accomplish? Can you explain in more detail and include examples?
Moved to: RGSSx Script Requests

I don't think it can be done without a script, but if it can someone will post it here for you as well.

Yes, sorry, i will pay more attention.

The short answer is: yes, it can be done. It will likely require a full script though. What exactly are you trying to accomplish? Can you explain in more detail and include examples?

In my battle system, i add a new action option refer to a object. I have a object for each class (4 in total) and each object have energy who refer to a variable.

In this section, i have 3 other option, the first heal the hero, the second revive and the last add statut. The second and last choice need to be full of energy to be available.

My problem, I need to recognize the hero to choose the right variable of the object and block the options.

I hope my explication are clear, i'm not confortable with my english.
Ok, I still don't understand, but I'll try to help anyway.

First, open the Script Editor and add these three lines to a new script.

Code:
class Scene_Battle
  attr_reader :active_battler
end

Now that you've done that, you can get the current battler and their class while in a battle using this code:

Code:
active_battler = $scene.active_battler
class_id = active_battler.class_id

These code calls can be done from your own script or from an event with a 'script' command.
Sorry for the late responce,

This is exactly what i need, my problem is solved.

Thanks a lot !

Original thread: https://forums.rpgmakerweb.com/threads/rmxp-i-have-a-question-about-the-battle-system.84901/