Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Thanks minmay for helping my retardedness
Re: Ask a simple question, get a simple answer
Went there : viewtopic.php?t=7972 but I didn't found how to damage party by script.
Re: Ask a simple question, get a simple answer
Nevermind : I damaged each champion.
Code: Select all
party.party:getChampion(1):damage(80,"fire")
party.party:getChampion(2):damage(80,"fire")
party.party:getChampion(3):damage(80,"fire")
party.party:getChampion(4):damage(80,"fire")
Re: Ask a simple question, get a simple answer
The way to damage the party by script, is to the damageTile global function:Marskilla wrote: ↑Mon Apr 08, 2019 7:28 pm Went there : viewtopic.php?t=7972 but I didn't found how to damage party by script.
Code: Select all
damageTile(level, x, y, direction, elevation, flags, damageType, power)
Where —flags— can be the following:
https://github.com/JKos/log2doc/wiki/Ob ... amageflags
Re: Ask a simple question, get a simple answer
Question about this script. Is there a way to make a script that does the same thing but then for wall decorations? And if so any help on how?vanblam wrote: ↑Sat Apr 06, 2019 6:59 amSo like that?Code: Select all
if choice3 >= 0.4 then spawn("rc_ground_pebbles_04",g.level,g.x,g.y,math.random(0,3),g.elevation) elseif choice3 >= 0.5 then spawn("rc_ground_pebbles_01",g.level,g.x,g.y,math.random(0,3),g.elevation) elseif choice3 >= 0.6 then spawn("rc_ground_pebbles_02",g.level,g.x,g.y,math.random(0,3),g.elevation) elseif choice3 >= 0.7 then spawn("rc_ground_pebbles_03",g.level,g.x,g.y,math.random(0,3),g.elevation) end
Re: Ask a simple question, get a simple answer
How do I kill a monster using a trigger? I feel like an idiot (complete noob when it comes to scripting) as I managed to pull it off using something simple like
function killzombie
disable:zombie()
end
and had the trigger point to the function and then disable itself, I was troubleshooting an error message (turns out I just needed to reset the editor) and in the process I had deleted the script entity. Problem is, I forget precisely what I put and now everything I try doesn't work
So yeah, just a very simple script that simply makes the monster despawn with no fanfare or anything please
Edit: Figured it out:
zombie:destroy()
function killzombie
disable:zombie()
end
and had the trigger point to the function and then disable itself, I was troubleshooting an error message (turns out I just needed to reset the editor) and in the process I had deleted the script entity. Problem is, I forget precisely what I put and now everything I try doesn't work
So yeah, just a very simple script that simply makes the monster despawn with no fanfare or anything please
Edit: Figured it out:
zombie:destroy()
Re: Ask a simple question, get a simple answer
function killzombie1()
zombie_1.monster:die()
end
Make sure you use the correct entity_ID
As you probably used "mummy"
zombie_1.monster:die()
end
Make sure you use the correct entity_ID
As you probably used "mummy"
Re: Ask a simple question, get a simple answer
hi there,
how can I automatically activate the controller of an objet who use combined PushableBlock and PushableBlockFloor classes?
I'm using self.go.controller:setInitialState(true) on the controller of the PushableBlockFloor but that doesn't do anything.
I can only make it work, by enabling the controller component within the editor.
The purpose is to make an object who should be floating with minimalsavestate = true, but without making an animation, and using the floating "animation" of the pushableblock.
(its basically to not have any additional animation and have the object never saved but always activated on a reload)
how can I automatically activate the controller of an objet who use combined PushableBlock and PushableBlockFloor classes?
I'm using self.go.controller:setInitialState(true) on the controller of the PushableBlockFloor but that doesn't do anything.
I can only make it work, by enabling the controller component within the editor.
The purpose is to make an object who should be floating with minimalsavestate = true, but without making an animation, and using the floating "animation" of the pushableblock.
(its basically to not have any additional animation and have the object never saved but always activated on a reload)
SpoilerShow
Code: Select all
defineObject{
name = "mine_platform_chains_moving",
baseObject = "base_floor_decoration",
components = {
{
class = "Model",
model = "mod_assets/models/mine_platform.fbx",
staticShadow = true,
offset = vec(0, 0, 0),
},
{
class = "DynamicObstacle",
enabled = false,
},
{
class = "PushableBlock",
},
{
class = "PushableBlockFloor",
name = "controller",
onInit = function(self)
self.go.controller:setInitialState(true)
end,
},
{
class = "Model",
name = "chain1",
model = "mod_assets/models/mine_platform_chain.fbx",
staticShadow = true,
offset = vec(1.5, 0, 1.5),
},
{
class = "Model",
name = "chain2",
model = "mod_assets/models/mine_platform_chain.fbx",
staticShadow = true,
offset = vec(1.5, 0, -1.5),
},
{
class = "Model",
name = "chain3",
model = "mod_assets/models/mine_platform_chain.fbx",
staticShadow = true,
offset = vec(-1.5, 0, 1.5),
},
{
class = "Model",
name = "chain4",
model = "mod_assets/models/mine_platform_chain.fbx",
staticShadow = true,
offset = vec(-1.5, 0, -1.5),
},
--[[ {
class = "Platform",
},]]
},
minimalSaveState = true,
}
Re: Ask a simple question, get a simple answer
You don't need a component named "controller" or a PushableBlockFloorComponent. Just activate() the PushableBlockComponent:
Code: Select all
defineObject{
name = "mine_platform_chains_moving",
baseObject = "base_floor_decoration",
components = {
{
class = "Model",
model = "mod_assets/models/mine_platform.fbx",
staticShadow = true,
offset = vec(0, 0, 0),
},
{
class = "DynamicObstacle",
enabled = false,
},
{
class = "PushableBlock",
onInit = function(self)
self:activate()
end,
},
{
class = "Model",
name = "chain1",
model = "mod_assets/models/mine_platform_chain.fbx",
staticShadow = true,
offset = vec(1.5, 0, 1.5),
},
{
class = "Model",
name = "chain2",
model = "mod_assets/models/mine_platform_chain.fbx",
staticShadow = true,
offset = vec(1.5, 0, -1.5),
},
{
class = "Model",
name = "chain3",
model = "mod_assets/models/mine_platform_chain.fbx",
staticShadow = true,
offset = vec(-1.5, 0, 1.5),
},
{
class = "Model",
name = "chain4",
model = "mod_assets/models/mine_platform_chain.fbx",
staticShadow = true,
offset = vec(-1.5, 0, -1.5),
},
--[[ {
class = "Platform",
},]]
},
minimalSaveState = true,
}
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.