[FIXED (2.1.15) - BUG] Item spawning directly to champion
[FIXED (2.1.15) - BUG] Item spawning directly to champion
....
Last edited by NutJob on Wed Nov 12, 2014 5:29 am, edited 5 times in total.
Re: I need to squash this problem once and for all
Also, if anyone tries to reproduce this "bug" (is it?, maybe not) remember to look around. The item will be there but could be facing another way because the item will drop the direction of whatever you used to trigger your script.
And if you can reproduce this, please, do tell, here. If you can't, still please do tell and call me a Butt. It's en vogue... sorry I'm a time traveler.
And if you can reproduce this, please, do tell, here. If you can't, still please do tell and call me a Butt. It's en vogue... sorry I'm a time traveler.
Re: I need to squash this problem once and for all
I'm able to reproduce both cases so you're not losing it...yet 
Funny thing is if you put:
in a script that executes when you start, you get a dagger on the floor but no dagger in hand...weird. The script has to be triggered to get the double dagger result.
I did this:
and I got a dagger in hand and no dagger on the floor. This is strange though.

Funny thing is if you put:
Code: Select all
party.party:getChampion(1):insertItem(1, spawn("dagger").item)
I did this:
Code: Select all
d = spawn("dagger", party.level, party.x, party.y, party.facing, party.elevation, "dagger_x")
party.party:getChampion(1):insertItem(1, d.item)
d:destroy()
Last edited by Batty on Wed Nov 05, 2014 2:33 am, edited 1 time in total.
Re: I need to squash this problem once and for all
I believe *our* scripts are loaded in before they have access to top-level global functions like spawn(). I believe this is why. And yes, I put the above examples in a script on a timer to execute after the game is fully loaded.Batty wrote:I'm able to reproduce both cases so you're not losing it...yet
Funny thing is if you put:in a script that executes when you start, you get a dagger on the floor but no dagger in hand...weird. It has to be triggered to get the double dagger result.Code: Select all
party.party:getChampion(1):insertItem(1, spawn("dagger").item)
I did this:and I got a dagger in hand and no dagger on the floor. This is strange though.Code: Select all
d = spawn("dagger", party.level, party.x, party.y, party.facing, party.elevation, "dagger_x") party.party:getChampion(1):insertItem(1, d.item) d:destroy()
Edit: and to follow up this reply, yes, destroy() does clear up the problem of duplicates but I read a few times on LoG1 forums to never destroy the item once given to a champion. Unclear why (mostly because I forgot and now I can't find these threads) but it was stressed quite extensively.
Re: I need to squash this problem once and for all
There seems to be something wrong here. I'll dig deeper into this later today.
Btw. You can give nil instead of the id to spawn() and it will automatically created a unique id. This is actually recommended.
Btw. You can give nil instead of the id to spawn() and it will automatically created a unique id. This is actually recommended.
Re: I need to squash this problem once and for all
Ok, ghost item bug confirmed. Will be fixed in 2.1.15.
Re: I need to squash this problem once and for all
Thanks petri, can finally give the [BUG] mark 

Re: I need to squash this problem once and for all
Thank you for the upcoming fix and my weird tutorial directions.