I hope this hasn't been posted before, but I couldn't find it when searching.
Is there a way to change a player's description in an event?
For instance the default player description is:
"A veteran warrior who fought on many battlefields.
He becomes uncontrollable in battle when berserk."
I know it's theoretically possible with scripting but what exactly do I need to do?
Change Player Description
● ARCHIVED · READ-ONLY
-
-
Go into the Database and click on the "Actors" tab. The box with the description is right there, just delete the default description and write your own.
-
Oh, I meant inside an event within the game, like, for instance they stumble onto a crystal, and the event that triggers changes their description.
-
Cadh20000, (s)he's asking about changing it DURING the game.
OP, you will need a script to do this. You COULD change it via a script call, but when you close and reload your saved game, it'll revert back to the original description. -
Sorry, I misread the post.
-
This probably isn't what you need but if it were going to be a one time occurrence/early in the game maybe you could just make a duplicate actor with all details the same except the description...then swap party members? I imagine this would be ineffective if the character in question will already have made a lot of progress. Just tossing it out there because sometimes it is fun to try to come up with quirky event uses. I am sure a script would be much more effective though...
-
You would have to take into account any EXP they had gained and make sure the same is given to the new actor. You'd also have to make sure the new actor has the same equipment (so lots of unequipping and reequipping, because you can only equip something if it's in inventory), the same states which could have been applied and remain after battle, the same skills if any were learned via a Change Skills command rather than by levelling up, and probably more things. And then do all the same again if/when you swap them back.
A lot of mucking around, and in this case, I'd say while you MIGHT be able to do it via events, it would be much easier and less hassle to use a little script. -
That's a pretty big oversight. Also the fact that you can't edit the starting event, so you kind of have to hack things out to add initial items to the character or set variables for them.
-
There IS no "starting event". You are probably getting confused with the starting position, which is NOT an event. There's nothing stopping you from making one though.
Actually, there may be an easier way ...
The script that draws the description would be able to use variables. So you could just set your actor's description to \V[1] on the first line, and \V[2] on the second line. Then in your starting event, set variables 1 and 2 to whatever you want to show as the description (via the Script box in the Control Variables event command).
That SHOULD put whatever you have set those variables to as the description in the status screen. -
Hmm, good point about the starting event. The only thing is that brings me back to how to script the description in the first place. If I can do that, I don't need the starting event per se.
-
I just told you how.
Control Variables, choose variable, type text in Script box at bottom. Just make sure you don't try and use it for any mathematical functions, or it'll crash.
And yes, you WILL still need the starting event - at some point early in the game, before the player is able to go to the menu, you need to set the initial description. -
No that just creates an error.
uninitialized constant Game_Interpreter::Test <- "Test" being the description I used in the startup event for efficiency
This is my "start event":
Control Variables: [0001:D1] = Test -
Ah, put quotes around it:
Code:Control Variables: [0001: D1] = "Test" -
Aha now we're getting somewhere.
Unfortunately, the only way I can see to trigger the event is by player touch. Autorun just makes the game freeze.
FIXED: Parallel Processing will work.
It's still a bit limited because I can't incorporate the color escapes inside the text variable but it will do for now.
Ultimately I want to figure out how to script it. -
No. Autorun WILL freeze the game, and is MEANT to, for things you want to do before the player gets control.
Just turn on a self switch at the end of the event commands, and add a second page with that self switch selected in the page conditions (above the sprite), and leave everything else on that page as the default settings.
If you use a parallel processing event to change the description and you don't end it in the same way (with a self switch and an additional page), you'll end up going to another map where you can change the description to something else, but the moment you return to this map, it'll be changed back to the original description anyway. If you're not sure how this all works, there are probably some tutorials that go into autorun and parallel events and explain how they're different to regular events and when you should (and shouldn't) use them. In fact, I know there's a tutorial about event switches on the blog, if you want to check it out.
Just using a script to change the description will not allow you to do anything that you can't do with the variable. If you want to use the other escape sequences, you would not only need the script to allow you to change the description and record it in a save file, but you would also need to rewrite the script that DISPLAYS the description, to make it use those codes as well. -
The reason why I wanted to use parallel is because I didn't want to force the player to walk into an event box to start the event. But I see what you mean, the initial event will trigger if you go back to that map again. So you make a conditional with the self switch so that the stuff only happens if the switch is in it's initial state.
I figured out how to do it with a script. You create a function called set_description in Game_Actor and then call that from the event.
But as you said, it's basically the same thing as the variable.
When you set the description from the ordinary box that you type the description into, you can use all the switches like \C[4], etc. I suppose that calls a script that knows how to translate that into text color. So now I need to find a script equivalent of that or something.
At least there's some progress. -
the proper way to script it is to create this function in Game_Actor:
#--------------------------------------------------------------------------
# * set Description
#--------------------------------------------------------------------------
def set_description(text)
actor.description = text
end
and call it like this:
$game_actors[1].set_description("Test") if $game_actors[1]
...just in case anyone was wondering. Still need to figure out how to incorporate text colors and such. -
ineffabelle, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
No, it's not right. As I said in post #4, if you do that then save and close the game, when you reload the game it will be back to the original value.
And an autorun event will NOT make the player walk into it. You seem to only be reading bits and pieces of what I'm saying.
You don't make a conditional (which means a Conditional Branch). You make an event with TWO PAGES. The first page will have no conditions (under the Conditions section above the event sprite), and an Autorun or Parallel Process trigger, and will turn on the self switch as the last event command. The second page will have the self switch as a condition (under the Conditions section above the event sprite), and no other changes (so it will have Action Button as the trigger).
If you use this method to set your variables for your actor descriptions, they WILL save with your game.
However, if you're gung-ho on scripting it, go for it. -
Aha. The two pages thingy seems to fix the autorun stopping everything problem. Ok, got it. Just got a bit confused, but it's sorted out.
Also found a workaround for the color thing. You can do \C[\V[6]] \V[4] \C[0] in the description, where V[4] would be your variable text that needs to change and V[6] is just a numerical variable with a color number. -
Thanks so much for your help, and your patience! Just got RPGVXA yesterday :D