Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

 
Reply to this topicStart new topic
> Need a variable script., To display variables as text through scripting.
Decedent
post Apr 27 2012, 06:11 PM
Post #1


Level 6
Group Icon

Group: Member
Posts: 86
Type: Developer
RM Skill: Advanced




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




__________________________
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Apr 28 2012, 07:56 PM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,527
Type: Scripter
RM Skill: Undisclosed




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}


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
Decedent
post Apr 29 2012, 04:58 PM
Post #3


Level 6
Group Icon

Group: Member
Posts: 86
Type: Developer
RM Skill: Advanced




That is exactly what I was after! Thanks a bunch.


__________________________
Go to the top of the page
 
+Quote Post
   
neiljwd
post Apr 30 2012, 02:35 AM
Post #4


Level 5
Group Icon

Group: Member
Posts: 69
Type: None
RM Skill: Undisclosed




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.



This post has been edited by neiljwd: May 1 2012, 02:20 AM


__________________________
If you help me I'll pray for you^^.
Go to the top of the page
 
+Quote Post
   
Decedent
post Apr 30 2012, 05:10 PM
Post #5


Level 6
Group Icon

Group: Member
Posts: 86
Type: Developer
RM Skill: Advanced




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...


__________________________
Go to the top of the page
 
+Quote Post
   
neiljwd
post Apr 30 2012, 10:16 PM
Post #6


Level 5
Group Icon

Group: Member
Posts: 69
Type: None
RM Skill: Undisclosed




ooops I dumb.

This post has been edited by neiljwd: May 1 2012, 02:18 AM


__________________________
If you help me I'll pray for you^^.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 09:45 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker