ok two lua questions
1 Is there a way for me to make a weapon that when it is deployed all of the AIs on my team will try to go to it? ie: I am about to die behind a wall with droids coming i drop the becon clones rush to the spot. Is a weapon like this possable i have been looking at CTF luas to see if i could dispense a "flag" like thing but I am not having luck with it.
2 How do i get ai to only follow a specific unit like when i am princess leia or the AI hero leia is on the battlefield all of the rebels follow her but not just me?
Get AIs to becon? + AI follow specific unit?
Moderator: Moderators
- skelltor
- Sith

- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Get AIs to becon? + AI follow specific unit?
2 i think we had this before,but it looks like nobody answered your question. according to this quote
however you could check units for their class with the second command, if its the one you want, you get their index with the first command and put that as parameter in the goal.
1 could be done with the defend-aigoal activated on dispensing/spawning the beacon
the unitindex is different from the class, maybe its a some kind of hash only understandable for battlefront.Battlefront2_scripting_system.doc wrote:CharacterChangeClass: function (player)
This event occurs whenever the player presses the OK button in the spawn display. It is not intended to be a robust thing that can be used in either multiplayer or to check when the AI change classes. If you need to get the player’s class, use GetCharacterClass(player), which will return a class index. If you need the class name, you can use GetEntityClassName(GetCharacterUnit(player))
however you could check units for their class with the second command, if its the one you want, you get their index with the first command and put that as parameter in the goal.
1 could be done with the defend-aigoal activated on dispensing/spawning the beacon
- skelltor
- Sith

- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Re: Get AIs to becon? + AI follow specific unit?
1 so it would effect all units with that class?
2 ok so where do i find the defend goal?
2 ok so where do i find the defend goal?
- jangoisbaddest
- Lieutenant General

- Posts: 661
- Joined: Mon Feb 27, 2006 12:10 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: All Along The Watchtower
Re: Get AIs to becon? + AI follow specific unit?
You might also want to do a spawning weapon. soemN00b, Archer01 and I developed code (well, Archer01 did most of the code, noob and I just helped him brainstorm and such) to spawn people from team 3 (allied with you) to your location when used. This has the added benefit of not having to wait for (potentially) several seconds for aid to come. It also doesn't disrupt the rest of the battle at all. It just provides a momentary advantage to your team (and you).
Anyway, search the forums for "AI spawning troops" or something along those lines. If you don't find it, i'll be happy to do what I can to help you (I have successfully implemented this).
Anyway, search the forums for "AI spawning troops" or something along those lines. If you don't find it, i'll be happy to do what I can to help you (I have successfully implemented this).
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Get AIs to becon? + AI follow specific unit?
i think the topic is linked in the everythingyouneedthread
- skelltor
- Sith

- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Re: Get AIs to becon? + AI follow specific unit?
i would actualy prefer the other way because troops suddenly appearing is not vary realistic and the other way you have to think how importent your rescue really is.jangoisbaddest wrote:You might also want to do a spawning weapon. soemN00b, Archer01 and I developed code (well, Archer01 did most of the code, noob and I just helped him brainstorm and such) to spawn people from team 3 (allied with you) to your location when used. This has the added benefit of not having to wait for (potentially) several seconds for aid to come. It also doesn't disrupt the rest of the battle at all. It just provides a momentary advantage to your team (and you).
Anyway, search the forums for "AI spawning troops" or something along those lines. If you don't find it, i'll be happy to do what I can to help you (I have successfully implemented this).
