Jump to content
jandrews

Detected by Opfor vs Knowsabout

Recommended Posts

I would like to have a Opfor commander call in reinforcements IF blufor has been spotted by the commander. Am trying to use trigger synced to unit with Activation = Blufor once detected by Opfor and some scripts run. This is not producing the result I wanted. It seems to pop the trigger regardless.

 

Would

this && isServer && commander knowsAbout player;

in place of the above placed in condition of trigger make any difference?

Share this post


Link to post
Share on other sites

Commander Of what?

 

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

 

and it would return a number not true/false os would need to be something like

 

this && isServer && (commander something knowsAbout player) > 1

hey. just some officer named commander or something. sry for confusion.

this && isServer && (_unitname knowsAbout player) > 0

> 0 work?

 

oh. since its a trigger would radius be necessary?

Share this post


Link to post
Share on other sites

As it used detect by OPFOR I think it will need a radius and an OPFOR in the trigger area and I think unit/player can be either in or out of the radius

 

Just cheked player would need to be in the trigger area but OPFOR can be either in or out

 

 

yes >0 will work as well the range is 0-4

Share this post


Link to post
Share on other sites

knowsAbout actually comes into play at 1.5 and goes to 4 as f2k said, which is complete knowledge. After some time, it drops to half, then goes away after 110 seconds.

 

"east knowsAbout player >= 1.8" -stuff

"east knowsAbout player >= 2.3" -stuff

 

--for instance, works great as a condition for stealth missions. If you simply use "detected by" in the trigger, the AI will know about someone the second they have any information about them. Tune the knowsabout to your liking.

  • Like 2

Share this post


Link to post
Share on other sites

knowsAbout actually comes into play at 1.5 and goes to 4 as f2k said, which is complete knowledge. After some time, it drops to half, then goes away after 110 seconds.

 

"east knowsAbout player >= 1.8" -stuff

"east knowsAbout player >= 2.3" -stuff

 

--for instance, works great as a condition for stealth missions. If you simply use "detected by" in the trigger, the AI will know about someone the second they have any information about them. Tune the knowsabout to your liking.

Great..I'm just in this situation...it's a stealth coop wip mission, but there's AI as well on my team....does "knowsAbout" apply to AI as well even if the condition is "east knowsAbout player >= 1.8"? Sorry if it is a noob question... :P 

Share this post


Link to post
Share on other sites

knowsAbout actually comes into play at 1.5 and goes to 4 as f2k said, which is complete knowledge. After some time, it drops to half, then goes away after 110 seconds.

 

"east knowsAbout player >= 1.8" -stuff

"east knowsAbout player >= 2.3" -stuff

 

--for instance, works great as a condition for stealth missions. If you simply use "detected by" in the trigger, the AI will know about someone the second they have any information about them. Tune the knowsabout to your liking.

 

could you be a tab more specific?

 

I was going to use trigger as blufor detected by opfor with

condition as

this && isServer && (_unitname knowsAbout player) > 0

it seems > 0 needs to be changed. So complete knowledge is > 4? am I to assume complete knowledge is blufor presence, location and team size? this may be to complicated.

Share this post


Link to post
Share on other sites

First: why use trigger params if what you want to check is the knowsabout? Just forget about the this thing, detected by etc..

 

Second: better formulation and use of parenthesis:

 

isServer && ((_unitname knowsAbout player) > 0)

 

Not meaning your code won't do the same, but just in case...

 

Third: I asume you are using a global variable for the commander, not _unitname, as it will drop error in a trigger. You must use a global variable, and of course, not to use a reserved command name, such as, "commander"... use other, like, for example "boss".

 

Fourth: check knowsabout command in the biki. It makes a reference of result values.

 

Typically the magic number is 1.4 which represents "I know more or less where you are and I know you are an enemy", more than that represents more information, and let's say 4 is total knowledge: "I know exactly where you are, I see you. You are a BLUFOR medic, you are pointing 347,28º, you have a pistol in your hand, your wife has moustache"

 

So:

 

isServer and ((boss knowsAbout player) > 1.4) as condition in trigger will do the trick

  • Like 1

Share this post


Link to post
Share on other sites

