[RMVXACE]HOW DO I MAKE AN ITEM THAT IS USED BY A PLAYER/CHARACTER DO A RANDOM CLASS CHANGE?
Posts
I'm working on a game and I have made a "Crystal Cube " that is sapose to change a player/Character that uses it class to a random class from a list of abvalable classes, so far the cube only changes that player/character's class to the last class in the list.
So can any one help me?
Thanks in advance for your help.
So can any one help me?
Thanks in advance for your help.
I'd have to do a bit of research on how to do it, but, I bet there's a way to create a script that "rolls" a random number linked to the number of classes there are in the database, and then set a character's class to the value "rolled".
*Edit:
That wasn't too bad.
*Edit:
def change_class(actor) min = 1 max = $data_classes.size val = rand(max - min) + min $game_actors[actor].change_class(val) end
That wasn't too bad.
Thanks Marrend but how do I use this, just copy it into the script database and how do I add the classes to the random roll?
Kory how do I set up what you posted to be used at anytime when a player Main Character or secondary charater interacts with the crystal cube?
Kory how do I set up what you posted to be used at anytime when a player Main Character or secondary charater interacts with the crystal cube?
Oh and while I'm here would either of you know how to change the character's spite and face set that is set to the class(es) in question?
You would copy that into the script editor, below the "Materials" label. To use it, you would use the "Script" event command, and type "change_class(actor)", where you would replace "actor" with the ID of the character that is changing class. So, for example, if the character in database-slot-1 wants to change class, you would use "change_class(1)". You shouldn't have to "add" classes to this "roll". The "min", "max", and "val" values ensure that the change_class function gets the useable parts of the class array.
Usually, the command to use to change graphics is "Change Character Graphics". Offhand, I'm not quite sure if there is a quick-and-easy way to assign graphics based on class, outside of a Conditional Branch that is based on the class the character would have as a result of the class-change.
Usually, the command to use to change graphics is "Change Character Graphics". Offhand, I'm not quite sure if there is a quick-and-easy way to assign graphics based on class, outside of a Conditional Branch that is based on the class the character would have as a result of the class-change.
I see thanks for the info Marrend, sound if I have a party of 4 charracters and I have the 3rd character use the cube I would set up the even with change_class(3) as well as setting up Change_Class(1 and 2) if the first and second and forth character in the party if the payer wants one of the other party members to use the cube? as well, but wount that change the class of the three characters even though they are not using the cube?
Uh, what? There seems to be a miscommunication, here. To change the class of multiple characters with that script, the lines would be...
...that, or something like it. Also, this changes the class of the person in character slot X (or what-have-you), as they appear in the database. This does not change class according to party position! I... might not have been entirely aware that this item was effective on more than one character. So, for this script to function the way I think you want it to, you would need the ID of the character using it to pass into that script. Which would take a bit more doing, and looking-up on my part, to see how that could be done.
change_class(1) change_class(2) #etc...
...that, or something like it. Also, this changes the class of the person in character slot X (or what-have-you), as they appear in the database. This does not change class according to party position! I... might not have been entirely aware that this item was effective on more than one character. So, for this script to function the way I think you want it to, you would need the ID of the character using it to pass into that script. Which would take a bit more doing, and looking-up on my part, to see how that could be done.
Oh ok Marrend I was talking about changing the class of the character using the Cube at a random time regaurdless of their postiontin in the party, meaning to say that the player finds a cube and uses it for the character in slot 1 without changing the other characters then a little later on another cube is found and the player decied to have that chracter in the 4th slot use it without changing the other characters
Sorry if I was not clear enough.
Sorry if I was not clear enough.
When you interact with the object it can ask you which actor you want to change.
(This should provide a list of 4 possibilities, which each has their own branch. Though you can change the maximum amount of choices through scripting if you need to.)
Then you activate random variable.
Now activate a common event. You can make it so that each actor has a unique common event. So in your list if you chose Richard it would activate common event 1, Sally would activate common event 2, etc....
Then you need a list of conditional branches.
If variable A is = 1 then change Actor 1 to Class 1.
If variable A is = 2 then change Actor 1 to Class 2.
I've got some jank for you. What you do is create a common event. The only contents it has is entering...
...that into the Script event command. Then, in your scripts, below the "Materials" section, you have...
...that. Then, in the "Contents" section of the cube-item-thingy, you go to the "Other" tab, and find the "Common Event" option. Find the the aforementioned Common Event, and you should be good to go. Of course, test it out for yourself, and see if this is the effect you're looking for!
*Edit: If screenshots would help in understanding what's going on, let me know.
num = get_user change_class(num)
...that into the Script event command. Then, in your scripts, below the "Materials" section, you have...
def change_class(actor) min = 1 max = $data_classes.size val = rand(max - min) + min $game_actors[actor].change_class(val) end def get_user user = $game_party.target_actor return user.id end
...that. Then, in the "Contents" section of the cube-item-thingy, you go to the "Other" tab, and find the "Common Event" option. Find the the aforementioned Common Event, and you should be good to go. Of course, test it out for yourself, and see if this is the effect you're looking for!
*Edit: If screenshots would help in understanding what's going on, let me know.
Thanks Kory that will help as well as the help from Marrend
Marrend so basicly all I have to do is copy and paste the last bit of script you posted into my script list ok that I understand, maybe a screen shot will be helpful since I'm a complete newbie at this and thank you for your help.
Marrend so basicly all I have to do is copy and paste the last bit of script you posted into my script list ok that I understand, maybe a screen shot will be helpful since I'm a complete newbie at this and thank you for your help.
Yeah, I guess it might be a tad confusing. First up...

