Jump to content
Sign in to follow this  
heinzmcdurgen

BLUFOR detected by OPFOR

Recommended Posts

So I'm making a stealth based mission.

The idea is that if BLUFOR is detected for X seconds, an alarm is sounded, which subsequently brings reinforcements.

To do this I've attempted using a trigger over the area in question with the following parameters:

Timeout: 20/20/20

Activation: BLUFOR

Repeatedly

detected by OPFOR

According to the Wiki, this should work for 2 reasons:

1. "Timeout - The trigger's conditions must be satisfied for the entirety of specified amount of time for the trigger to activate. For example, if a soldier walks into a <side> Present type trigger but leaves the area before the timeout is complete, the trigger will not activate."

2. "Detected by <side> - A unit is considered detected when the leader of any group on the detecting side can correctly identify the detected units side. Depending on the type of unit being detected, this may occur at various knowsAbout levels..."

So once the leader is dead, it should stop the Timeout, as they are no longer ID'ing the BLUFOR, because they are dead.

However, this isn't what is happening. Instead, no matter what I've seemed to do, once OPFOR begins firing at me (detected), no matter what happens after 20 seconds the trigger acts like a countdown and fires.

Does anyone know how to make this work either within the editor or via scripts?

Thanks.

Share this post


Link to post
Share on other sites

Whether you are detected or not, depends on the knowsAbout value. When you get spotted the value increases. However, if you kill the unit instantly after you've been spotted, the value will only decrease slowly, thus, the trigger's condition keeps beeing true.

I used a different, but similary approach.

