Jump to content
Sign in to follow this  
Eclipse4349

Respawned AI loses its name and so no longer enters vehicles... Help!

Recommended Posts

I am still working on a CTF mission with respawning vehicles in it. I have learned a ton in the past week working on it. The way I have it set up now is:

I use a trigger for each unit group to detect that group's presence at base, by grouping the trigger to the unit group and setting the trigger to "whole group". This trigger is synced to a waypoint near the vehicle, so they will not move on to the waypoint after that one without the group being intact.

I have another trigger set to detect anything, and is sized and placed directly over an empty vehicle.

A third trigger is fired when the unit group presence trigger and vehicle presence trigger are both true, which orders the units into the associated vehicle, using this code:

Soldier1 assignasdriver V1; Soldier2 assignasgunner V1; Soldier3 assignascommanderV1; this ordergetin true;

This has the intended effect of having all my unit groups moving to their vehicle and getting in, then moving on to their subsequent waypoints at the start of the game. I use a script supplied by Tajin that respawns the vehicle while keeping the vehicle's name.

However, when a vehicle and crew are destroyed, the vehicle respawns, the group members that had been in the vehicle respawn as they die, and once all members of the squad have respawned, they move out to their waypoint, although without getting into the vehicle this time. Which leads me to believe that the units are no longer named, and, since my method of ordering them into the vehicles calls them by name, they never get the order to do so, even though the group presence and vehicle presence triggers are both fired.

So, I need a way to keep respawned units named the same as the original unit, OR a way to order them into the vehicles without using a unit name. I have tried playing around with thislist, assignvehicle, allowgetin, using a "get in" waypoint placed on the empty vehicle, and some other things I can't remember, and have been searching the forums, but I can't find a way. I am assuming putting a "get in" waypoint isnt working because the vehicles are "empty" and not part of the group or on the same side (blufor or opfor). Is there a way to spawn an empty Blufor vehicle that COULD be group together with a unit group so that the "get in" waypoint would work? As it is now, the units just ignore the "get in" waypoint and move on to the next one.

I also don't know how to write a script to handle naming the respawned units the same as their original name, like Tajin did with his awesome vehicle respawn script. Help?

Edited by Eclipse4349

Share this post


Link to post
Share on other sites

replace this:

Soldier1 assignasdriver V1; Soldier2 assignasgunner V1; Soldier3 assignascommanderV1; this ordergetin true;

with this:

(list triggername select 0) assignAsDriver V1;(list triggername select 1) assignAsGunner V1;(list triggername select 2) assignAsCommander V1;list triggername ordergetin true;

triggername would be the name of the trigger that detects the group presence

Share this post


Link to post
Share on other sites

Wow... so simple.... So, I would assume then I could conceivably extend this to any number of units, and if I had more units listed as "select_" than existed in the trigger area at the time the trigger was firing that it would still work, while ignoring the "extra" listed units in the line of code?

You have no idea how grateful I am for that. I spent HOURS looking through the command list and these forums trying to put together another approach. I owe you a beer or three!

Share this post


Link to post
Share on other sites
it would still work, while ignoring the "extra" listed units in the line of code?
That depends on in which order the units are listed in the trigger.

Can't tell you.

I owe you a beer or three!

Does that include a trip to the states or will you send them by mail ? :D

Edited by Tajin

Share this post


Link to post
Share on other sites

I will let you know whether I win the lottery today and can fly you over. In the off chance that I do not win millions, what brand would you prefer I send? haha

Share this post


Link to post
Share on other sites

Guiness should be ok.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×