Few questions - All solved
Posted: Thu Nov 13, 2014 9:21 pm
I am going credit in my dungeon anybody who will answer some of these
1. I´d like to clone object forest_oak_cluster just with some offset (it will be placed outside the map -it should be done with offset parameter)
SOLVED by Doridion
2. I´d like to have script which will prevent party (some hud message will appear) to take out torch from torch_holder. on log1 it was something like
SOLVED by Prozail
orRemove hook conneted to script with
3. Somebody figured out how to place water surface in different height than just -1 ? Id like to have surface of the water in different height.
SOLVED by Doridion
4. Please some easy script where if you dig with shovel on some place, random item from some list will be digged
SOLVED - replied by ninjanerdbgm, cromcrom
Place a floor_trigger where you want the party to dig. Make it only triggerable by digging and tick "disableSelf".
Have it point to a script that's also on top of the dig location with the following code:
1. I´d like to clone object forest_oak_cluster just with some offset (it will be placed outside the map -it should be done with offset parameter)
SOLVED by Doridion
Code: Select all
defineObject{
name = "Oak_test",
base_object = "forest_oak_cluster",
components = {
{
class = "Model",
model = "assets/models/env/forest_oak_cluster.fbx",
-- Give the offset that you want :D
offset = vec(0,0,0,0),
},
},
placement = "floor",
editorIcon = 168,
}
SOLVED by Prozail
orRemove hook conneted to script with
Code: Select all
function stopRemove(sender)
sender.go.socket:addItem(spawn("torch").item)
setMouseItem(nil)
end
SOLVED by Doridion
Code: Select all
defineObject{
name = "user_water_surface",
base_object = "water_surface",
components = {
{
class = "WaterSurface",
fogColor = vec(0.021,0.045,0.13,0),
fogDensity = 0.2,
-- There you'll have to modify by -1.4 or 1.4, as you wish
planeY = -0.4,
reflectionColor = vec(0.693,0.81,0.9,0),
refractionColor = vec(1,1,1,0),
},
{
class = "WaterSurfaceMesh",
material = "water_surface_calm",
underwaterMaterial = "water_surface_underwater",
},
},
placement = "floor",
editorIcon = 264,
}
SOLVED - replied by ninjanerdbgm, cromcrom
Place a floor_trigger where you want the party to dig. Make it only triggerable by digging and tick "disableSelf".
Have it point to a script that's also on top of the dig location with the following code:
Code: Select all
items = {"dagger","rapier","leather_cap","leather_cuisse","note","letter"} -- as many items as you want.
function digRandomStuff()
local item = math.random(1,#items) -- The second number is the amount of items in the list.
item = items[item]
local j = self.go:spawn(item)
playSound("secret")
hudPrint("You found a "..j.item:getUiName().."!")
-- If you need to define component parameters for your items...
if item == "note" then j.scrollitem:setScrollText("I am a note!") end
if item == "letter" then j.scrollitem:setScrollText("I am a letter!") end
-- If you want to give the party a bonus for finding the items...
hudPrint("Gain 250 xp!")
for i=1,4 do
party.party:getChampion(i):gainExp(250)
end
end