[color="#FF8040"][color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color]
[color="#8B3E2F"][b]{[/b][/color]
[color="#191970"][b]if[/b][/color][color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_knowsAbout[/color] [color="#8B3E2F"][b]<[/b][/color] [color="#FF0000"]4[/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color]
[color="#8B3E2F"][b]{[/b][/color]
	[color="#1874CD"]_knowsAbout[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]east[/color] [color="#191970"][b]knowsAbout[/b][/color] [color="#000000"]player[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#1874CD"]_knowsAboutPerc[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]round[/b][/color] [color="#1874CD"]_knowsAbout[/color][color="#8B3E2F"][b]*[/b][/color][color="#FF0000"]100[/color][color="#8B3E2F"][b]/[/b][/color][color="#FF0000"]4[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#191970"][b]hintSilent[/b][/color] [color="#191970"][b]format[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Level of awareness: %1%2"[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_knowsAboutPerc[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"%"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#191970"][b]sleep[/b][/color] [color="#FF0000"]0.01[/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [/color]

Made with KK's SQF to BBCode Converter

This basically shows the player a hint with the Level of awareness of enemy units. This is important, because otherwise the player can't know if he has been detected or now. The if condition is optional, I just wanted it to end at a value of 4, since that is the maximum anyway. What you can now do is, write a script which fires a alarm if the value knowsAbout returns if greater than 2 (for example)

[color="#FF8040"][color="#8B3E2F"][b]{[/b][/color]
[color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]side[/b][/color] [color="#000000"]_x[/color] [color="#8B3E2F"][b]=[/b][/color][color="#8B3E2F"][b]=[/b][/color] [color="#000000"]east[/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color]
[color="#8B3E2F"][b]{[/b][/color]
	 [color="#000000"]_x[/color] [color="#191970"][b]setBehaviour[/b][/color] [color="#7A7A7A"]"AWARE"[/color] 
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#191970"][b]forEach[/b][/color] [color="#191970"][b]allUnits[/b][/color][color="#8B3E2F"][b];[/b][/color]

[color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] 
[color="#8B3E2F"][b]{[/b][/color]
[color="#8B3E2F"][b]{[/b][/color][color="#000000"]_x[/color] [color="#191970"][b]say3D[/b][/color] [color="#7A7A7A"]"Alarm"[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color]speaker1[color="#8B3E2F"][b],[/b][/color]speaker2[color="#8B3E2F"][b],[/b][/color]speaker3[color="#8B3E2F"][b],[/b][/color]speaker4[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#191970"][b]sleep[/b][/color] [color="#FF0000"]3[/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[/color]

Made with KK's SQF to BBCode Converter

This is my alarm script. This script will play some sound from 4 speakers when the player has been detected.

In addition, you can add some flares if you want to.

[color="#FF8040"][color="#1874CD"]_flarePos1[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]speaker1[color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]random[/b][/color] [color="#FF0000"]100[/color][color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]random[/b][/color] [color="#FF0000"]360[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_relPos[color="#8B3E2F"][b];[/b][/color]
[color="#1874CD"]_flarePos2[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]speaker2[color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]random[/b][/color] [color="#FF0000"]100[/color][color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]random[/b][/color] [color="#FF0000"]360[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_relPos[color="#8B3E2F"][b];[/b][/color]
[color="#1874CD"]_flarePos3[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]speaker3[color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]random[/b][/color] [color="#FF0000"]100[/color][color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]random[/b][/color] [color="#FF0000"]360[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_relPos[color="#8B3E2F"][b];[/b][/color]
[color="#1874CD"]_flarePos4[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]speaker4[color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]random[/b][/color] [color="#FF0000"]100[/color][color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]random[/b][/color] [color="#FF0000"]360[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_relPos[color="#8B3E2F"][b];[/b][/color]


[color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] 
[color="#8B3E2F"][b]{[/b][/color]
[color="#1874CD"]_flare1[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"F_20mm_Red"[/color][color="#8B3E2F"][b],[/b][/color] [color="#1874CD"]_flarePos1[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"NONE"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]   
[color="#1874CD"]_flare2[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"F_20mm_Red"[/color][color="#8B3E2F"][b],[/b][/color] [color="#1874CD"]_flarePos2[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"NONE"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] 
[color="#1874CD"]_flare3[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"F_20mm_Red"[/color][color="#8B3E2F"][b],[/b][/color] [color="#1874CD"]_flarePos3[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"NONE"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] 
[color="#1874CD"]_flare4[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"F_20mm_Red"[/color][color="#8B3E2F"][b],[/b][/color] [color="#1874CD"]_flarePos4[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"NONE"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] 

[color="#8B3E2F"][b]{[/b][/color][color="#000000"]_x[/color] [color="#191970"][b]setPosATL[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#191970"][b]getPosATL[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]getPosATL[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]150[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]random[/b][/color] [color="#FF0000"]75[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_flare1[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_flare2[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_flare3[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_flare4[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]   
[color="#8B3E2F"][b]{[/b][/color][color="#000000"]_x[/color] [color="#191970"][b]setVelocity[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]-0.01[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_flare1[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_flare2[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_flare3[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_flare4[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]  
[color="#191970"][b]sleep[/b][/color] [color="#FF0000"]20[/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

All in all, it's a different approach, but it just works splendit, if you figure out what knowsAbout value is reasonable.

I hope some guys with more scripting experience will post here, since I'm also quite curious to see other solutions for stealth missions.

Edited by R3vo

Share this post


Link to post
Share on other sites

_knowsAbout = east knowsAbout player;

How use this in a dedicated server?

If a target spot west side units then alarm ?

Share this post


Link to post
Share on other sites
_knowsAbout = east knowsAbout player;

How use this in a dedicated server?

If a target spot west side units then alarm ?

At mission beginning this value is equal to 0.

[color="#FF8040"][color="#1874CD"]_knowsAbout[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]east[/color] [color="#191970"][b]knowsAbout[/b][/color] [color="#000000"]player[/color] [color="#006400"][i]//returns 0[/i][/color][/color]

Made with KK's SQF to BBCode Converter

If the enemy spots you, this value increases. That depends on the time of day, viewdistance etc.

You simply have to write a script which executes if the value reaches a specific value.

For example:

[color="#FF8040"][color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_knowsAbout[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]=[/b][/color] [color="#FF0000"]2[/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color]
[color="#8B3E2F"][b]{[/b][/color]
    [color="#191970"][b]playSound[/b][/color] [color="#7A7A7A"]"alarm"[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// or something else[/i][/color]
[color="#8B3E2F"][b]}[/b][/color][/color]

Made with KK's SQF to BBCode Converter

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  

×