Page 62 of 400

Re: Ask a simple question, get a simple answer

Posted: Tue Apr 21, 2015 2:16 am
by minmay
Returning false from the onDamage hook works fine for me. You are using the actual hook, and not just adding a connector, right?

Re: Ask a simple question, get a simple answer

Posted: Tue Apr 21, 2015 4:41 am
by Isaac
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?
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. :(
I'll try it in the hook; I assume it will work then.

Re: Ask a simple question, get a simple answer

Posted: Tue Apr 21, 2015 5:14 pm
by THOM
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.

Re: Ask a simple question, get a simple answer

Posted: Tue Apr 21, 2015 6:33 pm
by minmay
Stun makes the monster wait longer between performing actions. Mostly useless imo, since that means the AI is less controllable/predictable.

Re: Ask a simple question, get a simple answer

Posted: Wed Apr 22, 2015 12:17 am
by THOM
minmay wrote:Stun makes the monster wait longer between performing actions. Mostly useless imo, since that means the AI is less controllable/predictable.
I expected something like that. Not my thing then, too...

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

Posted: Thu Apr 23, 2015 12:03 am
by AdrTru
What i must do for vizualization hooks from controller component in my objekt? For player managed connectors. E. G. My custom onActivate.

Re: Ask a simple question, get a simple answer

Posted: Fri Apr 24, 2015 2:32 pm
by The cube
I know the id of a item, how do i find the items name?

Do i have to iterate through the whole map?

Re: Ask a simple question, get a simple answer

Posted: Fri Apr 24, 2015 3:03 pm
by alois
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?
No; if you know the id, then just do "findEntity(id).name" (if you need the object coordinates, do "findEntity.x" etc).

Alois :)

Re: Ask a simple question, get a simple answer

Posted: Thu Apr 30, 2015 10:50 am
by The cube

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
When i trigger this script, the game lags out and i have to close it with control panel. What's wrong?

Re: Ask a simple question, get a simple answer

Posted: Thu Apr 30, 2015 10:54 am
by minmay
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:

Code: Select all

delayedCall(golem_bossfight_script, 20, summonStones())
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:

Code: Select all

delayedCall("golem_bossfight_script", 20, "summonStones")
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".