Page 1 of 1

Using Skugg's Dig Script Prob

Posted: Tue Oct 28, 2014 8:13 am
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.

Re: Using Skugg's Dig Script Prob

Posted: Tue Oct 28, 2014 9:39 am
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


Re: Using Skugg's Dig Script Prob

Posted: Tue Oct 28, 2014 9:50 am
by Mysterious
Hi Thank you very much for that now I get it :)