Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Conditional Branch doesn't contain "if: Class.."?

Hi! I was wondering how to do the fallowing: How can I make this (with a script)?

If you have the SMITH Class then you can do a certain thing. (ex: Forge)
If you have the BARD class then you can do that certain thing. (ex: Play music)
If you have the SCHOLAR class then you can do this certain thing. (ex.Read books)

I want to make so that if you're NOT in the smith class, then you CANT Forge. If you're NOT the bard class then you cant play music. If you're NOT a Scholar then you can't read books!

But IF you're in the right class you can do their speciality (Smith= forge, Bard=play,Scholar=read) you can do the ceratin thing.

How do I prevent NON-Smiths classes to "forge", NON-Bard classes from "playing music" etc etc.

I have tried making this with the CONDITIONAL BRANCH, but there is nothing saying "If: X.Class > ..event.."

conditionalbranch.png


is there any script or codepart that says "if [actor] is in X.Class > ex: "call Swoitch003" "?
Any script that says "if [actor] is in X.Class > [something happens]" ?

//Tell me if this isn't understandable!

~fixed by Dath
 
Well there is one thing that you can do. Provided that it is just one character that changes class.
Let me explain:
1. You set up an event at the start of the game or when ever your character gets the first class that has an ability, the event turns on a switch that lets them use the ability.
2. You set up the event that needs an ability but have a conditional branch that says: If switch X is on: Ability X can be used (here the ability effects are used) Else: X ability cannot be used.
3. When the character changes class a switch turns off the switch of the first class and turns on a switch for the second (i.e if you character was a scholar then the scholar switch would be on and you changed to a smith then scholar switch would turn off and the smith switch would turn on.)
4. If you understand what you have to do skip this step else post that you don't understand and I will clear it up for you.
5. You credit me for helping you overcome this problem.

Follow those steps and you should be fine.
 
All right, here you go. First, the script example, then the explanation.

[rgss]$game_party.actors[0].class_id == 1
[/rgss]

All right. This goes in the Script function on the last page of the Conditional Branch menu. The first number I used, 0, makes it look at actor 1 (Aluxes by default). The second number, 1, makes it look at class 1. (The default is Fighter) This will return true if the actor specified has the class specified. That means that it returns true when Aluxes is a Fighter, but not when Aluxes is a Lancer. The first number in this should be the number of the character in the party, minus one. (So, the first character in the party would be checked by using a 0) The second number should be the number of the class, as you see it in the database.

Edit: For something as simple as this, I neither want nor need credit. Unlike Darth J up there.
 
Darth J":a8ir4s9w said:
Well there is one thing that you can do. Provided that it is just one character that changes class.
Let me explain:
1. You set up an event at the start of the game or when ever your character gets the first class that has an ability, the event turns on a switch that lets them use the ability.
2. You set up the event that needs an ability but have a conditional branch that says: If switch X is on: Ability X can be used (here the ability effects are used) Else: X ability cannot be used.
3. When the character changes class a switch turns off the switch of the first class and turns on a switch for the second (i.e if you character was a scholar then the scholar switch would be on and you changed to a smith then scholar switch would turn off and the smith switch would turn on.)
4. If you understand what you have to do skip this step else post that you don't understand and I will clear it up for you.
5. You credit me for helping you overcome this problem.

Follow those steps and you should be fine.

Thank You very much, this is pretty simple^^ but why do I need to credit you? -_-
 
Umm, I hope you realize that you can teach skills to certain classes and have them automatically added at level 1...

just go to the classes tab of your database, and make it so that the Smith class learns the "Smith Ability"(or whatever skill you make), at lvl 1, then go to your event and check if that actor has the skill you made.

And Darth J: You're a little demanding, don't you think? It's a simple solution, and you gave the most complex solution possible, and then expect to be credited? To be recognized as a good eventer, you need to be able to use common sense to make a simple solution to your problems.
 
Ulqiorra":16g47zjg said:
Umm, I hope you realize that you can teach skills to certain classes and have them automatically added at level 1...

just go to the classes tab of your database, and make it so that the Smith class learns the "Smith Ability"(or whatever skill you make), at lvl 1, then go to your event and check if that actor has the skill you made.

And Darth J: You're a little demanding, don't you think? It's a simple solution, and you gave the most complex solution possible, and then expect to be credited? To be recognized as a good eventer, you need to be able to use common sense to make a simple solution to your problems.

I AM going to use switch as Dath J said..
But, yeah, Im not gonna credit Dath J for that simple thing. Anyway I could have made it myself. I was reminded by Dath J, I didn't learn anything new. And thanks again.
 
That sounded a little rude, like you didn't appreciate the time someone took out of their day and their time on this forum, to help you. Even if you already knew it, it was just rude to say that.

To think I was gonna help. :crazy:
 
MagitekElite":2smpvao0 said:
That sounded a little rude, like you didn't appreciate the time someone took out of their day and their time on this forum, to help you. Even if you already knew it, it was just rude to say that.

To think I was gonna help. :crazy:

It may have been rude, and Darth J may have been entirely within his rights to ask for credits for the solution, but asking for credit for something like that is just silly. Not to mention the fact that the solution offered was very limited in scope. I was honestly surprised to see that Darth J actually expected credit for such a mundane, limited solution to a problem, and one that could have easily been solved by the majority of RMXP users on these forums, almost none of whom would have required credit for their solution.
 
Sheesh. All the time I have spent here and people don't realize when I am being serious or not. Maybe I should tag all my serious stuff with [serious]text here[/serious] so people would know if I was kidding or not.
 
Darth J":da6nxi7o said:
Sheesh. All the time I have spent here and people don't realize when I am being serious or not. Maybe I should tag all my serious stuff with [serious]text here[/serious] so people would know if I was kidding or not.

Ok so that's not what this topic is about, to discuss "if I will credit you or not". You will have to accept that I needed help and now I got it. I decide whats next, If I want to credit or not. That It.
 
Ok this topic has went off long enough. I keep clicking coming to see if there is something I can help with and the solution was 20 post ago and now were talking about credit and such.

Please refrain from posting unless it involves discussion or concerns about the original topic at hand or I will crush you. :heart:
 
SephirothSpawn":1nb7d0js said:
Ok this topic has went off long enough. I keep clicking coming to see if there is something I can help with and the solution was 20 post ago and now were talking about credit and such.

Please refrain from posting unless it involves discussion or concerns about the original topic at hand or I will crush you. :heart:

Ofcourse! //Thank You
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top