Page 1 of 1
KillObject() CommandArmedAnimatedBuilding possible? [Solved]
Posted: Tue Sep 05, 2017 2:51 pm
by Dasher
As the title implies I tried to kill an object labeled "CommandArmedAnimatedBuilding" via LUA command KillObject(), but without success. I've also tried SetProperty to set CurHealth=0 but did't succeed either. All these commands worked when I labeled the object "ArmedBuilding", the problem is I need it to be "CommandArmedAnimatedBuilding" for the weapon animation to work when the object is killed, since this isn't the case as long as the object is an "ArmedBuilding". Any ideas? Help is greatly appreciated.
Re: KillObject() on CommandArmedAnimatedBuilding possible?
Posted: Tue Sep 05, 2017 6:10 pm
by Marth8880
What do you mean when you say you "labeled" these objects? Are you talking about the ClassLabel in their associated ODF? If so, that's not what you need to reference in the Lua script; instead, you need to reference the object's unique name that's set in Zero Editor.
References:
https://github.com/marth8880/SWBF2-Lua- ... clua#L1443
Re: KillObject() on CommandArmedAnimatedBuilding possible?
Posted: Wed Sep 06, 2017 5:27 am
by Dasher
I know, this is how I set up my LUA
It only kills the object when I change the ClassLabel to "ArmedBuilding", but then the weapon effect that is displayed when the shield's turning off doesn't work
Re: KillObject() on CommandArmedAnimatedBuilding possible?
Posted: Wed Sep 06, 2017 6:28 pm
by Marth8880
Re: KillObject() on CommandArmedAnimatedBuilding possible?
Posted: Thu Sep 07, 2017 8:23 am
by Dasher
I'm trying to set up a shield that is switched on/off depending on the team controlling a certain CP. The problem is that the turn on animation/effect works fine, but when the object is killed via player or LUA (provided it's class label is "ArmedBuilding") there is no turn off animation/effect, the shield simply disappears, the object is still on the map though with it's current health on 0.
Re: KillObject() on CommandArmedAnimatedBuilding possible?
Posted: Fri Sep 08, 2017 1:57 pm
by Marth8880
Re: KillObject() on CommandArmedAnimatedBuilding possible?
Posted: Mon Sep 11, 2017 10:00 am
by Dasher
The object is simply a cube, which has the "CommandAnimatedArmedBuilding" ClassLabel, it has a weapon which is the fambaa shield, so we're not talking about a solid object type of shield, but about an actual weapon. So in other words it is a fambaa with deployable shield, my bad should of clarified that:
The object ODF:
the weapon ODF:
So again the issue is this:
Class Label: ArmedBuilding | CommandArmedAnimatedBuilding
PlaysEffect: only on turn on | on turn on and turn off
CanBeKilledviaLUA: yes | no
EDIT:
So I finally got it working the "CommandArmedAnimatedBuilding" class isn't broken, it can be killed via KillObject and respawned via CreateEntity