Jump to content
Sign in to follow this  
evilnate

Ai to passdown revealed unit location?

Recommended Posts

I am having a hard time doing something for my MP coop mission. I have RACS friendly to OPFOR so that the civilians will be hostile to BLUFOR. I also have a large BLUFOR detected by Civilian trigger sync'd to my OPFOR pilot waiting to jump in his Ka50 and seek and destroy the whole island.

After some testing it seems that the pilot never finds or even flies over the BLUFOR the civilian detected. I understand that if I give all the civs SENTRY waypoints and sync them with the pilots GUARD waypoint my desired effect will work. I can't do this though because there are a BUNCH of civs and I would rather use the detected by trigger. This makes it so that the pilot starts his engines only after someone has been detected.

My question is.. How can/should I have the civilian that spots the BLUFOR give that information to the OPFOR pilot so he is more likely to punish the player that got spotted?

Desired effect: Civilian detects a blufor unit, crossroad tells the blufor that they have been detected and to expect company. The opfor group or unit knows where the blufor unit is and mobilizes to the blufor position for the kill, if the blufor unit is gone the response unit hunts for the blufor unit or returns to base and waits for the next detection. Any help with this would be wonderful.

Share this post


Link to post
Share on other sites

I think i've waited long enough to bump this thread.

Maybe the question is too hard to comprehend? Let's try it this way.

I have a large blufor_detected_by_opfor trigger that covers south sahrani. I have that trigger sync'd to a pilots' move waypoint before he enters his Ka-50. When a opfor detects the presense of a blufor, I want the Ka-50 pilot to know his position (like using the Reveal command).

The problem I have is this. How do I make a script that captures the precise unit that was detected by the trigger and make that entity whe one who is reavealed to the deadly ka-50 pilot? Event handler some how?? I would seriously appreciate some help here, I have a feeling that it's possible.

help.gif

P.S. This is for a MP coop mission template.

Share this post


Link to post
Share on other sites

Its not hard to do this.

give the trigger a name and in the onactivation field put

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[triggername] exec "detected.sqs

in the sqs put:

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

_trigger = _this select 0

_list = list _trigger

_target = _list select 0

the _target should be the culprit or the one who was detected.

So you can add code there where you want and add variables to the trigger onactivation such as the helicopter or other things

eg: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[triggername,heliname] exec "detected.sqs

then you could just give the heliname a domove command in the script to get it to the position. I see this replaces your waypoint synchronization but at least it gets you going. You could probaly move the choppers waypoint to the targets position in the script. Im not sure since I just use domove command instead of static waypoints.

You might want to reference just the position of this unit instead of the actual unit because then the heli will just have a position to check and the unit will have a chance to escape if they are smart. But thats up to you.

Also you may want to make a smaller detected by trigger and make another script that loops and just positions itself on the patrolling unit. That way you have a smaller trigger and it may be better for performance. But thats up to you.

Let me know if it doesnt work for some reason.

Share this post


Link to post
Share on other sites

Another option would be to in conjunction with the above have a gamelogic go to the units position using that script and have the Ka50s move waypoint on it. I think that should work.

Share this post


Link to post
Share on other sites

Well, after even more testing revealing a solder to a Ka-50 doesn't mean that the Ka-50 will engage the solder. I think I will just have the Ka-50 start random patrols once the BLUFOR are detected by OPFOR. It seems like the AI choppers will only automatically fire upon threats they would see in their radar (i.e. tanks, trucks, etc)

However on another note I am planning on having the blufor_detected_by_civilian trigger cause a transport hind to go to the location that had the blufor spotted and paradrop solders. Then the solders would scour the area for any intruders. I'm not very well with scripting but I will try your suggestions to see how far I get. Thanks for the help so far, very much appreciated!

*update*

Thanks for the advice! I have something that works perfectly when I preview, I'll have to see what it's like on a dedicated server to see if it still works. Pretty sloppy but this is the largest sqs file i've put together so far.

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

;; Reinforcements that respond to detected_by_trigger

;; position information and deploy paratroops that patrol with kronzky's UPS

;; [trigger,aircraft,#of meters before drop, Helipadname. para group name]

?(!isServer) : exit

~.1

_trigger = _this select 0

_calvary = _this select 1

_range = _this select 2

_home = _this select 3

_troops = _this select 4

_list = list _trigger

_target = _list select 0

_calvary doMove (position _target)

#cycle

?(getdammage _calvary >= .7):goto "eject"

?(_target distance _calvary < _range):goto "eject"

~3

goto "cycle"

#eject

{_x action ["eject",_calvary]} forEach units _troops

~1

{unassignVehicle _x} forEach units _troops

~1

_marker = createMarker ["hotzone", position _target ]

"hotzone" setMarkerSize [200, 200]

;; p1 is the name of the group leader

~1

nul=[p1,"hotzone"] execVM "scripts\ups-f.sqf";

~1

_calvary doMove (position _home)

exit

Share this post


Link to post
Share on other sites

One last question about this issue. Currently the position that gets reported is the position of the reporter, I would like it to pass-on the position of the reported.

For example right now when a OPFOR is detected by someone, the position that is relayed to the artillery/reinforcements is the someone that reported it. I would like the reported positon to be the BLUFOR intruder's position.

Any takers? Would appreciate the help very much.

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  

×