Calling on a spawned item.

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Calling on a spawned item.

Post by Isaac »

Did you call the checkObject() function?
*It destroys the dagger when called; if the dagger exists.

__________
If you call your spawnDagger() function twice, it will crash. This is because you are defining the name as a fixed value in the code. It's okay so long as you never call it again, after the first time [unless you destroy the first dagger], but it is certainly possible to let the game safely name the item on its own, and check for the Id that the game assigned to it, instead of "powerdagger".
Post Reply