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...
(fixed) on_spawn trigger conditions
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: on_spawn trigger conditions
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.
I'll fix it so it works all the time, of course.
Re: (fixed) on_spawn trigger conditions
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
* after ensuring it would behave if double-called
Friends don't let friends eat worm round