Page 1 of 1
Get AIs to becon? + AI follow specific unit?
Posted: Sat Oct 16, 2010 5:02 pm
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?
Re: Get AIs to becon? + AI follow specific unit?
Posted: Sat Oct 16, 2010 5:50 pm
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
Re: Get AIs to becon? + AI follow specific unit?
Posted: Sat Oct 16, 2010 6:56 pm
by skelltor
1 so it would effect all units with that class?
2 ok so where do i find the defend goal?
Re: Get AIs to becon? + AI follow specific unit?
Posted: Sun Oct 17, 2010 12:09 pm
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).
Re: Get AIs to becon? + AI follow specific unit?
Posted: Sun Oct 17, 2010 1:09 pm
by DarthD.U.C.K.
i think the topic is linked in the everythingyouneedthread
Re: Get AIs to becon? + AI follow specific unit?
Posted: Sun Oct 17, 2010 1:47 pm
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.