could I ask you guys for some scripts help ?
1. I need lever on the wall, when activated to spawn lets say iron_key in nearby alcove
EDIT: SOLVED. I set lever on any action to decrease counter and counter to run following script:
Code: Select all
function createkey()
keyalcove: addItem (spawn "iron_key")
end
2. I have an altar (named Altar1) and a alcove (named Alcove1). What I need, when put particular item (lets say blue_gem) on Altar1, gem will be destroyed and in alcove will appear new item (for example red_gem)
EDIT: SOLVED via teleporter trick
Code: Select all
function altaralcovecheck()
for i in altar_1:containedItems() do
if i.name == "blue_gem" then
teleporter_1: activate()
timer_1: activate() --this is the line added
alcove_1: addItem (spawn "red_gem")
break
end
end
end
3. can I somehow set statue (goromog_statue_blockage) to be destructible ? I saw somewhere on the forum something similar for rock blockage, but cant find it again :/
EDIT: SOLVED
clone object you want to be destroyable and add this to your object.lua
Code: Select all
cloneObject{
name = "destructible_statue",
baseObject = "goromorg_statue_blockage", -- you might want to change this to any statue you like (even working for cave blockades)
brokenModel = "assets/models/env/floor_dirt.fbx", -- you can use any better model but this is ok
health = 100, -- adjust this to your needs
evasion = -1000,
hitEffect = "hit_dust",
hitSound = "impact_generic",
onProjectileHit = function()
return false -- projectiles (arrows and such) shouldn't be able to destroy it
end,
onHit = false, -- this is used to negate the "indestructible" property
onDie = function(self)
-- when statue is destroyed, spawn 2-5 rocks
rocks = math.random(1,2)+1
for i = 1,rocks do
spawn("rock", self.level, self.x, self.y, i%4)
end
end
}
4. some easy script / instruction how to define my own key (I want some door to be opened just with this key and I do not want this to be some "regular key (like Iron, brass, etc...)
EDIT: SOLVED
put in Object.lua your unique cloned key
Code: Select all
cloneObject{
name = "unique_iron_key",
baseObject = "iron_key",
}
