Rest and Rewards

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Ulwaen
Posts: 44
Joined: Thu Feb 07, 2013 4:12 pm

Re: Rest and Rewards

Post by Ulwaen » Tue Feb 12, 2013 6:02 pm

Do somebody has an idea where the issue comes from?!?
"Komag" I toke off this :
onAttack = function (self, weapon)
return damage.whatWeapon(self, weapon)
end,

But the game continue to crash anyway...

"Crisman" could you explain exactly what you did to make it works (step by step) please!

User avatar
Komag
Posts: 3637
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Rest and Rewards

Post by Komag » Tue Feb 12, 2013 6:23 pm

try as we suggested and put print messages at each step to see where the crash is.

It looks like your hook is fine, it simply will run the function when the player rests.

Your function is where the problem is at:

Code: Select all

function doRest()
  if restCount >= 6 then
     return true
  end
  restCount = restCount + 1
  local d = findEntity("restDoor"..restCount):close()
  if d then d:close() end
end
Don't "return true", that might be what's crashing the editor, as it's trying to return a true value to something that didn't ask for it. If you want the rest of the function to stop if the restCount it >= 6 then just "return", not "return true"
for the d you need to leave off :close() on the line where you define the local variable. If the "return true" wasn't the problem then the first :close() is.

Code: Select all

function doRest()
  if restCount >= 6 then return end
  restCount = restCount + 1
  local d = findEntity("restDoor"..restCount)
  if d then d:close() end
end
Finished Dungeons - complete mods to play

User avatar
Ulwaen
Posts: 44
Joined: Thu Feb 07, 2013 4:12 pm

Re: Rest and Rewards

Post by Ulwaen » Tue Feb 12, 2013 7:20 pm

It's working! Thank you very much guys! ;)

Post Reply