iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
 
Reply to this topicStart new topic
> Change value of items in a module
vibr
post Dec 1 2011, 07:19 PM
Post #1



Group Icon


Type: Designer




I just started learning scripting and I'm just testing out some ideas that I have. But I need a bit of help.
Basically, if I had a script in the Modules section (meaning it only contains a module) and it had a variable like GameSize = 5 and then I also had another script that allowed the user to open a window(in game)and type in a number. The number that the user put in would then become what GameSize is. E.g. if the user put in the number 45 then the variable would become GameSize = 45. Now for my question.
What would I put to make the what the user put in replace what was in the module originally, if its in a seperate script?
If you want me to clarify then just say so, thanks.
Go to the top of the page
 
+Quote Post
   
SowS
post Dec 3 2011, 03:13 PM
Post #2


I'm still smiling. My jaw hurts now.
Group Icon


Type: Coder
Alignment: Neutral Good




Well, a variable starting with an uppercase is constant, meaning, you can't change its value after it's initialized. You can use a global variable (variables starting with $, i.e. $gamesize) for this. Use of this type of variables must be minimal though, since it's harder to debug codes with them.


--------------------
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: 22nd September 2014 - 05:22 PM

RPGMakerVX.net is an Privacy Policy, Legal.