get.chomp issue

DogeWorm

That Insomniac
Veteran
Joined
Apr 30, 2016
Messages
68
Reaction score
3
First Language
English
Primarily Uses
So whenever I use


get.chomp


It displays an issue where it doesn't understand the "get." Can anyone help me with this?
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,138
Reaction score
15,464
First Language
Filipino
Primarily Uses
RMMZ
I've moved this thread to RGSSx Script Support . Please be sure to post your threads in the correct forum next time. Thank you.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,153
Reaction score
818
First Language
Hungarian
Primarily Uses
RMVXA
What is that get actually?


In that context, it is a local variable or a method name, so it must be defined within the method it is used (if it is a local variable) or within the same/related classes (if it is a method name). If it's not defined before you call chomp on it, you will get a crash, and that is expected.


So, you must first define that get variable/method, and call chomp on it after but only if it is NOT nil.


get.chomp if get


This will ensure that the chomp is only run when there is a variable/method named get and only when it is NOT nil.


Ohh, and in case you meant on gets.chomp, well, it is gets, not get.
 
Last edited by a moderator:

DogeWorm

That Insomniac
Veteran
Joined
Apr 30, 2016
Messages
68
Reaction score
3
First Language
English
Primarily Uses
OHHHH, sorry, I forgot to assign get to something. It's a small script that lets you have a shield when you begin the match, blocking all attacks for 2 turns in which you can prepare.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

So I'm practicing ITC with a spirit box, and decide to try to contact my deceased soulmate. It actually gave me multiple identifiers. Me, still a bit skeptical, asked aloud "Fine but does he still love me?" and the box spoke and printed the word "Forever" at the same time. Been a mess of tears since. :kaocry:
Been scratching away at my game and making progress, but just had a revelation. I'm working in full screen and adjusting all my pictures accordingly, but will they resize if someone's screen is smaller?? I hope this doesn't turn out to be a problem later.
Why is there so much month left at the end of money? D=
Hello humans! How goes your day in this journey of living? I hope it is good, for I am human like you, and I am feeling great! Worship the altar.

Forum statistics

Threads
105,627
Messages
1,015,074
Members
137,288
Latest member
GmOcean
Top