Barbolani. Thanks for the heads up. Yes regards to commander name. Thanks again

Share this post


Link to post
Share on other sites

Hi,  guys. I am making a mission where the player must detect the target at the enemy base and when it's detected, the first task is completed. Then another one is activated - to destroy the target. The target is a tank at a distance of 1500m, which is quite a long distance, but still... how would it work? 1. I create the task to detect the target which is activated by a previous triggered condition. 2. The task is connected to another trigger with condition: player knowsabout myTarget > 3.9 with 4 seconds delay, just enough for the player to spot and detect the target. (I have tested this with a marksman against AI at about 110m.) 3. Then I put another task to destroy the target, ALTHOUGH I would normally use "set task state" here. It is connected to the previous trigger. 4. The second task is now synchronized to "set task state - succeeded". 5. The set task state module is connected to a trigger that checks if the target is dead. 6. The second task from p. 3 is connected to another module - set task destination, which is synchronized object, showing notification. 7. This last module is connected to the target itself. This way I normally must be able to 1. detect the target and COMPLETE task 1, and 2. another task is activated - to destroy the moving target. I use the detection condition for another trigger with Skip Waypoint for the target. When it's active, it skips the waypoint, and starts moving. Then the task marker automatically follows the target. I tried this with a tank at 1500m distance, which, I guess, is too far, or I am doing something else wrong. Please, help me. Cheers!

Share this post


Link to post
Share on other sites

I read that when the target is just a unit, it's easy to detect it, when you shoot at this unit. The value of detection grows up to 4. But when it is a vehicle, the commander is the one to be detected, or at least should be. Then this value drops down to 1.5 or 1.4, I am not completely sure. But may be I am somehow wrong about the numbers I use or the distance is too long. Can I use another code the same way I want to make it work? For example - detected by. This is the official page of "knowsabout" by Bohemia: https://community.bistudio.com/wiki/knowsAbout

Share this post


Link to post
Share on other sites
15 hours ago, black_hawk_mw2_87 said:

grows up to 4.

 

Hello there black_hawk_mw2_87 !

 

This is a part of my GF Missions script :

 

 

I paste the whole thing just to get a better idea and for everyone who may want to see , the complete one.

 

This code is at the bottom :

 

while {(alive _Spawned_Helicopter)} do {
	_Spawned_Helicopter flyInHeight (50 + (random 2000));
	_getPosATL = getPosATL _Spawned_Helicopter;
	_nearEntities = _getPosATL nearEntities 2000;
	{_Group_Crew reveal [_x,4];} count _nearEntities;
	sleep 50;
	};

 

Spoiler




//________________  Author : GEORGE FLOROS [GR] ___________ 16.12.18 _____________

/*
________________ GF Missions Script ________________

https://forums.bohemia.net/forums/topic/219080-gf-missions-script/

Please keep the Credits or add them to your Diary

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.
For everything that is with comment  //  in front  or between /*
means that it is disabled , so there is no need to delete the extra lines.

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

and also use the extra pluggins
(this way will be better , it will give also some certain colours to be able to detect ex. problems )
http://www.armaholic.com/page.php?id=8680

or use any other program for editing .

For the Compilation List of my GF Scripts , you can search in:
https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-scripts/
*/


/*
//________________	add this to use	________________
//________________	Helicopters_Transport_	________________
[] spawn GF_Missions_Spawn_Helicopters_Attack_Patrol;
[] spawn GF_Missions_Spawn_Helicopters_Attack_Defend;
[] spawn GF_Missions_Spawn_Helicopters_Attack_Attack;
*/


//________________    GF_Missions_Spawn_Helicopters_Attack_Attack    ________________

