Jump to content
Sign in to follow this  
smoke52

empty object as target

Recommended Posts

i have two questions

im making a mission where you laser designate some tanks and buildings to blow up. i figured out how to make the buildings objectives, but how can i make it so the empty tanks are objectives? do i have to give them each a name and check if they are alive with a script or something?

when one or two tanks get blown up i want to set off an alarm and have some infantry run up, climb in the tanks, and try to take off.

how can i pull this off?

2. i spawn with a trigger a team of guys and a vehicle but the guys walk away from the area, i want to keep them in a radius of about 20, im trying to create a waypoint with a radius of 20 but im having trouble making the waypoints position, heres the script im using:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

uaz = "UAZMG" createVehicle (position _boat);

"SoldierESaboteurBizon" createunit [position uaz, group guard1, "this moveingunner uaz, uaz dowatch markerpos _direction"];

"SoldierESaboteur" createunit [position _boat, group guard1];

"SoldierESaboteur" createunit [position _boat, group guard1];

"SoldierESaboteurBizon" createunit [position _boat, group guard1];

"SoldierESaboteur" createunit [position _boat, group guard1];

guard1 addWaypoint [position "pbxboat", 15];

i think its the "guard1" thats giving me the error, its saying its giving an object not group.

yes im a newb at scripting so if theres a better way to create some guys with one in the gunner seat of the jeep please tell me smile_o.gif

thanks!

Share this post


Link to post
Share on other sites

Well first Id remove the waypoint if you can cause there seems to be a bug at the moment with AI wondering from waypoints. If you remove it they will stand right where they were created. If you need the waypoint try using the "stop true" command and set it false when you want them to move.

You would be better off using the "DoMove" command if you are scripting the whole thing anyway. Just set an empty marker and make them goto that. For that matter you could spawn them at the same marker.

Next: When you add a waypoint, you add it to the group leader not the group. Remove the group name and use the GLs name.

Next: To set any vehicle or unit as an objective you need to use 1 of many ways to set that.

You could group a trigger to the unit and set it to vehicle not present. And in the on activation field put: "1" objstatus "DONE"

Just inrease the # ("1") to 2, 3 etc for each objective.

You can also do the same thing with buildings.

This will update the objective in the briefing. If this is what

you mean.

To set off an alarm go into the effects tab of the trigger used for the tank not present and set an alarm.

Share this post


Link to post
Share on other sites

thanks for the help, but the AI is moving because theres a "guarded by" trigger nearby. thats why im trying to put the waypoint but its giving me an error from this line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

guard1 addWaypoint [position "pbxboat", 15];

i changed it to

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

uaz = "UAZMG" createVehicle (position _boat);

boatguard1 = "SoldierESaboteurBizon" createunit [position uaz, group guard1, "this moveingunner uaz, uaz dowatch markerpos _direction"];

"SoldierESaboteur" createunit [position _boat, group guard1];

"SoldierESaboteur" createunit [position _boat, group guard1];

"SoldierESaboteurBizon" createunit [position _boat, group guard1];

boatguard1 addwaypoint [position _boat, 15];

goto "end"

and the script works but the three guys still walk away and only the jeep stays. i want them to stay close to the the squad leader.

what im trying to do is have it so the player is inserted by boat, when he returns to extract theres a squad of 3 guys and a UAZ with a gunner sitting by the boat, so the player has to go to a different extraction zone or risk fighting them. can anyone write a better script for me...please? smile_o.gif

im trying the domove command but i cant figure what to put (im about to go to sleep though)....ill try the disable ai thing tomorrow too.

question 2. as for the vehicle trigger is there anyway to group 8 empty tanks and 2 empty shilkas or do i have to make a trigger for each one? the player is targeting 10 armored vehicles that are emtpy, until the alarm is set off then ill have some guys jump in the tank and try to take off, but how do i make it so when the player kills the 10 armored vehicles his objective is done?

maybe with some count script? if so how would i do that?

thanks again!

Share this post


Link to post
Share on other sites

Use the stop true command for the AI and use a trigger for west present to set it false.

