Jump to content
Tejkr

Check if car is in trigger area

Recommended Posts

I want to check, if a vehicle enters area (I will drive it and park it there and when the car is inside trigger, it will be true and switch the objective)... I've tried car in thislist, the car is named car, but it won't fire anyway...

I had idea of something like "player in car AND player in thislist" but I think there must be easier way to check for object inside the trigger, isn't there?

Share this post


Link to post
Share on other sites
vehicle player in thislist
!(vehicle player isKindOf "Man") && vehicle player in thislist
varName in thislist

Any of these? If you have more than one then you can use forEach / count command.

Share this post


Link to post
Share on other sites

My mistake, it was activated by no one, it detects the vehicle, when I changed the activation by blufor. I thought it isn't needed for a car check.

Share this post


Link to post
Share on other sites
17 minutes ago, Tejkr said:

My mistake, it was activated by no one, it detects the vehicle, when I changed the activation by blufor. I thought it isn't needed for a car check.

Vehicles always will take the side of its occupants, otherwise enemy wouldn't fire at thrm, since editor placed empty vehicles count as civilian side.

 

Cheers

Share this post


Link to post
Share on other sites
5 hours ago, Grumpy Old Man said:

Vehicles always will take the side of its occupants, otherwise enemy wouldn't fire at thrm, since editor placed empty vehicles count as civilian side.

 

Cheers

https://community.bistudio.com/wiki/BIS_fnc_objectSide

Can return the 'country of manufacture', ignoring the side of it's occupants.

Share this post


Link to post
Share on other sites
43 minutes ago, Tankbuster said:

https://community.bistudio.com/wiki/BIS_fnc_objectSide

Can return the 'country of manufacture', ignoring the side of it's occupants.

Would be neat if AI in arma actually worked that way.

I mean seeing an MRAP of the opposing faction in the distance, with my trusty AT launcher on the back, I'd sure as heck not hesitate to blow it up, no matter if it's occupied or empty.

 

Cheers

Share this post


Link to post
Share on other sites
21 minutes ago, Grumpy Old Man said:

Would be neat if AI in arma actually worked that way.

I mean seeing an MRAP of the opposing faction in the distance, with my trusty AT launcher on the back, I'd sure as heck not hesitate to blow it up, no matter if it's occupied or empty.

 

Cheers

Oh yes, it's frustrating them knowing from a distance of 1km+ that you and your NATO hommies have nicked the Ifrit you are currently in. I reported it as an issue back in 2008 - odd that they never picked it up.

  • Haha 2

Share this post


Link to post
Share on other sites
1 minute ago, Tankbuster said:

Oh yes, it's frustrating them knowing from a distance of 1km+ that you and your NATO hommies have nicked the Ifrit you are currently in. I reported it as an issue back in 2008 - odd that they never picked it up.

Would be a nice change gameplay wise, just imagine your average coop game, with some NATO folks capturing a Varsuk and heading back to the FOB without communicating an incoming friendly varsuk to the rest of the team.

Even something as simple as a quick sitrep to your side (radio menu 5-5) would do the trick to reveal to friendly AI of the captured varsuk.

Now it's just odd.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
6 hours ago, Tankbuster said:

Oh yes, it's frustrating them knowing from a distance of 1km+ that you and your NATO hommies have nicked the Ifrit you are currently in. I reported it as an issue back in 2008 - odd that they never picked it up.

Are you feeling okay @Tankbuster? This is Bohemia Interactive + ArmA. :rofl:

  • Haha 1

Share this post


Link to post
Share on other sites

This is little off this topic, but what if I want to pick from a random radio masseges? I have this:

this addEventHandler ["hitPart", {_randomElement = selectRandom [player sideChat "Good",player sideChat "Nice"]}];

It sends both messages at the same time. I'm just trying, can't script obviously, but what's wrong please?

 

 

Share this post


Link to post
Share on other sites
1 hour ago, Tejkr said:

This is little off this topic, but what if I want to pick from a random radio masseges? I have this:

this addEventHandler ["hitPart", {_randomElement = selectRandom [player sideChat "Good",player sideChat "Nice"]}];

It sends both messages at the same time. I'm just trying, can't script obviously, but what's wrong please?

 

 

You're trying to randomize code, which doesn't work the way you're using it.

To randomize code you need something like this using strings and call compile:

 

_randomElement = selectRandom ["player sideChat 'Good'","player sideChat 'Nice'"];
call compile _randomElement;

 

or brackets and call:

_randomElement = selectRandom [{player sideChat "Good"},{player sideChat "Nice"}]; 
call _randomElement;

 

However this is a perfect example to always re-evaluate what you want to do, what to randomize and which elements will stay the same.

Player won't change, sideChat won't change, but the text should be randomized.

So it boils down to this:

_randomComment = selectRandom ["Nice","Good"];
player sideChat _randomComment;

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
On 3/24/2018 at 9:34 AM, Grumpy Old Man said:

Would be neat if AI in arma actually worked that way.

I mean seeing an MRAP of the opposing faction in the distance, with my trusty AT launcher on the back, I'd sure as heck not hesitate to blow it up, no matter if it's occupied or empty.

 

Cheers

Hmmm, this has me thinking now.  I have seen this done before.  

Not sure how they did it but you could try...

 

getin eventhandler to check if in enemy vehicle and 

SETCAPTIVE 1 so ai will not shoot him.

or enemyDetected eventhandler to trigger check if he is in friendly vehicle or wearing friendly unitform and setcaptive 1 if true

then run checks using KnowsAboutChanged and when knowsabout > 2.5 or 4 etc. SETCAPTIVE 0 to make them fire at him.

getout eventhandler could setcaptive 0 also.

 

KnowsAboutChanged

_group addEventHandler ["KnowsAboutChanged", { params ["_group", "_targetUnit", "_newKnowsAbout", "_oldKnowsAbout"]; }];

 

EnemyDetected

_group addEventHandler ["EnemyDetected", { params ["_group", "_newTarget"]; }];

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

×