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!
Each object has a subtile X&Y coordinate/offset. The intra-tile positions of items can be shifted using the :setSubtileOffset(x, y) function of the game object. Vertical positioning can be done using the :setWorldPositionY() function.
IttaBitta wrote: ↑Fri Oct 30, 2020 6:20 am
unrelated question: is there a way to bury something other than a chest?
Yes you can:
Put a floor_trigger on the map.
Check its "triggeredByDigging" box, and uncheck the other boxes.
Also check its "disableSelf" box, so the player can only dig it up once.
Then connect it to a script that spawns an item.
Zo Kath Ra wrote: ↑Fri Oct 30, 2020 8:19 am
Yes you can:
Put a floor_trigger on the map.
Check its "triggeredByDigging" box, and uncheck the other boxes.
Also check its "disableSelf" box, so the player can only dig it up once.
Then connect it to a script that spawns an item.
I was trying to summon a different kind of container but it doesn't seem to let me effect what's in THAT
function hiddencorpse()
self.go:spawn("floor_corpse")
self.go:spawn("skull")
self.go:spawn("rapier")
hudPrint("You have found a buried body")
for i = 1, 4, 1 do
party.party:getChampion(i):gainExp(250)
end
hudPrint("250 exp")
playSound("secret")
end
If you are spawning another container that you want filled with some items I would simply place it below the map populated with your items, and then use the script to move it into position when the party digs.
first use print(floor_trigger_1:getWorldPosition()) to get the worldposition of your floor trigger.
And then use yourcontainer_1:setWorldPosition(vec(1, 1, 1, 0)) in the script to set the container where vec is the location you got before.
Skuggasveinn.
Link to all my LoG 2 assets on Nexus. Link to all my LoG 1 assets on Nexus.
function hiddencorpse()
self.go:spawn("floor_corpse")
self.go:spawn("skull")
self.go:spawn("rapier")
hudPrint("You have found a buried body")
for i = 1, 4, 1 do
party.party:getChampion(i):gainExp(250)
end
hudPrint("250 exp")
playSound("secret")
end
If you are spawning another container that you want filled with some items I would simply place it below the map populated with your items, and then use the script to move it into position when the party digs.
first use print(floor_trigger_1:getWorldPosition()) to get the worldposition of your floor trigger.
And then use yourcontainer_1:setWorldPosition(vec(1, 1, 1, 0)) in the script to set the container where vec is the location you got before.
Skuggasveinn.
Tried that, now the container(a coffin) is incorporeal for some reason.
I can walk through it but not touch it.
edit: solved the problem, I now have it waiting above ground, just hidden away in a corner, and it works now.
neeeeeeeeeew question
how would I go about making a button that dispenses cheese into an alcove or on to an altar
I can easily get it to spawn on the floor but that is gross :V