Page 1 of 1
Enabling/disabling monster components [SOLVED]
Posted: Thu Feb 19, 2015 2:14 pm
by Granamir
Hi eveyone,
trying to hold a monster so he can't attack and move but can do everything else. It's easy to do from editor but i also have to change these settings via script.
Anyone has a clue on how to do to enable/disable (via script) monster components such as: model, move, turn, attacks, summon, etc.?
Ty
Re: Enabling/disabling monster components
Posted: Thu Feb 19, 2015 3:08 pm
by MrChoke
Granamir wrote:Hi eveyone,
trying to hold a monster so he can't attack and move but can do everything else. It's easy to do from editor but i also have to change these settings via script.
Anyone has a clue on how to do to enable/disable (via script) monster components such as: model, move, turn, attacks, summon, etc.?
Ty
All components have a disable() enable() method. When you check and uncheck components in the editor, it is actually calling these commands in your dungeon file (Dungeon.lua).
So you can call this in a script to turn off a monster's brain for example:
trickster_1.brain:disable()
Re: Enabling/disabling monster components
Posted: Thu Feb 19, 2015 3:48 pm
by Granamir
MrChoke wrote:Granamir wrote:Hi eveyone,
trying to hold a monster so he can't attack and move but can do everything else. It's easy to do from editor but i also have to change these settings via script.
Anyone has a clue on how to do to enable/disable (via script) monster components such as: model, move, turn, attacks, summon, etc.?
Ty
All components have a disable() enable() method. When you check and uncheck components in the editor, it is actually calling these commands in your dungeon file (Dungeon.lua).
So you can call this in a script to turn off a monster's brain for example:
trickster_1.brain:disable()
Works great.
Thank you.