Hi,
So before the game starts, I've got the idea to make it say a few things in text boxes, I know the code is;
However, I'm trying to make it only print while a switch is turned off, as I don't want it appearing everytime the player starts the game up, cause it'll get annoying, I only want it showing the first time.
I was hoping something simple like;
Would do the trick, however I seem to get an error;
Now, I don't see how the [1] is an undefined method as it's obviously the switch.
Does anyone have any ideas as to what the problem could be ? Am I doing something COMPLETELY wrong here ?
Thanks.
So before the game starts, I've got the idea to make it say a few things in text boxes, I know the code is;
Code:
Â
p "Blaa blaa."
Â
However, I'm trying to make it only print while a switch is turned off, as I don't want it appearing everytime the player starts the game up, cause it'll get annoying, I only want it showing the first time.
I was hoping something simple like;
Code:
Â
if $game_switches[1] == false
 p "Blaa blaa."
 else
end
Â
I even tried adding an initialize (Don't ask why, I had no idea if it'd help or not, I'm still a rookie scripter, lol);
Â
def initialize
 if $game_switches[1] == false
  p "Blaa blaa."
 else
 end
end
Â
Would do the trick, however I seem to get an error;
Code:
Â
Script "TestPopupText" line 1: NoMethodError occured.
Â
undefined method `[]' for nil:NilClass
Â
Now, I don't see how the [1] is an undefined method as it's obviously the switch.
Does anyone have any ideas as to what the problem could be ? Am I doing something COMPLETELY wrong here ?
Thanks.