RPG Maker VX Ace

RPG Maker VX Ace

İstatistiklere Bak:
Change character description in-game
Hey up, folks!

Here's the rundown - I'm making an RPG that involves a knight who has lost her will to fight, and it says so in her character description. There's an optional quest in which her spirit is rekindled, so of course the description of her losing her desire will no longer apply. Does anybody know of a way to change the description after an event in the game? Please keep in mind that as far as scripting goes, I am below newbie status ^^;

Cheers in advance!
< >
21 yorumdan 1 ile 15 arası gösteriliyor
Switch the character out for a different one
İlk olarak kittylitterproduction tarafından gönderildi:
Switch the character out for a different one
If you did that, would you be able to keep the stats of the original or could you transfer them over somehow?
It would require reading out the relevant stats into variables and then writing them back into the switched-out character. A bit of work but how often do you want to do that?
I found an actor.description in the Game_actor section of the Script Editor, about line 499. I don't know where or how it might be defined, but if someone could track down the data, they could probably figure out a way to allow you to change to a set variable or other object with the text for your new description. But then again, I know nothing about scripting.... so maybe not.
That pulls from the database. You could set that like any other variable holding a string, but iirc it doesn't stick once you leave the game. I'm sure it would be possible to write it to the file, but then it would remain even on a new game. Other option would be to have a common event change it as necessary on loading the save, but if you're going to pre set it up like that then it would be simpler to just do as Kitty suggested.
Yeah, I'm starting to think just switching characters would be a simple option. I have something similar going on with classes, so it should be somewhat familiar. Thanks for all of your input, everyone! :)
Curses - there's a snag in the plan. If I change the character for a different one, then I won't be able to have her retain the name you give her when you meet her. It's fine if you leave her name as the default one, but if you personalise her - not so much :(

EDIT: I know how to store an actor's name in a variable, butu I know not of a way to change an actor's name to the value stored in said variable.
En son DarkStorm2Bad tarafından düzenlendi; 15 Eyl 2017 @ 14:33
Did you know that every command in the events is also a script? Actually each command is just an interface for those scripts (You've been scripting and didn't even know it!).

With that knowledge we can go into the script editor and search for the name of the command. In this case it is "Change Name"
I have the code below for you, but it's all in the Game_Interpreter script.
def command_320 actor = $game_actors[@params[0]] actor.name = @params[1] if actor end

What we have here is the script is setting the variable "actor" to $game_actors[Parameter] and setting that variable's name function to Parameter 2 if they are an actor. Basically $game_actors is a variable list called an array that contains all of the data for every actor in the game. $game_actors[1] will access the first actor's information for example. This means that $game_actors[1].name would in a default project return "Eric" (or whatever it is in each language). So if want to simplifiy this we can just merge the two lines together.
Lets say we want to change Eric's name to Dan. It would look like this
$game_actors[1].name = "Dan"
Strings are put in quotations so that's what we have done here. From that point on in the game Actor 1 would be called Dan. Unlike with the descriptions I know the name does save with the save file so no need to worry about that here.

Now since you said you can put the name in a variable so that the palyer can name the character whatever they choose you'd want to use something like:
$game_actors[1].name = $game_variables[X].to_s
That ".to_s" part just insures that what is read from the variable is interpreted as a string.

As to where to put this you can place it within a script call command on Page 3 of the events.
This can be done easier without learning Scripting. (While the above other explanations maybe provide more indepth learning knowledge for later on).

1. Open Database -- Choose Tab "Actors" --- Choose a Actor
2 Insert the following as Char discription: \V[1]
3. We are finished.

Whatever text you safe in Game Variable 1 will be shown as Actor discription for that Actor.
This trick doesnt work with all Database states, but with some off them.

Edit: Pseudocode: Control Variables -- Variable 1 = "Your Text with "" around it" if i remember correct.
En son Hajami tarafından düzenlendi; 16 Eyl 2017 @ 12:58
İlk olarak Hajami tarafından gönderildi:
This can be done easier without learning Scripting.
---SNIP---
Edit: Pseudocode: Control Variables -- Variable 1 = "Your Text with "" around it" if i remember correct.
Says you don't need scripting, but still shows a solution that requires the script portion of the change variable command. :3


