Hi,
please, I need a script that will check the classes of the actors in the battle party when called.
In my game there are about 50 classes and the battle party will have 3 to 5 actors.
So eventing it will be near impossible.
What the script should do:
run using script call : battleclasscheck(10..19,20..29,30..39)
it will check if the first actor's class id is in range of 10 to 19, second actor's; 20 to 29 and third actor's; 30 to 39.
if all actors' class id is in range a switch of certain id will turn on.
if even one of the actor's class is not in range, the switch will be turned off.
thank you.
EDIT 18/7/2014:
I'm using these scripts:
yanfly ace battle engine
https://www.dropbox.com/s/tjwyf0qhfe6d5cb/Ace_Battle_Engine.rb
yanfly ace party system
https://www.dropbox.com/s/8o6925ljvjk66nv/Class_System.rb
Also the script call will be used outside of battle.
Battle Party member class check.
● ARCHIVED · READ-ONLY
-
-
Anyone?
Is it too hard or there's not enough information? -
You're making it way too hard. You can do this in a common event or a regular event with just 5 conditional branches.
What happens if you don't have 5 battlers in your party? Will the switch be off? Have you changed the Game_Party.max_battle_members to be 5? If not, how do you allow 5 battlers? Are you using any battle scripts (particularly scripts that adjust who your battlers are, or how many you have)? -
Updated the first post.
Problems with using conditional branches.
1. The class selection is large.
2. The actors can have any class.
3. I do not know which actor the player will choose for battle.
4. I can not find the event that would determine a battle party member's class. -
I will GIVE you the command to tell what a battle party member's class is, if you would take the time to answer my questions.
-
@shaz: um.... I already updated my first post?
-
See, the problem with updating your first post is that I don't see it, because I'm not going to read through everything I've already read.
If yours is the last post, you edit it to avoid double posting. If someone has replied to you since, you reply, so they can see that you've got something new ;)
And you still didn't answer all the questions I asked.
However, since you're using a party system script, this is where I bow out. I'm happy to write little snippets for people when they're using pretty much RTP (or no scripts that would affect those little snippets), but I'm not familiar with most scripts by other people, and I just don't have the time to go through and learn them, so I'd probably end up giving you something that didn't work.
Depending on how the party system is set up (as far as order of battlers and whether it's still the first 4 or 5 who are battlers), it may still be able to be done with just a small Script event command or a series of 5 conditional branches. I'll let someone who's more familiar with those scripts give you the exact details. -
@shaz:
point taken.
I wonder if the one I found in the script Game_Actor line 326 can help with this. -
Line 326 of Game_Actor is a comment line. It does nothing. So you must be using a modified version of the script, and nobody would be able to tell you whether it'd work or not.
What happens if you don't have 5 battlers in your party? Will the switch be off? Or will it be on if all the members who ARE in your party ARE in the specified classes.
What happens if the player reorganizes the party and the person in the first slot has the class you've attributed to the third slot?
Why are you allocating classes against the party lineup in the first place? Why do you say the leader must be in THIS group of classes, while the next person along must be in THAT group of classes? -
You should explain what you problem you're trying to solve.
-
Question 1
What happens if you don't have 5 battlers in your party? Will the switch be off?Or will it be on if all the members who ARE in your party ARE in the specified classes.
Answer:
Example if there are 2 in the group when should be 5. The scripts compares only the 2 actor classes and skips the rest.
Question 2
What happens if the player reorganizes the party and the person in the first slot has the class you've attributed to the third slot?
Answer:
The switch will be off. Actor position is irrelevant as long as the classes are in the correct slot.
Question 3
Why are you allocating classes against the party lineup in the first place? Why do you say the leader must be in THIS group of classes, while the next person along must be in THAT group of classes?
Answer:
Rules of engagement. Gameplay. I am limiting what classes participating in battle. I don't want my players to stick to one strategy and had all actors in just one class. -
Okay. If it follows a pattern like Member 1 has classes 10-19, Member 2 has classes 20-29, Member 3 has 30-39, Member 4 has 40-49, Member 5 has 50-59, you could do something like this:
Control Switches [0001: Classes Okay] = ONScript: $game_party.battle_members.each_with_index {|actor, i| $game_switches[1] = false if !actor.class_id.between?((i+1)*10,(i+1)*10+9)}In both lines that refer to switches, substitute the switch number you really want to use.Now, if you put that in and get an error when it runs, post a screenshot of your Script call. If you're using the older version of the engine that doesn't have the enlarged script box, those commands won't all fit on a line each, and letting it automatically break will cause the breaks to be in the wrong place which will make it crash. In that case we just need to see where those automatic breaks have been made, and reformat the commands to avoid the issue. -
@Shaz:
It works. Thanks Shaz.
A question:
What should I change so that it will only check the class of a specified slot/index for example; only the class of the second member? -
$game_party.battle_members.each_with_index {|actor, i|says to check ALL battle members.
If you only wanted to check the second member, you would do this (remember, the second member would have index 1 as the leader has index 0)
Code:You could use that in the Script portion of a Control Switches command, and the switch would be either true or false based on whether that person had a class within that range.$game_party.members[1].class_id.between?(20,29) -
@Shaz:
Code:Done. Thanks, Shaz.Control Switches [0001: Classes Okay] = ONScript: $game_switches[1] = false if !$game_party.members[1].class_id.between?(20,29) -
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.