Page 1 of 1
Transfer items between alcoves
Posted: Mon Oct 15, 2012 1:33 am
by Mebaru
Hello community,
Need help with script to transfer items from one alcove entity to another.
Code: Select all
for i in alcoveOne:containedItems() do
alcoveTwo:addItem(i)
end
I've tried bruteforcing like this by directly adding items from one alcove to another, but I receive "entity already added to map" error.
Re: Transfer items between alcoves
Posted: Mon Oct 15, 2012 2:08 am
by Lmaoboat
Don't have the editor open right now, but try something like
Code: Select all
for i in alcoveOne:containedItems() do
alcoveTwo:addItem(spawn(i.name))
end
Re: Transfer items between alcoves
Posted: Mon Oct 15, 2012 2:13 am
by Komag
something like that should work well, then for the illusion of a transfer you could destroy the first item
Re: Transfer items between alcoves
Posted: Mon Oct 15, 2012 8:18 am
by Szragodesca
In a situation like this I have to ask if there's a code you can enter for getPos() and setPos() which you can tie to the items in the alcoves. If yes, set a boolean when it gets the item in alcoveA to true, and setPos() the item in alcoveA to the location of alcoveB. then, if the boolean is set to true, move the item into the alcove rather than just in the square.
If that kind of thing isn't possible, how does one add it to the feature requests of the editor? I think it would probably help a lot of people with alcove puzzles and shops in the long run. . . (if there's a more elegant way of doing it, my lack of demo code proves I'm a scripting n00b.

)
Re: Transfer items between alcoves
Posted: Mon Oct 15, 2012 10:59 am
by Mebaru
Lmaoboat wrote:Don't have the editor open right now, but try something like
Code: Select all
for i in alcoveOne:containedItems() do
alcoveTwo:addItem(spawn(i.name))
end
That work, thanks a lot!