Change object's team through LUA [Solved]
Posted: Sun Jan 02, 2011 8:08 pm
Search returned few relavent topics so....
Here's the situation:
I have an object that I want to switch between team 1 and team 2. I want this to occur based on the destruction of a nearby panel. If a member of Team 1 destroys the panel than the object should change to team 1. If a member of team 2 destroys the panel than the object should change to team 2.
Is this possible through LUA? If so, where does the code go? I want to solve this mainly by myself but a few tips (like functions to enter) would be great.
I found these, but since I'm not familiar with LUA syntax, I don't know how to implement them:
GetCharacterTeam
GetTeamMember
SetObjectTeam
EDIT: These lines from the dea1c_con LUA look helpful:
OnObjectRespawnName(PlayAnimExtend, "Panel-Chasm");
OnObjectKillName(PlayAnimRetract, "Panel-Chasm");
If I'm right, then OnObjectKillName(SetProperty("bridgeturret_1", Team, 1), "bridgeconsole1")
would set bridge turret #1 to team 1 on the destruction of bridgeconsole 1.
But, how to make this change depend on the team of the killer?
I think it would be easy if I knew how the syntax.
Here's the situation:
I have an object that I want to switch between team 1 and team 2. I want this to occur based on the destruction of a nearby panel. If a member of Team 1 destroys the panel than the object should change to team 1. If a member of team 2 destroys the panel than the object should change to team 2.
Is this possible through LUA? If so, where does the code go? I want to solve this mainly by myself but a few tips (like functions to enter) would be great.
I found these, but since I'm not familiar with LUA syntax, I don't know how to implement them:
GetCharacterTeam
GetTeamMember
SetObjectTeam
EDIT: These lines from the dea1c_con LUA look helpful:
OnObjectRespawnName(PlayAnimExtend, "Panel-Chasm");
OnObjectKillName(PlayAnimRetract, "Panel-Chasm");
If I'm right, then OnObjectKillName(SetProperty("bridgeturret_1", Team, 1), "bridgeconsole1")
would set bridge turret #1 to team 1 on the destruction of bridgeconsole 1.
But, how to make this change depend on the team of the killer?
I think it would be easy if I knew how the syntax.