Command Post-linked Autoturrets? [Solved]
Moderator: Moderators
-
- Private Recruit
- Posts: 18
- Joined: Mon Jan 28, 2019 10:08 am
- Projects :: Thyferra
- xbox live or psn: No gamertag set
Command Post-linked Autoturrets? [Solved]
I want a group of named autoturrets on my map to switch owners to whatever team controls a specific command post. So if team 2 captures this command post (cp1), I want these autoturrets to switch owners from team 1 to team 2. It would only need to cycle between teams 1 and 2— it wouldn't really matter to me if they switched to 0 when the post became neutral. I'm wondering if this is possible, and if so, what I would need to do to accomplish this. The "linked turrets" lua file seems to be close to what I'm looking for, but not exactly what I need, as it does change the teams of autoturrets, but the triggers are a named object being destroyed or repaired. Any information is appreciated.
Last edited by BarbylBapkins on Fri May 21, 2021 10:00 pm, edited 2 times in total.
- Benoz
- Corporal
- Posts: 142
- Joined: Tue May 28, 2013 12:34 pm
- Projects :: Clone Wars Era Mod Version 2
- xbox live or psn: No gamertag set
- Location: Germany
Re: Command Post-linked Autoturrets?
You can change the team of the autoturret according to the designated CP via Lua:
Put this piece of code under ScriptPostLoad(). Remember to give your turrets a unique label in Zero Editor.
I haven't tested it out myself, it's a code snipet of linksith, but it should work.
Code: Select all
OnTeamChange(function(object)
if GetEntityName(object) == "autoturretCP" then
SetObjectTeam("autoturretLabel1",GetObjectTeam("autoturretCP"))
end
end)
I haven't tested it out myself, it's a code snipet of linksith, but it should work.
-
- Private Recruit
- Posts: 18
- Joined: Mon Jan 28, 2019 10:08 am
- Projects :: Thyferra
- xbox live or psn: No gamertag set
Re: Command Post-linked Autoturrets?
Sorry for the late reply, but thanks! This is just what I needed.