GF_Missions_Spawn_Helicopters_Attack_Attack = {

_Pos = GF_Missions_pos;
_Pos_Spawn = _Pos getPos [GF_Missions_Attack_Distance,random 360];
_Spawn_Height = 1000;
_Group = createGroup GF_Missions_Enemy_Side;
_Group_Crew = createGroup GF_Missions_Enemy_Side;

_Helicopter = selectRandom GF_Missions_Pool_Helicopters_Attack;
_Spawned_Helicopter = createVehicle [_Helicopter,_Pos_Spawn, [], 0, "FLY"];
_Spawned_Helicopter setPosATL [getPosATL _Spawned_Helicopter select 0, getPosATL _Spawned_Helicopter select 1, _Spawn_Height];
_Spawned_Helicopter engineOn true;


//________________    Count all available seats including cargo slots    ________________

_Seats_Number = [_Helicopter,true] call BIS_fnc_crewCount;    

if (GF_Missions_Systemchat_info) then {
    systemchat format ['Vehicle: %1        seats:    %2', _Helicopter , _Seats_Number];
};


//________________     Counts all available seats excluding cargo slots    ________________

_Seats_Number_Crew = [_Helicopter,false] call BIS_fnc_crewCount;


//________________     Spawn Crew    ________________

for "_x" from 1 to _Seats_Number_Crew do {

    _unit_Crew = _Group_Crew createunit [selectrandom GF_Missions_Pool_Infantry_Helicopters,_Pos_Spawn,[],0,"None"];
    [_unit_Crew] JoinSilent _Group_Crew;
    _unit_Crew moveInAny _Spawned_Helicopter;
    (leader _Group_Crew) setSkill GF_Missions_set_AiSkill;

if (GF_Missions_Change_Equipment) then {    
_unit_Crew spawn GF_SCL_GF_Missions;
};

    removeBackpack _unit_Crew;
    _unit_Crew addBackPack "B_parachute";
    
};


//________________     Counts all cargo slots    ________________

_Seats_Number_Cargo = _Seats_Number - _Seats_Number_Crew;    

//________________     Spawn units in Cargo    ________________

for "_x" from 1 to _Seats_Number_Cargo do {

    _unit = _Group createunit [selectrandom GF_Missions_Pool_Infantry,_Pos_Spawn,[],0,"None"];
    [_unit] JoinSilent _Group;
    _unit moveInAny _Spawned_Helicopter;
    (leader _Group) setSkill GF_Missions_set_AiSkill;
            
if (GF_Missions_Change_Equipment) then {    
_unit spawn GF_SCL_GF_Missions;
};

    private _data = [backpack _unit,backpackitems _unit];
    removeBackpack _unit;
    _unit addBackPack "B_parachute";    
          
    [_unit,_data] spawn {
    private ["_unit","_data"];
    _unit = _this select 0;
    _data = _this select 1;
    waitUntil { isTouchingGround _unit || (position _unit select 2) < 1 };
    sleep 1;
    removeBackpack _unit;
    _unit addbackpack (_data select 0);
    {_unit additemtobackpack _x;} foreach (_data select 1);
    };
    
};


[_Group_Crew, _Pos] call BIS_fnc_taskAttack;
[_Group, _Pos] call BIS_fnc_taskAttack;


_Group_Crew setBehaviour "AWARE";
_Group_Crew setCombatMode "RED";

while {(alive _Spawned_Helicopter)} do {
    _Spawned_Helicopter flyInHeight (50 + (random 2000));
    _getPosATL = getPosATL _Spawned_Helicopter;
    _nearEntities = _getPosATL nearEntities 2000;
    {_Group_Crew reveal [_x,4];} count _nearEntities;
    sleep 50;
    };
};

 

  • Like 2

Share this post


Link to post
Share on other sites

Thank you, but I still don't get it. Are you trying to say, that all I need is this code:

 

while {(alive _Spawned_Helicopter)} do { _Spawned_Helicopter flyInHeight (50 + (random 2000)); _getPosATL = getPosATL _Spawned_Helicopter; _nearEntities = _getPosATL nearEntities 2000; {_Group_Crew reveal [_x,4];} count _nearEntities; sleep 50; };

 

Should I rename my target (a tank) and should I use this name somewhere inside your script, and where? What does the code do? Should I place it as a: Condition; or as: On Activation?

getPos finds object's position, as far as I know, but how is your code going to help me? Be more specific, please, it is very important to me. Please, tell me what to do step by step - the way I did above giving my example. Cheers.

Share this post


Link to post
Share on other sites

Everything seems to be working fine now. It's a vehicle, so I only changed the value of the script. Instead of: player knowsabout myTarget > 3.9, I used 1.5 with 4 seconds delay. That's it.

  • Like 1

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

×