Page 2 of 2

Re: Dig hole figured out Basic

Posted: Tue Oct 21, 2014 6:59 am
by Mysterious
Hi guys. Ok what I have figured out is that when you spawn a Item onto the map that you are currently on, it is called Level 1 for start level eg:

Star location = Level 1 So you would spawn a item using: spawn("note", 1,0,0,0) or spawn("note", 1,0,0,0 -1)
Note: -1 is if you have lowered the floor in your Dungeon to -1 (See Skuggs Tutorial)

Say you have 4 Levels, the level are 1 2 3 4 top to bottom. For some reason this is how it works for spawning anything.

Here are 4 Level:

(0,0,0) Start = lvl 1
(0,0,-1) Start upstairs = lvl 2
(1,0,-1) Start upstairsright = lvl 3

etc..... Even though the Map coordinate change they are still considered Levels when it comes to spawning things.

Re: Dig hole figured out Basic

Posted: Tue Oct 21, 2014 8:44 am
by Mysterious
Hi I tried your Code out and for some reason it does not work eg:

Code: Select all

function notetest()

spawn("chest",3,10,6,2,0,"chesta")
spawn("dig_hole",3,10,6,2,0,"dig_holea")
chesta.surface:addItem("note")
	end
It comes up with the error: bad argument #1 to 'addItem' (ItemComponent expected, got ???)

Re: Dig hole figured out Basic

Posted: Tue Oct 21, 2014 10:19 am
by Leki
Here...

Code: Select all

function spawnChest()
	spawn("chest",1,3,0,2,0,"chest_1")
	spawn("dig_hole",1,3,0,2,0,"dig_hole_1")

	local message = spawn("note")
	message.scrollitem:setScrollText("Read\nthis!")
	chest_1.surface:addItem(message.item)
end
... just use yours coordinates.

Re: Dig hole figured out Basic

Posted: Tue Oct 21, 2014 10:33 am
by Mysterious
Thxs a lot leki awesome :).

Re: Dig hole figured out Basic

Posted: Tue Oct 21, 2014 10:50 am
by antti
With diggable chests, you can just place a chest at a lower elevation than the ground (eg. if your ground is at zero, move chest to -1 height) and the digging and dig hole will be handled automatically. No floor trigger needed either.

Re: Dig hole figured out Basic

Posted: Tue Oct 21, 2014 10:52 am
by Jhaelen
antti wrote:With diggable chests, you can just place a chest at a lower elevation than the ground (eg. if your ground is at zero, move chest to -1 height) and the digging and dig hole will be handled automatically. No floor trigger needed either.
So simple, why didn't I try it :D ?

Re: Dig hole figured out Basic

Posted: Tue Oct 21, 2014 11:51 am
by Mysterious
Dammm lol that was so simple and it plays the treasure found sound and all lol. Thxs for that Antti :) Funny as...