Dig hole figured out Basic

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Dig hole figured out Basic

Post 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.
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Dig hole figured out Basic

Post 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 ???)
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: Dig hole figured out Basic

Post 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.
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Dig hole figured out Basic

Post by Mysterious »

Thxs a lot leki awesome :).
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Dig hole figured out Basic

Post 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.
Steven Seagal of gaming industry
User avatar
Jhaelen
Posts: 74
Joined: Fri Oct 19, 2012 10:49 am
Location: Paris, France

Re: Dig hole figured out Basic

Post 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 ?
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Dig hole figured out Basic

Post by Mysterious »

Dammm lol that was so simple and it plays the treasure found sound and all lol. Thxs for that Antti :) Funny as...
Post Reply