Escape codes in Scenes

Torqus

Veteran
Veteran
Joined
Aug 2, 2015
Messages
169
Reaction score
26
First Language
English
Primarily Uses
So, I don't see anyone asking for this.

I don't remember who did this in VX Ace, I think it was Victor and someone else had it too, a script that allowed to use the escape codes used in messages (specifically looking for Color and Icons) in the rest of the scenes, like the menu.

So if I wanted to show, in the menu status, the character class with the class "Icon" 65 before the name of the class, I would write something like:

/i[65]NameOfTheClass. Instead of going to the base code and modify lines that can break the whole game if used wrong.

Is anyone doing this? Or is it already done and I couldn't find it?
 
Last edited by a moderator:

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
The problem is this: escape codes are processed when you use the drawTextEx command, most of the game uses drawText except for a few certain things.

You just have to sift through and make those changes.

I could be wrong though.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
If it's only a replace, like \v[...], it's easy.


For more complex things (changing color, drawing icons), you would need to:


- Draw all text up to this point.


- Get the length of the text printed so far.


- Change color / draw icon


- Draw text from the offset, until the next match happens.
 

Torqus

Veteran
Veteran
Joined
Aug 2, 2015
Messages
169
Reaction score
26
First Language
English
Primarily Uses
Yep, that's why I was looking for something like this.

Rearranging things in the Scenes is really easy but when you want to draw icons or, more specifically, change color of some texts, I just can't understand how it works. Guess I'll have to become really good at that.

I wanted the actor class in the menu and status to have a specific color and icon depending on the class, maybe I can manage to draw an icon, but colors seem to be a bit harder. Tho, probably nothing a few hours of work can't solve ;D
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
It's just a matter of making the drawText function call the drawTextEx function rather than writing to the bitmap itself. The difficult comes in the fact that drawTextEx requires more parameters (I think) so you have to work out where it's going to start and end, and allow for the possibility that it will be centered or right justified.


If you can link to an Ace script that does it, that'll make it easier for someone to do it in MV.
 

Torqus

Veteran
Veteran
Joined
Aug 2, 2015
Messages
169
Reaction score
26
First Language
English
Primarily Uses
If you can link to an Ace script that does it, that'll make it easier for someone to do it in MV.
I only know Victor's script, I don't remember if there was another one. And the page to download the script from Victor is gone.

For me, I'll look at plugins that change colors and add icons in scenes and learn from that.

I guess I'll leave this thread here so maybe someone takes the request.
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
@Shaz: This won't really work, since drawTextEx can't deal with the "align" parameter.
 

Torqus

Veteran
Veteran
Joined
Aug 2, 2015
Messages
169
Reaction score
26
First Language
English
Primarily Uses
I managed to show actor class with icon and colors using this:

this.drawIcon(ICON, 500, y);this.changeTextColor(this.textColor(COLOR));this.drawText(actor.currentClass().name, 540, y, width);this.resetTextColor();Just saying.

Escape codes in scenes would still be awesome.

The problem is that methods like "changeTextColor"  aren't available in all the windows right? Because if it is, maybe something like this would work: <e_code> The Text </e_code>
 
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
@Shaz: This won't really work, since drawTextEx can't deal with the "align" parameter.
 
Yes, I know, which is why I said this:

you have to work out where it's going to start and end, and allow for the possibility that it will be centered or right justified
 

Torqus

Veteran
Veteran
Joined
Aug 2, 2015
Messages
169
Reaction score
26
First Language
English
Primarily Uses
I wrote a version of that for MV too, though it is pretty clumsy since I am still learning javascript. It is here: http://rmrk.net/index.php?topic=50445.0
Oh this is nice! Thanks for linking to it.

Tho, I already made what I wanted with some conditions and variables in the Window_Base to detect class name and actor level, so it colors and shows the icon I want.

You think using your plugin with escape codes will lag more than my method for now?
 

modern algebra

Veteran
Veteran
Joined
Sep 28, 2012
Messages
59
Reaction score
49
First Language
English
Primarily Uses
Whether my plugin is faster than your way or not would depend on which function you changed. Neither is likely to generate any lag though.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,015
Members
137,563
Latest member
MinyakaAeon
Top