Code: Select all
defineObject{
name = "xan_invisiblealtar",
class = "Altar",
model = "mod_assets/chest/null.fbx",
placement = "floor",
editorIcon = 52,
}
Code: Select all
defineObject{
name = "xan_invisiblealtar",
class = "Altar",
model = "mod_assets/chest/null.fbx",
placement = "floor",
editorIcon = 52,
}
Code: Select all
defineObject{
name = "party",
class = "Party",
onPickUpItem = function(party,item)
if item.name == "open_chest" then
return false
else
return true
end
end,
editorIcon = 32,
}
defineObject{
name = "open_chest",
class = "Item",
uiName = "Open Chest",
model = "mod_assets/chest/null.fbx",
slot = "Neck",
gfxIndex = 219,
weight = 0.4,
}
defineObject{
name = "xan_chest",
class = "PressurePlate",
model = "mod_assets/chest/chest.fbx",
activateAnim = "mod_assets/chest/chestopen.fbx",
deactivateAnim = "mod_assets/chest/chestclose.fbx",
placement = "floor",
editorIcon = 0,
}
defineObject{
name = "xan_chest2",
class = "Button",
model = "mod_assets/chest/chestbtn.fbx",
pressAnim = "mod_assets/chest/chestclose.fbx",
placement = "wall",
editorIcon = 12,
}
defineObject{
name = "xan_invisibleblocker",
class = "Blockage",
model = "mod_assets/chest/null.fbx",
brokenModel = "mod_assets/chest/null.fbx",
placement = "floor",
health = 999999999,
evasion = 999999999,
hitSound = "barrel_hit",
hitEffect = "hit_wood",
editorIcon = 56,
repelProjectiles = true,
onDamage = function(p1, p2)
return false
end,
onProjectileHit = function(p1, p2, p3, p4)
return false
end,
onDie = function(p1)
return false
end,
}
defineObject{
name = "xan_invisiblealtar",
class = "Altar",
model = "mod_assets/chest/null.fbx",
placement = "floor",
editorIcon = 52,
}
defineMaterial{
name = "mtl_chest",
diffuseMap = "mod_assets/chest/chest.tga",
specularMap = "mod_assets/chest/chest.tga",
normalMap = "mod_assets/chest/chest.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 40,
depthBias = 0,
}
defineMaterial{
name = "mtl_null",
diffuseMap = "mod_assets/chest/null.tga",
specularMap = "mod_assets/chest/null.tga",
normalMap = "mod_assets/chest/null.tga",
doubleSided = false,
lighting = false,
alphaTest = true,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 40,
depthBias = 0,
}
Code: Select all
g_ChestCount = 0
g_ChestItems = {"scroll_light", "boiled_beetle", "blue_gem" }
function toggle()
if (g_ChestCount == 0) then
g_ChestCount = 1
spawn ("open_chest",1,16,12,2,"open_chest_1")
elseif (g_ChestCount >= 1 and g_ChestCount <= #g_ChestItems) then
setMouseItem(spawn(g_ChestItems[g_ChestCount]))
g_ChestCount = g_ChestCount + 1
else
if xan_chest_1:isDown() then
open_chest_1:destroy()
elseif xan_chest_1:isUp() then
spawn ("open_chest",1,16,12,2,"open_chest_1")
hudPrint("The chest is empty.")
end
end
end
You could make it look sensible if you attach the model to something like a dragon statue base :3Merethif wrote:I've just tested the chest and it looks really good so far. The invisible blocker works a bit strange though. I understand the need of bouncing thrown items if chest is placed in dead-end tunnel, but when placed in the centre of the room this item blocking looks awkward. Especially since you can shoot/throw items over the regular altars.
I was wondering if it wouldn't be easier to turn a chest into a sort of "wall mounted" container using the model of Goromog statues prop with removed statue and a chest placed instead (the chest would fit it really nicely I suppose).
montagneyaya wrote:For some reason I would use the chest based on the pressure plate, not on the pit.
I have tried the pressure plate solution for a similar attempt to animate objects and it does not work properly for what i'm trying to achieve.Xanathar wrote:Tomorrow I'll try the pressure plate solution, but doesn't seem easy at first sight.