Help getting a variable to display text instead of numbers

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
In my last game I used Todd's difficulty selection script.  For my new project I am, for various reasons, changing to Bloodmorphed's script, which can be found here.  I would like to repeat a mod made to the old script in the new one.  I set out below what happened previously in case that helps identify how to repeat it.

EDIT

Link to Todd's script http://forums.rpgmakerweb.com/index.php?/topic/2789-difficulty-selection

I want to display on the save screen which difficulty selection the player had made (using yanfly's Save engine) and that requires a variable to display text instead of numbers i.e. Easy, Normal etc.

In Todd's script this was done via a very simple mod  which changed this (and also for the other 2 difficulty modes)

# * [easy] Command #-------------------------------------------------------------------------- def command_easy $game_system.todd_difficulty = 0 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end #-------------------------------------------------------------------------- # * [normal] Command #-------------------------------------------------------------------------- def command_normal $game_system.todd_difficulty = 1 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene endto this

# * [easy] Command #-------------------------------------------------------------------------- def command_easy $game_system.todd_difficulty = 0 $game_variables[TODDDIFFICULTY::VARIABLE_TEXT] = TODDDIFFICULTY::EASYT Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end #-------------------------------------------------------------------------- # * [normal] Command #-------------------------------------------------------------------------- def command_normal $game_system.todd_difficulty = 1 $game_variables[TODDDIFFICULTY::VARIABLE_TEXT] = TODDDIFFICULTY::NORMALT Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene endAs you can see, it simply inserts an extra line with the appropriate text into each section.  A line setting which variable is used is inserted near the beginning of the script in the editable section.

It may be that all the above is irrelevant to Bloodmorphed's script.  I have given it "just in case".

Long story short

Does anyone know how to get a variable to display in text which difficulty mode has been selected?

Thanks.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
If you saved a tezxt in $game_variables then you can use the escape code \V[iid] to show that in message boxes
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
But I don't want this in message boxes.  I need it to be stored as a variable so that Yanfly's Save Engine can pull it out and put it on the save screen.

I also don't understand what you mean by saving a tezxt in $game_variables.  What's tezxt? And how does that apply here?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
It's a typo, it should be text... XD

You can use that same method im that script to save it in a variable... Showing it on the save screen is a different matter. Since ur using Yanfly's system which edits the save screen layout, you need to edit that one.. So a link to yanflys script is what's needed here
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You did not show the full text. There are constants used there that I assume have the values "Easy", "Medium", "Difficult", etc.


And the code you've provided only sets the variable (to text). That doesn't show where or how it's displayed.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Adiktuzmiko

I do not need to edit Yanfly's script.  By default it takes designated variables and displays their values in the save screen.  If the value is text, it displays text.

@Shaz

I've put a link to Todd's script in the OP so that you can see where those sections come from.  

the text is displayed in the save screen.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Then whats your problem? Yanflys script shows a variable, and that script you have above saves text into a variable

Ahh you changed from Todd's to Blood's... Anyway just do what you did to Todds in Blood's script
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I cannot just do to Bloodmorphed's script what was done for Todd's because Bloodmorphed's is quite different.  it does not have an identical layout and coding, therefore i have no idea where any alternation should go, nor do I know the exact coding to put in.
 

The Infamous Bon Bon

Executive Geek
Veteran
Joined
Mar 13, 2012
Messages
846
Reaction score
411
First Language
English
Primarily Uses
In the event used to set up the difficulty initially for the script you could use this in a script call for each:

$game_variables[n] = "Insert string here!"

where n is the variable you set up in Yanfly's Save Engine and the text is the appropriate difficulty word.
 
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
So simple, yet so effective.

I thought I had to do something extra to make a variable display text, and now I discover it will just do it.  That is so useful to know for other things

Thank you very much.
 

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,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top