RPG Maker Forums

Why does this very basic script fail:





with this error:





All I need to know is how to initialise the variable to stop it from failing.


That's all.


I'm not new to scripting I am just new to Ruby and I just need to get my head around some of the basics. So, just a nudge - why does this fail on load?


I have the $game_switches[1] switch set to "true" as a Player Touch event on the map.


To clarify: I get that the variable has to exist before I can apply a value to it. I've been through the scripts I am using but what I cannot see is a methodology for initialising the variable\switch\widget that I need to use PRIOR to when I need it, so the game does not fail.


I can do this this in Powershell and T-SQL, but I cannot work out how to declare and set the initial value for a variable in Ruby, specifically in VX Ace.


That's all the info I need to know - how to do that...?!


Thank you!


Anyone? :)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,551
Members
137,837
Latest member
Dabi
Top