Page 1 of 2
Dig hole figured out Basic
Posted: Mon Oct 20, 2014 10:50 am
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
Re: Dig hole figured out Basic
Posted: Mon Oct 20, 2014 4:21 pm
by Sorez
Are those coordinates of the area it spawns the items?
Re: Dig hole figured out Basic
Posted: Mon Oct 20, 2014 6:55 pm
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]
Re: Dig hole figured out Basic
Posted: Mon Oct 20, 2014 7:06 pm
by Jhaelen
I think it's not height but facing, with 0 = north, 1 = east, 2 = south and 3 = west.
Re: Dig hole figured out Basic
Posted: Mon Oct 20, 2014 7:08 pm
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:
Re: Dig hole figured out Basic
Posted: Mon Oct 20, 2014 7:52 pm
by SnowyOwl47
Sorez wrote:
woo, got a chest to spawn! Now the question is, how do I fill it?


to add items to a chest simply say,
Re: Dig hole figured out Basic
Posted: Mon Oct 20, 2014 8:14 pm
by Sorez
SnowyOwl47 wrote:Sorez wrote:
woo, got a chest to spawn! Now the question is, how do I fill it?


to add items to a chest simply say,
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
Re: Dig hole figured out Basic
Posted: Mon Oct 20, 2014 8:22 pm
by SnowyOwl47
Sorez wrote:SnowyOwl47 wrote:Sorez wrote:
woo, got a chest to spawn! Now the question is, how do I fill it?


to add items to a chest simply say,
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
Re: Dig hole figured out Basic
Posted: Mon Oct 20, 2014 8:30 pm
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)
Re: Dig hole figured out Basic
Posted: Mon Oct 20, 2014 9:04 pm
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...