Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Returning false from the onDamage hook works fine for me. You are using the actual hook, and not just adding a connector, right?
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.
Re: Ask a simple question, get a simple answer
Nope, it was a connector in this case. I guess that explains it. I had hoped not to need to define it initially. The script works as intended, it just isn't capable of canceling an attack this way.minmay wrote:Returning false from the onDamage hook works fine for me. You are using the actual hook, and not just adding a connector, right?
![Sad :(](./images/smilies/icon_e_sad.gif)
I'll try it in the hook; I assume it will work then.
Re: Ask a simple question, get a simple answer
Found out, that there is a monster-condition "stunned".
I've tried to create a weappon, that stunns monsters. So far everything works, but all what happens is, the monster gets a bunch of stars that swirls around it's head for some secounds. No other effect AFAIK. Have I missed something or is this an unfinished implementation? Can't remember to see this effect in the main-campaign.
I've tried to create a weappon, that stunns monsters. So far everything works, but all what happens is, the monster gets a bunch of stars that swirls around it's head for some secounds. No other effect AFAIK. Have I missed something or is this an unfinished implementation? Can't remember to see this effect in the main-campaign.
Re: Ask a simple question, get a simple answer
Stun makes the monster wait longer between performing actions. Mostly useless imo, since that means the AI is less controllable/predictable.
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.
Re: Ask a simple question, get a simple answer
I expected something like that. Not my thing then, too...minmay wrote:Stun makes the monster wait longer between performing actions. Mostly useless imo, since that means the AI is less controllable/predictable.
Next question: Is there a possibility to disable monster-components from monster-groups? I would like to have some monsters-groups standing frozen-like when the party is entering the areal. Nomally I would do this by disabeling the brain and animation component. But groups do not offer the checkboxes to do this in the editor. Any ideas, how to adress the monsters in a group? Then I could do this in a script... And no: defining the monstergroup as "guard" is not the same I have in mind...
Re: Ask a simple question, get a simple answer
What i must do for vizualization hooks from controller component in my objekt? For player managed connectors. E. G. My custom onActivate.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
MultiAlcoveManager, Toolbox, Graphic text,
Re: Ask a simple question, get a simple answer
I know the id of a item, how do i find the items name?
Do i have to iterate through the whole map?
Do i have to iterate through the whole map?
Re: Ask a simple question, get a simple answer
No; if you know the id, then just do "findEntity(id).name" (if you need the object coordinates, do "findEntity.x" etc).The cube wrote:I know the id of a item, how do i find the items name?
Do i have to iterate through the whole map?
Alois
![Smile :)](./images/smilies/icon_e_smile.gif)
Re: Ask a simple question, get a simple answer
Code: Select all
function summonStones()
if golem.bossfight:isEnabled() then
spawn("summon_stone", 1, 11, 5, 1, 0)
spawn("summon_stone", 1, 17, 5, 3, 0)
delayedCall(golem_bossfight_script, 20, summonStones())
end
end
Re: Ask a simple question, get a simple answer
http://en.wikipedia.org/wiki/Infinite_l ... _recursion
When you call a function, the code inside it runs. Your function is immediately calling itself every time it is called because of this line:So it will continue calling itself indefinitely until the Lua virtual machine runs out of stack space.
Since your function doesn't even return anything, I assume you meant to do this:
delayedCall is just like a connector, the action needs to be a string argument that will be the message sent to the object's component named "controller".
When you call a function, the code inside it runs. Your function is immediately calling itself every time it is called because of this line:
Code: Select all
delayedCall(golem_bossfight_script, 20, summonStones())
Since your function doesn't even return anything, I assume you meant to do this:
Code: Select all
delayedCall("golem_bossfight_script", 20, "summonStones")
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.