It works very well with an item of original games. But if I try to create my own item, it does not work anymore. I don't know why.
Example with the original skull :
items.lua
SpoilerShow
Code: Select all
defineObject{
name = "skull_fake",
class = "Item",
uiName = "Skull",
model = "assets/models/items/skull.fbx",
gfxIndex = 31,
weight = 1.0,
} SpoilerShow
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onPickUpItem = function(party, item) -- called when any item is picked up
if item.name == "skull_fake" then
return false -- cancel the pickup action
end
end,
} But when I want to take an item from a mod. It does not work. Example with the skull pack of Asteroth6
items.lua
SpoilerShow
Code: Select all
defineObject{
name = "skull_stone_fake",
class = "Item",
gfxAtlas = "mod_assets/textures/icons/items_s.tga",
uiName = "Stone Skull",
model = "mod_assets/models/stone_skull.fbx",
gfxIndex = 29,
weight = 1.0,
}
SpoilerShow
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onPickUpItem = function(party, item) -- called when any item is picked up
if item.name == "skull_stone_fake" then
return false -- cancel the pickup action
end
end,
} 