Get AIs to becon? + AI follow specific unit?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Get AIs to becon? + AI follow specific unit?

Post by skelltor »

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?
User avatar
DarthD.U.C.K.
Master of the Force
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?

Post by DarthD.U.C.K. »

2 i think we had this before,but it looks like nobody answered your question. according to this quote
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))
the unitindex is different from the class, maybe its a some kind of hash only understandable for battlefront.
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
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Get AIs to becon? + AI follow specific unit?

Post by skelltor »

1 so it would effect all units with that class?
2 ok so where do i find the defend goal?
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Re: Get AIs to becon? + AI follow specific unit?

Post by jangoisbaddest »

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).
User avatar
DarthD.U.C.K.
Master of the Force
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?

Post by DarthD.U.C.K. »

i think the topic is linked in the everythingyouneedthread
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: Get AIs to becon? + AI follow specific unit?

Post by skelltor »

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).
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.
Post Reply