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

Dig hole figured out Basic

Post by Mysterious »

I think this is how the dig works. It works for me lol :) It spawns a note and dig hole in front of the party. You must dig in front of the floor trigger. Ok I know it's basic but it works, now if someone can figure out how the Item appears at the Mouse pointer or something like that awesome :)

1 x floor trigger - connects to Script below
triggeredbydigging
disableself = checked

1 x script entity

Code: Select all

function note()
spawn("note",3,19,13,2)
spawn("dig_hole",3,19,13,2)
   end
User avatar
Sorez
Posts: 73
Joined: Fri Aug 23, 2013 9:26 pm

Re: Dig hole figured out Basic

Post by Sorez »

Are those coordinates of the area it spawns the items?
User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: Dig hole figured out Basic

Post by SnowyOwl47 »

Sorez wrote:Are those coordinates of the area it spawns the items?

Code: Select all

--Spawning an Item has a few things to set:
-- Spawn("Item",level,x,y,z,height,"name")
--
-- You can also easily just say spawn("Item")
--
-- Other things you can do are spawn("Item",level,x,y,z,height)
--
-- Now Im not completely sure its in that order "item",level,x,y,z,height,"name" But I am sure about the order of The Item the level, and the name./code]
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 »

I think it's not height but facing, with 0 = north, 1 = east, 2 = south and 3 = west.
User avatar
Sorez
Posts: 73
Joined: Fri Aug 23, 2013 9:26 pm

Re: Dig hole figured out Basic

Post by Sorez »

SnowyOwl47 wrote:
Sorez wrote:Are those coordinates of the area it spawns the items?

Code: Select all

--Spawning an Item has a few things to set:
-- Spawn("Item",level,x,y,z,height,"name")
--
-- You can also easily just say spawn("Item")
--
-- Other things you can do are spawn("Item",level,x,y,z,height)
--
-- Now Im not completely sure its in that order "item",level,x,y,z,height,"name" But I am sure about the order of The Item the level, and the name./code][/quote]

woo, got a chest to spawn! Now the question is, how do I fill it? :geek:
User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: Dig hole figured out Basic

Post by SnowyOwl47 »

Sorez wrote:
woo, got a chest to spawn! Now the question is, how do I fill it? :geek:
:ugeek: to add items to a chest simply say,

Code: Select all

chest_name.surface:addItem(Item)
User avatar
Sorez
Posts: 73
Joined: Fri Aug 23, 2013 9:26 pm

Re: Dig hole figured out Basic

Post by Sorez »

SnowyOwl47 wrote:
Sorez wrote:
woo, got a chest to spawn! Now the question is, how do I fill it? :geek:
:ugeek: to add items to a chest simply say,

Code: Select all

chest_name.surface:addItem(Item)
Im not at best at scripting, this doesn't seem to work, hm.

Code: Select all

function note()
spawn("chest")
chest = IslandChest
spawn("dig_hole")
IslandChest.surface:addItem(note)
   end
User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: Dig hole figured out Basic

Post by SnowyOwl47 »

Sorez wrote:
SnowyOwl47 wrote:
Sorez wrote:
woo, got a chest to spawn! Now the question is, how do I fill it? :geek:
:ugeek: to add items to a chest simply say,

Code: Select all

chest_name.surface:addItem(Item)
Im not at best at scripting, this doesn't seem to work, hm.

Code: Select all

function note()
spawn("chest")
chest = IslandChest
spawn("dig_hole")
IslandChest.surface:addItem(note)
   end

Code: Select all

--This Creates a function called note
function note()
--This spawns a chest but not anywhere on the map
spawn("chest")
-- This sets a custom variable to be called IslandChest
chest = IslandChest
--This Spawns a dig_hole but not anywhere on the map
spawn("dig_hole")
-- This add's an item to the variable which is not correct, and when your saying an item it needs to be ("note")
IslandChest.surface:addItem(note)
--This ends the function
end
So that up there is a big no no,

Correct:

Code: Select all

function note()
--Spawns a chest.
spawn("chest"),level,x,y,facing,height,"chest_1)
--Spawns a dig_hole
spawn("dig_hole",level,x,y,facing,height,"dig_hole_1")
-- Adds a blank note to the chest
chest_1.surface:addItem("note")
end
User avatar
Sorez
Posts: 73
Joined: Fri Aug 23, 2013 9:26 pm

Re: Dig hole figured out Basic

Post by Sorez »

Actually, witouth the coordinates, it spawns the chest right where you dig, but il try this code out now.

EDIT: What does "level" mean? Is it the name of the map it's on, or is it the coordinates of the map itself (in this case, 0,0,0)
User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: Dig hole figured out Basic

Post by SnowyOwl47 »

Sorez wrote:Actually, witouth the coordinates, it spawns the chest right where you dig, but il try this code out now.

EDIT: What does "level" mean? Is it the name of the map it's on, or is it the coordinates of the map itself (in this case, 0,0,0)
Basically it means the order of the levels in the little level area it just means 1 for the first level in order 2 for the second and so on...
Post Reply