Transfer items between alcoves

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Mebaru
Posts: 19
Joined: Sun Oct 14, 2012 2:03 pm

Transfer items between alcoves

Post 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.
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

Re: Transfer items between alcoves

Post 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
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Transfer items between alcoves

Post by Komag »

something like that should work well, then for the illusion of a transfer you could destroy the first item
Finished Dungeons - complete mods to play
Szragodesca
Posts: 59
Joined: Sun Oct 14, 2012 7:13 am

Re: Transfer items between alcoves

Post 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. :P )
Mebaru
Posts: 19
Joined: Sun Oct 14, 2012 2:03 pm

Re: Transfer items between alcoves

Post 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!
Post Reply