Sorry to read about these probs - i thought all people using this would be aware to look carefully at my example dungeon...
Really bad description failure by me. Well, in real i forgot to mention it exactly in my manual v3.. and since i have soo small time
to bother with grimrock (i really want but... ) it was forgotten over time.
In the objects.lua - at the beginning - you´ll find this section:
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onAttack = function (self, weapon)
return DMDungeonInit.whatWeapon(self, weapon)
end,
}
For that functionality it is necessary to use a party hook.
These section from "dm_cavein_breakable" in objects.lua:
Code: Select all
-- IMPORTANT! clone party + script 'DMDungeonInit' in dungeon needed! see DM Set manual.
onDamage = function(self, dmg, dmgType)
if dmgType == "fire" or
dmgType == "cold" or
dmgType == "shock" or
dmgType == "poison"
then
hudPrint("Magic has no effect on Stone and Gravel!")
return false
else
return DMDungeonInit.checkDamage(self, dmg, dmgType)
end
end,
So here the initial script that you must set at level 1 of your dungeon:
Script: DMDungeonInit
Code: Select all
usedWeapon = ""
function checkDamage(self, dmg, dmgType)
if usedWeapon == "dm_pickaxe" then
usedWeapon = ""
return true
else
if self.name == "dm_cavein_breakable" then
hudPrint("Use a Pickaxe for digging..")
end
usedWeapon = ""
return false
end
end
function whatWeapon(self, weapon)
if weapon then
usedWeapon = weapon.name
end
return true
end
Summary:
Objects.lua
- clone party script
- dm_cavein_breakable object definition
Items.lua
- dm_pickaxe item definition
Dungeon editor file
- script function - DMDungeonInit - must be set!
(you will find mine at the first level in the top left corner)
Then all should work as expected! (hopefully) xD
Please be gentle with me
Wish you all a cool mod experience with grimrock 2 - damn, if i would have enough time... so full of ideas.