And the armor Id set a trigger and a publicvariable for each piece and then 1 trigger that checks all the variables to complete the objectives.

Share this post


Link to post
Share on other sites

1. ok im using this as the script and it works nicely!

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_specops = createGroup east;

_uaz = createVehicle ["UAZMG", (position pbxboat), [], 0, "NONE"];

_spec1 = _specops createUnit ["SoldierESaboteurBizon", (position pbxboat), [] ,0 ,"seargent"];

_spec1 setDir random 360;

_specops selectLeader _spec1;

_spec1 disableAI "MOVE";

_spec1 allowfleeing 0;

_spec1 setBehaviour "AWARE";

_spec2 = _specops createUnit ["SoldierESaboteurBizon", (position pbxboat), [] ,0 ,"private"];

_spec2 setDir random 360;

_spec2 disableAI "MOVE";

_spec2 allowfleeing 0;

_spec2 setBehaviour "AWARE";

_spec3 = _specops createUnit ["SoldierESaboteur", (position pbxboat), [] ,0 ,"private"];

_spec3 setDir random 360;

_spec3 disableAI "MOVE";

_spec3 allowfleeing 0;

_spec3 setBehaviour "AWARE";

_spec4 = _specops createUnit ["SoldierESaboteur", (position pbxboat), [] ,0 ,"private"];

_spec4 MoveInGunner _UAZ;

_spec4 setDir random 360;

_spec4 disableAI "MOVE";

_spec4 allowfleeing 0;

_spec4 setBehaviour "AWARE";

_spec5 = _specops createUnit ["SoldierESaboteur", (position pbxboat), [] ,0 ,"private"];

_spec5 setDir random 360;

_spec5 disableAI "MOVE";

_spec5 allowfleeing 0;

_spec5 setBehaviour "AWARE";

_spec6 = _specops createUnit ["SoldierESaboteur", (position pbxboat), [] ,0 ,"private"];

_spec6 setDir random 360;

_spec6 disableAI "MOVE";

_spec6 allowfleeing 0;

_spec6 setBehaviour "AWARE";

Share this post


Link to post
Share on other sites

well i figured the spawning out. now i need some help with the empty tanks as objectives.

can you give me any examples or point me in the right direction on what commands to use? thanks whoever helps!

Share this post


Link to post
Share on other sites

I will cover this for 1 tank and you can set the rest the same way.

Make an "init.sqs" and put it in the mission folder. In the init put:

tank1 = 0

Publicvariable "tank1"

tank2 = 0

Publicvariable "tank2"

(Copy the above and name the next tank3 etc.)

Then group the trigger to the tank, set it to not present. In the OnActivation field put:

tank1 = 1;publicvariable "tank1"

Do the same for all the triggers making sure to change the # after tank in each 1.

Then copy below to a trigger with a zero radius to the condition field (make sure you remove the word "this":

tank1 == 1 and tank2 ==1

Put this in and keep adding them till you have a variable for each piece of armor.

Then in the same trigger in the OnAct field put

"1" objectstatus "done";hint "Objective Complete"

Share this post


Link to post
Share on other sites

you rock! thanks alot OP4 thumbs-up.gif

i came across a new problem though... i have it when 1 tank blows up it sets off 6 squads of guys to try and get in the tanks then take off to a trigger area that ends the mission. i want it so if two or more tanks escape the player loses, but if the squads dont get in tanks they still run to the trigger ending the mission.

how can i make it so it will only trigger if they are in tanks?

Share this post


Link to post
Share on other sites

This is alot more complicated and is no 5 min typing job.

You need a script and a trigger to check where they are and if they are alive. I dont have time right now to write it but if noone else puts it up I will later.

Share this post


Link to post
Share on other sites

(vehicle manUnit != manUnit)

checks if a unit is in a vehicle.

Share this post


Link to post
Share on other sites

man this community is awesome biggrin_o.gif

i got helped out. all i needed was a trigger with this in the condition:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

({_x in tanklist} count thislist) >= 2

then in my init.sqs i put

thislist = [tank1, tank2, tank3, tank4, tank5, tank6, tank7, tank8, tank9, tank10]

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  

×