Page 1 of 1

(fixed) on_spawn trigger conditions

Posted: Sun Jan 31, 2016 10:57 am
by kaypy
Hi

on_spawn doesn't appear to trigger if an item is created inside anther item. Should this be the case? Or am I misusing the API?

Here is a simple example, with a gem object that logs it's ID as an on_spawn event
http://en.file-upload.net/download-1126 ... n.zip.html

loggem #20 logs successfully, loggem #24 (inside a chest) does not...

Re: on_spawn trigger conditions

Posted: Mon Feb 01, 2016 10:53 pm
by Sophia
It's actually only broken for instances that are there at the very beginning. If you create a loggem (or whatever) inside of a chest via Lua code later on, everything works as it should. So at least there's a workaround.

I'll fix it so it works all the time, of course.

Re: (fixed) on_spawn trigger conditions

Posted: Tue Feb 02, 2016 1:15 pm
by kaypy
Thanks for the fix. Since I was working with lua generated items anyway, my workaround was to manually call the method on each item* at the time it was created. But having an actual fix is always better of course 8-)

* after ensuring it would behave if double-called