Looking for an easier way to do this (maybe a "class" condition for events)

Status
Not open for further replies.

fallenlorelei

Veteran
Veteran
Joined
Jul 8, 2013
Messages
298
Reaction score
346
First Language
English
Primarily Uses
SOLVED. You can close this thread =]

Solution:

Thank you so much. I ended up using the program's Conditional Branching by itself without extra scripts, using variables instead of switches. In case anyone wants to use the same system I use, this is what I did:

- Each item that gives the character a class adds a variable. For example: Main character chooses Priestess.

- 2nd party member chooses Paladin.

- When exiting the room, a message comes up: "Are you sure? Y/N." If 'Yes,' conditional branching comes up: "If Member 12 (Alice) is Class X (Priestess), then X +1 (and Shield +1)" "If Member 11 (Mark) is Class X (Paladin), then X +1 (and Shield +1)"



(The only classes who get Shield +1 are Priests, Paladins, and Soldiers)

- Now we have: Priestess 1, Paladin 1, and Shield 2.

- Go down to where the equipment item events are. You can spend 1 point for a Priestess item, of which there is only 1 (a hammer), 1 point for a Paladin item (a spear), and 2 points on Shields (1 point per, so 2 Shields). Only items with X +1 will be viewable.

- When gathered, minus a variable for that specific item, and the item will disappear from view, allowing for no more looting.



I think I'm a bit more excited about this than I should be XD

Original Problem

Mmmk. I've googled around and can't seem to find an answer, although I'm sure one exists somewhere.... I'm pretty new to RPG Maker and this game I'm making is mostly just a "sample" game where I can figure everything out.

In this game, I have a system where the main character starts out as a class called "None." By going through the beginning story, the character eventually interacts with an object and is able to change their class to one of the default classes RPG Maker automatically gives you. The character *also* picks up a 2nd party member and chooses a class for that guy as well. Every time they pick a class, a switch for their class turns on. For example, I pick the Soldier class, and the Soldier switch turns on.

Later, they're told to pick up equipment for their class. I have counterspace with 8 events. Each event has a condition for the switches mentioned above. If you have the Soldier switch, then you can see a Shield, and interact with it. When you interact with it, you're given a shield. I added a Variable to this, and when Shield = 1, the event graphic disappears (as if you literally picked it up). Therefore you only see the items that you and your party member can use based on the switch they turned on when they chose their class.

But there's some issues. This system is easily exploited...

First of all, a player could change their class to ALL the classes (one at a time) when they interact with the objects, which I allow them to do. When he/she leaves the room, party member says: You sure you want this class? You can still change it before its too late. Yes: saved, items no longer interactable. No: auto-move back into the room to change.

Unfortunately, that gives them the ability to switch ON everything.

And when they go to the Equipment counter, they can loot all the things, which gives them a huge Gold advantage...

Secondly, if a player wants - for example - both party members to be Soldiers, they should have the ability to loot a Shield twice. I fixed this by having a Variable Condition = 2 before disappearing, but if a person *doesn't* need two shields... I'd rather they not be able to loot two shields...

Right now, my work-around for the 2nd problem is allowing Variable = 2 before the graphic disappears, and adding a message that says "We can just sell the extras~"

What I need is some sort of system to avoid that 1st issue. I'd love some sort of "Class" condition to the event. That way, "If Class = Soldier," then a shield shows up, instead of "Switch = Soldier." But I can't find anything like that.

It is dilemma...

Here's some screenies to add some sort of depth to my crazy rant:

Interact with Shield -> Get "Soldier" class -> Soldier Switch = ON



If Soldier Switch = ON, then you can see a Shield graphic to interact with:



 
Last edited by a moderator:

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
in a conditional branch, you can use the script option and do something like this:

i = 0; $game_party.members.each {|actor| actor.class_id == 1 ? i += 1 : nil }; i > 0This will check if your actors are in the first class. You can change it to any other class id. The id's are the numbers next to the class, not the class' name. This won't tell you how many actors are the class, only if you have one or more.

Additionally, to make sure players don't abuse the system, when you change your class, try removing one of every item from the player's inventory except for the one that the other actor uses (conditional branches!).
 

fallenlorelei

Veteran
Veteran
Joined
Jul 8, 2013
Messages
298
Reaction score
346
First Language
English
Primarily Uses
in a conditional branch, you can use the script option and do something like this:

i = 0; $game_party.members.each {|actor| actor.class_id == 1 ? i += 1 : nil }; i > 0This will check if your actors are in the first class. You can change it to any other class id. The id's are the numbers next to the class, not the class' name. This won't tell you how many actors are the class, only if you have one or more.

Additionally, to make sure players don't abuse the system, when you change your class, try removing one of every item from the player's inventory except for the one that the other actor uses (conditional branches!).
Thanks for responding! I was afraid everyone would be put off by my block of text...

Do I change both "1"s in there to the class ID, or just the first 1? I'm derpy when it comes to RPG Maker commands at the moment.

To the second point, unfortunately the item that gives you your class & the item that gives you the actual equipment are different events in different maps. The problem I have with people getting lots of items is simply because Switch = ON and if all the switches were on, then... all the items would be available.

But your little script you gave should help with that! I'll give it a try.
 

fallenlorelei

Veteran
Veteran
Joined
Jul 8, 2013
Messages
298
Reaction score
346
First Language
English
Primarily Uses
Playing with your script, I just discovered Conditional Branches.

I might be able to use the program to add switches...

So instead of adding switches to the class-changing item... I'll add variables to the final event...

Amg excited. *plays with*
 
Last edited by a moderator:

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
you should only change the part where it says "actor.class_id == 1", because that's where the class is checked.

To make sure the equipment is not abused, have the option to change their class, and when they go to change their class do the following:

  1. make a conditional branch with '$game_party.members[0].class_id == 1' as the condition(change the 1 as needed. Also, 0 is the first party member (the leader), and 1 is the second party member).
  2. go to Change Armor... select the item that the class (first class in the example's case) will receive from the list, select the decrease option, set to do one, and check the include equipment button. This will make sure that it will be removed even if they equip it.
  3. Change Weapons and Items if needed.
  4. Change their class as normal.

That should fix you up.
 

fallenlorelei

Veteran
Veteran
Joined
Jul 8, 2013
Messages
298
Reaction score
346
First Language
English
Primarily Uses
Thank you so much. I ended up using the program's Conditional Branching by itself without extra scripts, using variables instead of switches. In case anyone wants to use the same system I use, this is what I did:

- Each item that gives the character a class adds a variable. For example: Main character chooses Priestess.

- 2nd party member chooses Paladin.

- When exiting the room, a message comes up: "Are you sure? Y/N." If 'Yes,' conditional branching comes up: "If Member 12 (Alice) is Class X (Priestess), then X +1 (and Shield +1)" "If Member 11 (Mark) is Class X (Paladin), then X +1 (and Shield +1)"



(The only classes who get Shield +1 are Priests, Paladins, and Soldiers)

- Now we have: Priestess 1, Paladin 1, and Shield 2.

- Go down to where the equipment item events are. You can spend 1 point for a Priestess item, of which there is only 1 (a hammer), 1 point for a Paladin item (a spear), and 2 points on Shields (1 point per, so 2 Shields). Only items with X +1 will be viewable.

- When gathered, minus a variable for that specific item, and the item will disappear from view, allowing for no more looting.



I think I'm a bit more excited about this than I should be XD
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
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.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,864
Messages
1,017,056
Members
137,573
Latest member
nikisknight
Top