Help - Search - Members - Calendar
Full Version: Need a variable script.
RPG RPG Revolution Forums > Scripting > Script Development and Support > Script Requests
Decedent
I've searched high and low and can't seem to find how to add variables or even switch names to a scene in the menu. The concept is like this;

In the menu (where Items, Equipment etc are) is an option called Rank (which will bring up a new scene.) Inside this scene should show a number of things that are being ranked throughout the game, and some of the affiliations would have to be ??? until they are discovered in the game. For example,

Item Hunter
53 / 100
Rank IV

Where 'Item Hunter' would be the name of a switch or a character that can be renamed from ??? to 'Item Hunter' when unlocked. The first number (53) would be a variable that increases every time the character opens a chest or finds a treasure (that's easy). The /100 would just be text, and the rank would change every time the player reached 100.

But I don't know how to add the value of a variable or the name of an actor into text without it simply looking like \V[10] or something. As a last resort I can always have an item or something that runs an event with messages, that is simple enough it just won't look as nice and would be more annoying to use when the Rank option from the menu would show all the affiliations at once.

Hope this made sense :-S


Night_Runner
To display variables, instead of \v[123] you need #{$game_variables[123]}
And to display actors names, instead of \n[1] use #{$game_actors[1].name}
Decedent
That is exactly what I was after! Thanks a bunch.
neiljwd
Hi, total RGSS unskilled nub here, but I have very similar question to the original topic, and feel as it's been answered, I won't be hijacking, and may get some help.

Basically, I'd like my Status screen to have a different name for attack depending on an IN GAME variable.
In this case Variable 1. 0 ='s day 1='s night.

I'd like Attack to be called Blood Power at night.
So as standard my code for status screen looks like this:

when 0
parameter_name = $data_system.words.atk
parameter_value = @actor.atk
when 1

What I'd like though is an IF statment that checks in game variable 1, and if it ='s 1, then
parameter_name = Blood Power
parameter_value = @actor.atk

I was thinking
I was Thinking
:
CODE
when 0
if $game_variables[1] = 0
  parameter_name = $data_system.words.atk
parameter_value = @actor.atk
else
if $game_variables[1] = 1
  parameter_name = Blood Power
parameter_value = @actor.pdef
end
end
when 1



but that No work. sad.gif Can anyone spell it out for me please?
Further Clarification of what i'm asking.

If you look at this screenshot.
http://img161.imageshack.us/img161/3500/noreqhk6.png


Where it says Attack 107, I'd like to change the word Attack to read Blood.

Depending on an in-game variable (basically A real and dream world where stats do different things, but have the same value (107 in this case)). And I'm just having Variable 0001 = 0 for real and variable 0001 = 1 for dream/night. I want ATTACK to look at variable 0001 and read Attack if it's 0, and read Blood Power if it's 1.

Hope I've explained myself properly.

Decedent
no probs neiljwd. While the topic is still active though I'm now stuck with the conditional branch, I was hoping for the words to be greyed out when unkown, and colored when discovered. I have this;

if $game_actors[31].name = "???"
self.contents.font.color = disabled_color
self.contents.draw_text(0, 97, 141, 100, "#{$game_actors[31].name}")
self.contents.draw_text(0, 152, 141, 100, "#{$game_variables[123]}/100")
else
self.contents.font.color = system_color
self.contents.draw_text(0, 150, 244, 100, "{$game_actors[25].name}")
self.contents.font.color = normal_color
self.contents.draw_text(27, 117, 244, 100, "#{$game_variables[123]}/100")
end

Problem is I don't think that's the right way to check if actors name = something. It appears grayed out no matter what combination of writing I try and ignores the 'else' section...
neiljwd
ooops I dumb.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.