Using Skugg's Dig Script Prob

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

Using Skugg's Dig Script Prob

Post by Mysterious »

Hi all. Ok I got the script to spawn a note when it's dug up but I cant get the text to appear on the note. eg:

Code: Select all

function hiddencorpse1()
      self.go:spawn("floor_corpse")
      self.go:spawn("skull")
      self.go:spawn("dig_hole")
      self.go:spawn("rapier")
self.go:spawn("note")
--note.scrollitem:setScrollText("This place will be your end.\n\n Draco")

      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
What is the error I am making here thxs guys :) Also this is the note self.go:spawn("note") I tried this to rename the note:
self.go:spawn("note","note1a") but does not work.
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: Using Skugg's Dig Script Prob

Post by Prozail »

If you do it like that you can't set the ID of the note, you get a random one assigned.
So just temporarily store it so you can access it.

Code: Select all

function hiddencorpse1()
	self.go:spawn("floor_corpse")
	self.go:spawn("skull")
	self.go:spawn("dig_hole")
	self.go:spawn("rapier")
	local note = self.go:spawn("note")

	-- This shows the random id generated
	-- print(note.id)

	note.scrollitem:setScrollText("This place will be your end.\n\n Draco")

	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

User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Using Skugg's Dig Script Prob

Post by Mysterious »

Hi Thank you very much for that now I get it :)
Post Reply