Page 1 of 1

Scripting: action when gobelin is torn out?

Posted: Mon Mar 31, 2014 10:44 am
by THOM
Hey
does someone know if you can add an action when a gobelin is torn out?

I tried the "onDie" hook, but it had no result.

Re: Scripting: action when gobelin is torn out?

Posted: Tue Apr 01, 2014 9:42 pm
by THOM
Really no one an idea?

Gobelins seem to have some hardcoded attributes (sound, health) - and no other hooks, that could be used...

Maybe some scripting resolution?

Re: Scripting: action when gobelin is torn out?

Posted: Tue Apr 01, 2014 10:11 pm
by Dr.Disaster
Gobelins belong to object class "WallTapestry" and beside placing and breaking them there is nothing else that can be done with them. The only option i see (and i don't know how to do it) is to write a script that checks if a specific gobelin was torn down. If that's not possible a class change is required to enable any action.

Re: Scripting: action when gobelin is torn out?

Posted: Wed Apr 02, 2014 12:32 am
by JohnWordsworth
About to get on a plane in an hour or so, so can't post a full solution right now but I think the way I would do it is to add a function to the party onAttack hook and then check to see if the specific Wall Tapstry is 'directly in front' of the player. Attacks on Wall Tapestry's always hit I think, so you should be able to assume you always hit it if it's there.

Another possibility (maybe) is to make a new blockage perhaps, which is a single model made of both a wall and the tapestry meshes merged together. I think you can query a blockage to see if it's destroyed? This doesn't seem like the best solution, but I'm just throwing out an alternative route if there is a reason why (A) wouldn't work.

Re: Scripting: action when gobelin is torn out?

Posted: Wed Apr 02, 2014 1:46 am
by minmay
You'll also need to account for the tapestry being destroyed by a fireball.