...is what the item would look like in the database. Next...

...is the common event that is called by the item. Lastly...

...the scripts I used to make this work.
Note1: You're free to ignore the "Game_Actor (mod)" thing in the last screenshot. That was for a different request.
Note2: With these screens, I'm using the default database. As such, your Class Cube (or whatever) and "Change Class!" Common Event might be in different locations in the database.

...is what the item would look like in the database. Next...

...is the common event that is called by the item. Lastly...

...the scripts I used to make this work.
Note1: You're free to ignore the "Game_Actor (mod)" thing in the last screenshot. That was for a different request.
Note2: With these screens, I'm using the default database. As such, your Class Cube (or whatever) and "Change Class!" Common Event might be in different locations in the database.
Thanks Marrend this will come in handy, now to test it out and see how badly I screw up LOL
Ok I did what you said however when it came to creating the cooment event I was unable to add the gray text in the second screen shot to the common even, I added the second batch of script you posted in this thread, I did that first before creating the common event would that cause a problem?
I'm using VX Ace and it has an advanced script fuction that I used to paste your script into the class change common event.



And still it will not do the class change.
Ok I did what you said however when it came to creating the cooment event I was unable to add the gray text in the second screen shot to the common even, I added the second batch of script you posted in this thread, I did that first before creating the common event would that cause a problem?
I'm using VX Ace and it has an advanced script fuction that I used to paste your script into the class change common event.



And still it will not do the class change.
Poking in~
@Kargan> The gray text is added via the Script(s) event command (it's in the last page, I think).
@Marrend> Couldn't you have just combined the two functions into one? Something like:
Not that it would make much of a difference, but still...
@Kargan> The gray text is added via the Script(s) event command (it's in the last page, I think).
@Marrend> Couldn't you have just combined the two functions into one? Something like:
def change_class actor = $game_party.target_actor min = 1 max = $data_classes.size val = rand(max - min) + min $game_actors[actor].change_class(val) end
Not that it would make much of a difference, but still...
I just realized that with my current method that there was a possibility of it landing on the same class the user already has, but this could be changed as well with conditional branches.
I'm not sure if Marrend's script will have this issue or not.
Kory don't worry about the way you did the class change with it landing on the same class I want that in the game so that if the cube does land on the same class it will dissapper(which I have to work into the cube in the item list), basicly the cube is men to a random chance item with the possability of no change taking place.
Thank you for your input Karins like I said I'm a noob at this so any and all input is welcomed, I'll try using your script if you don't mind.

















