Jump to content
Sign in to follow this  
tyrspawn

Infiltration by truck

Recommended Posts

I have a truck. I want the players to be able to go into it and effectively not be detected as being OPFOR, so they will not be fired upon by BLUFOR, and equally important will not execute the trigger which goes off when OPFOR enter it.

Any ideas?

Share this post


Link to post
Share on other sites

this setcaptive=true on all units and a trigger that sets that to =false when they enter the objects. You need to figure out a way so the players don't kill the guards just standing there before they enter the complex.

Share this post


Link to post
Share on other sites

Couldn't you have it so when players enter the vehicles, they are set captive, and when they exit, captive is removed.

Anyone willing to script that for me? You'd be cited in the credits! ^_^

Share this post


Link to post
Share on other sites

you could set a trigger around the vehicle so that when an OPFOR enters the trigger area, certain player names are set as captives. You have to give each of your players names and then in the ACTIVATION line of the trigger put in:

{_x setcaptive true} foreach [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10]

the P1-P10 are just the names I use to name my playable people. Change it to whatever you use.

I don't know about how the cargo check works, but if they are going to a distinct location, simply make another trigger big enough that they will enter before they get out and put:

{_x setcaptive false} foreach [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10]

in the trigger's ACTIVATION line

basically it's just 2 trigger areas and once they enter them, it sets the variable for every player no matter who enters it first:D

that help you out any?

Share this post


Link to post
Share on other sites

Found it.

This is a trigger, I guess you can do the math. Works on the same way as keimosabe I suppose, but you are using "player" instead of units name.

EDIT: Tested in ArmA2. This trigger needs no marked area. The russian truck is named: "rusTruck" without the quotes.

class Item2
	{
		position[]={7052.8867,293.98999,7681.082};
		a=0;
		b=0;
		repeating=1;
		interruptable=1;
		type="SWITCH";
		age="UNKNOWN";
		expCond="player in (crew rusTruck)";
		expActiv="player setCaptive true";
		expDesactiv="player setCaptive false";
		class Effects
		{
		};
	};

Edited by Rawhide

Share this post


Link to post
Share on other sites

hey rawhide.... excellent find man. I was wondering if in that trigger, where you have "crew" could you also put in a "cargo" line for the people in the back as well?

and for the players getting out the line:

expCond="player in (crew rusTruck)";

would you change that to read "player out" in conjunction with setcaptive=FALSE to put them back to BLUFOR?

I'll try it and see but I wondered if anyone knew up front that it worked like that.

thanks in advance guys:yay:

Share this post


Link to post
Share on other sites

crew returns cargo as well.

The "thing in another thing" thing construct is used to check whether or not the thing is contained within an array (another thing). It doesn't directly have anything to do with a unit being inside of a vehicle or not.

That is, crew rusTruck returns an array of all units that are the crew of the unit named rusTruck. Then it checks if the player object is part of that list.

For this particular problem, I would use an event handler. You can attach event handlers to objects and have them run script for you when particular events occur, such as a unit getting in or getting out of a vehicle. In this manner, all you need to do is attach a "get in" event handler to the truck that makes whoever just got in setCaptive=true, and a "get out" event handler which does setCaptive=false. This (to me) is a bit simpler, and also should perform better since it's not having to continually check who is or isn't inside the truck.

I'm not actually sure whether you need to make the people inside the vehicle captive though; I have a feeling the AI will only consider whether the vehicle itself is captive.

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  

×