Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 18 posts ] 
    Brewmeister
  Thu Mar 10, 2011 7:30 pm
Paste above Main
User avatar


lv 99 Balance Wizard

Location: 42.655713 N 82.619282 W
Control Characters Everywhere - Version: 1.0
By: Brewmeister

Introduction

Extends the use of Control Characters (\v[n], \N[n], \C[n]) to descriptions, names, pretty much anything in the database...
Developed for RMXP, but should work in RMVX as well.

Screenshots

Database

In Game


Demo

N/A

Script

Expand to see the code.


Instructions

Paste Above Main

FAQ

Can I add colors?

Sure, to add "Bright Red" for example... after line 70 insert:

when 8
return Color.new(255, 0, 0, 255)


Can I have more than one color in a name or description?

No. Not with this script. This script sets the color before drawing the string.
Unlike the message script, that draws the characters one at a time.

Compatibility

Incompatible with Ccoa's UMS. (\name[#] won't convert the control characters correctly.)

Extends the Bitmap.draw_text method & supports both draw_text(x, y, width, height, str[, align]) and draw_text(rect, str[, align]) formats

Author's Notes

In response to several requests to display item names in different colors.

Terms and Conditions

Please link to this thread instead of posting the script elsewhere. (even though I've posted it elsewhere) :scruff:
Feel free use for any legal purpose you can think of. Feel free to edit, modify, bend, spindle mutilate.
If you make edits or additions, please post them here so I can either include them, or link to them as enhancements.

_________________
"Of course that's just my opinion. I could be wrong!"


Image


Top Top
Profile      
 

    Jason
  Thu Mar 10, 2011 7:52 pm
User avatar
Awesome Bro

Generic Townsperson
Hey so this is actually a pretty cool feature that I'm suprised was never added to the editor in the first place, lol.

_________________
This is a block of text that can be added to posts you make. There is a 9999 character limit.


Top Top
Profile      
 

    Amy
  Thu Mar 10, 2011 7:57 pm
User avatar
Staff

Big Dumb Guy
Oh hey never thought of doing that, that's ace.


Top Top
Profile      
 

    Dargor
  Fri Mar 11, 2011 9:52 pm
User avatar
Retired Staff

Party Mascot

Location: Quebec / Canada
Very nice script.

I did the exact same thing for VX a few years ago but I don't know why, I have never released it. And that's awesome, we did it the exact same way.

Major kudos Brew!

_________________
Final Fantasy VI SDK
Image

Stay in touch, ask me anything, receive updates and try out the lastest versions!

Image Image Image Image Image

Tutorials


Top Top
Profile      
 

    Brewmeister
  Fri Mar 11, 2011 11:43 pm
Paste above Main
User avatar


lv 99 Balance Wizard

Location: 42.655713 N 82.619282 W
Thanks Darg.

yeh, I expect there are a finite # of ways of doing it, and adding the code from Window_Message to draw_text seemed the most logical.

I saw several requests for colored item names, and thought this would be more robust for other users.

Be Well

_________________
"Of course that's just my opinion. I could be wrong!"


Image


Top Top
Profile      
 

    Souloux
  Sat Mar 12, 2011 4:38 am
User avatar
Member

I found some compatibility issues when using with XAS v3.9. XAS v3.9 has an active hud script which require a face graphic: hero_HFace.png, where hero is the name of an actor in the database. Since this script requires the color code \c[n] and file formats cannot start with '\' character, it poses some issues.


Top Top
Profile      
 

    Glitchfinder
  Sat Mar 12, 2011 6:29 am
BEWARE: Glitchfinder's sense of humor sucks.
User avatar
Staff

Party Mascot

Location: Approximately 93 million miles from Sol.
Souloux wrote:
I found some compatibility issues when using with XAS v3.9. XAS v3.9 has an active hud script which require a face graphic: hero_HFace.png, where hero is the name of an actor in the database. Since this script requires the color code \c[n] and file formats cannot start with '\' character, it poses some issues.


Actually, this wouldn't work with that even if it used a different format. This script modifies the game so that text that gets drawn to the screen will be affected, which means that other things, like your example, would not be affected at all.

_________________

Just call me Glitch.


Top Top
Profile      
 

    Atoa
  Sat Mar 12, 2011 6:39 am
Victor Sant
User avatar
Member


Location: Brazil
@Souloux
The problem isn't with this script, but with the hud (using the actor's name isn't the best way to add faces on a hud). It wouldn't be hard to make the hud consider another parameter, like the actor.character_name instead of the actor.name.

It's an great script, i made something similar that only for the help window, but it had some other features like drawing icons and items/skill/equips names. I was planning to make it work for everywhere but i got my hands full with another scripts XD

_________________
Image


Top Top
Profile      
 

    Brewmeister
  Sat Mar 12, 2011 3:56 pm
Paste above Main
User avatar


lv 99 Balance Wizard

Location: 42.655713 N 82.619282 W
Souloux, If you want colored actor names & use the actor name for the faces, you could modify the hud script to remove the escape sequence from the name before assembling the file name.. (using the same .sub! method from this script)

Atoa, I started with the idea of making it work just for items, but then a lightbulb went on & I realized I could just implement it in draw_text & it would work everywhere.

Glad you guys like it. I hope some people find it useful.

Funny thing, I have almost 200 projects with scripts I wrote from requests. I need to take the time to clean up & document some of the more useful ones & get them posted.

Be Well

_________________
"Of course that's just my opinion. I could be wrong!"


Image


Top Top
Profile      
 

    Souloux
  Sat Mar 12, 2011 11:46 pm
User avatar
Member

I find this script to be rather useful, so I tried pairing it with Ccoa's UMS. I add the color code to the actor and tried using the name window feature in Ccoa's UMS.

Image

This is how it appears when using the text command in RMXP.
Image

However it works fine in the menu screens.
Image


Top Top
Profile      
 

    Star
  Sun Mar 13, 2011 1:42 am
It's time to kick ass and chew bubble gum.
User avatar
Sponsor


Location: I go where I please, I please where I go
Soooo simple, yet efficient for anyone who is using the standard menus. It's probably still useful for CMS as well. Thanks Brew for this cool script, Ima save it to my collections incase I ever actually finish a game.

_________________
Image


Top Top
Profile      
 

    BlueScope
  Sun Mar 13, 2011 5:14 am
The Third Man
User avatar



Location: Germany
@Souloux: Obviously, scripts that draw text different than the default will output it differently. What you got simply looks like you could switch the positions of this script and the UMS around and it should work fine.

@Brew: It's indeed a little and cool snippet to put into projects if you're too lazy to script custom color outputs for all your scenes... or simply can't. Personally, I prefer the 'direct' way for no special reason... but then again, I'm not exactly the "yay coloured text" person really :p
I'm personally not 100% about VX compatibility... did anyone check that by now?

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    Atoa
  Sun Mar 13, 2011 8:01 am
Victor Sant
User avatar
Member


Location: Brazil
@blueScope
the draw_text from VX is identical to the XP

_________________
Image


Top Top
Profile      
 

    Brewmeister
  Sun Mar 13, 2011 6:04 pm
Paste above Main
User avatar


lv 99 Balance Wizard

Location: 42.655713 N 82.619282 W
Souloux, let me know if Bluescope's suggestion fixes it. Otherwise, I'll take a look at UMS & see if I can make them compatible.

I just tested in VX, and it error'd. Apparently, draw_text in VX converts non-strings so they call it with numbers as well. Fixed script to work in both.

Star, thanks.

_________________
"Of course that's just my opinion. I could be wrong!"


Image


Top Top
Profile      
 

    Souloux
  Sun Mar 13, 2011 8:10 pm
User avatar
Member

@BlueScope I tried switching the position of the scripts. Either way came out with the same output.


Top Top
Profile      
 

    Atoa
  Sun Mar 13, 2011 8:53 pm
Victor Sant
User avatar
Member


Location: Brazil
Expand to see the code.
Why do you clone the string here?
text = str.to_s.dup
would do the same thing, regardless of the value of the str.

_________________
Image


Top Top
Profile      
 

    Brewmeister
  Sun Mar 13, 2011 10:57 pm
Paste above Main
User avatar


lv 99 Balance Wizard

Location: 42.655713 N 82.619282 W
Habit.
The string is not frozen, so clone & dup are the same in this case.
didn't occur to me to convert a string to a string.

_________________
"Of course that's just my opinion. I could be wrong!"


Image


Top Top
Profile      
 

    Atoa
  Mon Mar 14, 2011 12:20 am
Victor Sant
User avatar
Member


Location: Brazil
i do this a lot when not sure if the variable will be always the way it's expected to be, so to ensure that it will be always of the type i expect i do something like this xD if the text is as string, no problem nothing changes, but if it's not, it will be converted.

_________________
Image


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 


Who is online

Users browsing this forum: No users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group