Honestly though I'm shook right now. In all the time that I have been using this software I never knew that the text codes ("\V[#]" for example) actually worked in the description boxes. :rshocked:
You got me there Kurashi :).
They Work for Item Descritpion and Actor Description. If i recall right also for some others, but some interesting ones dont work sadly.

Sadly it doesnt work in the Name Box. But working in the description is allready very usefull.
En son Hajami tarafından düzenlendi; 16 Eyl 2017 @ 16:12
I saw a script here: https://forums.rpgmakerweb.com/index.php?threads/change-player-description.28444/ that addresses this very problem. I actually created a plug in script from the script that was originally created by the OP. Insert this script in the materials section and label it "Actor Description Change" or whatever:

#--------------------------------------------------------------------------
# Actor Description Change Script
# Original Script by Ineffabelle
# Converted to Plug-and-Play Script by Cougarmint
# Original Topic:
# https://forums.rpgmakerweb.com/index.php?threads/change-player-description.28444/
#--------------------------------------------------------------------------
class Game_Actor
def set_description(text)
actor.description = text
end
end

The original script contained all the instructions in the header, but I pulled them out and posted them here to make them easier for you:

Installation: To install this script, insert it below materials, above main.
There is no need to modify the "Game_Actor" class like in the original version.

~~~Usage~~~
1. Create a Common Event for your actor, called "X's Description Change" or whatever makes it easier for you to remember. Set it as a "Parallel Process" event and tie it to a switch of your choosing, preferably one that will only be actor or post-event specific.

2. Use the "Script" command in the Event Editor and set the following command: $game_actors[X].set_description("Insert new description here.")

3. Click "Apply" or "OK" to save your Common Event.

4. In the map event that results in your character's description being changed, turn the corresponding switch on to activate the Common Event.

5. To revert the description, turn the switch off and repeat step 2 in your map event. Copy and paste the original description from the database into the script command. This will eliminate the need to exit and reload the game, and there is no need to make another common event.

~~~Notes~~~
X is the actor's id number. In example, if you want to change the description of Actor 2, you would replace X with 2.

When using this script, the Carriage Return (pressing enter) will set a new line due to the nature of the call function. \n (line break) is not needed.

The character limit for the description is the same. Keep that in mind when choosing a new description for your actor.

You can reuse the Common Event as needed, and change the description usingthe "Conditional Branch" function in the event (such as if there is another actor in the party, or if there is a certain weapon equipped.) You can even forgo the Common Event and change the description based on Map Events; just be sure to set the event to be triggered via "Paralell Process." Don't be afraid to use your imagination to create dynamic descriptions for different situations!

~~~TO DO~~~
Figure out a way to make this permanent without having to use a common event or switch.

Hope this helps!
En son Cougarmint tarafından düzenlendi; 18 Eyl 2017 @ 20:20
This looks like ok script, but the event code constellation is dirty and could cause troubles.

If he keeps his paralell common event activated, the descritpion will be changed up to 30 to 60 times per seccond. that can suck down some of his game performance, depending on how demanding that scriptcommand is.

In my opinion it would be best to deactivate that event after it changed the descritption.
Or give it no trigger at all, and use the call common event eventcommand to call it only when needed.

Edit: Why not delete the whole common event and only use the scriptline in the event that changes this description? ,
I mean this line alone: $game_actors[X].set_description("Insert new description here.") used as eventcommand + insert the above linked big scritp for this in script Database like explained.

Edit2: OP now get 2 Solutions, 2 are always better than one, sometimes it allows to create a 3rd Solution. I would use the first one because its allready in the rpgmaker Editor.
En son Hajami tarafından düzenlendi; 19 Eyl 2017 @ 0:05
If you do that, when you save the game and come back to it later, it will revert back to the original description, as noted in the topic link I posted. In order for the new description to stick, it has to be made into a parellel process, as mentioned by the dev/moderator in that topic.
En son Cougarmint tarafından düzenlendi; 19 Eyl 2017 @ 0:34
Okay good to know.
< >
21 yorumdan 1 ile 15 arası gösteriliyor
Sayfa başına: 1530 50