Spawn is a nil value.

Talk about anything related to Legend of Grimrock 2 here.
Post Reply
JesterHoro
Posts: 2
Joined: Thu Jun 18, 2015 12:26 am

Spawn is a nil value.

Post by JesterHoro »

I have looked everywhere/googled all my questions regarding this issue with console commands.

I don't know how to fix it. Help?

Ex:
Say I want to spawn myself a gold key.

I would type the following in;
spawn(gold_key)

No matter how many times I try to 'spawn' one in, the message ALWAYS comes up for;

[string "user-input"]:1: attempt to call method 'spawn' (a nil value).

Am I doing something wrong? My game is up-to-date. So I wouldn't think that would be the issue... As I also have enabled console commands. (Because party.party:heal() works with no issues.)

Help?
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Spawn is a nil value.

Post by Dr.Disaster »

If you want to spawn something, put it in quotes -> spawn("gold_key")
JesterHoro
Posts: 2
Joined: Thu Jun 18, 2015 12:26 am

Re: Spawn is a nil value.

Post by JesterHoro »

Oh.. It worked now. Thanks! :D
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Spawn is a nil value.

Post by Isaac »

JesterHoro wrote:Oh.. It worked now. Thanks! :D
The reason it worked, is because "gold_key" ~in quotes, is a data value that corresponds to the name of a defined object that can be spawned; where as just gold_key ~without the quotes, is interpreted as a variable name, and one that is currently a nil value in your script environment.
Post Reply