Jump to content

Recommended Posts

Hello

If no AI Skill is set by code or otherwise, would anybody know what the default values would be please?

Share this post


Link to post
Share on other sites

Edit: I believe I found what I was looking for while examining BIS_fnc_EXP_camp_setSkill
I am trying reduce the AI Skill of the entire east side while a dust storm script was running, hopefully this should do ok

Share this post


Link to post
Share on other sites
4 hours ago, anfo said:

what the default values would be please?

CfgAISkill A3 defaults

  • Like 3

Share this post


Link to post
Share on other sites
5 hours ago, anfo said:

reduce the AI Skill of the entire east side while a dust storm script was running

 

Hello there anfo !

 

This can be done also by changing the spot distance

This is an example of the code that i'm using in my fog script :

diag_log "//________________ GF_Fog_Change_spotDistance.sqf _____________";

systemchat "GF_Fog_Change_spotDistance";
//________________ Settings ________________
//________________ Set true or false  ________________

GF_Fog_Change_spotDistance				= true;		//	Change AI spotDistance


if (GF_Fog_Change_spotDistance)then{

	[]spawn{
		while{true}do{
			{		
			if (
				((alive _x)) 
				&& (!(_x getVariable ["Var_GF_Fog_Change_spotDistance",false]))
				)then{
					_x setSkill ["spotDistance", 0.05 + (random 0.05)];
				};						
				_x setVariable ["Var_GF_Fog_Change_spotDistance",true];
				{waitUntil {!alive _x};
				_x setVariable ["Var_GF_Fog_Change_spotDistance",false];		 
				};
			}forEach allUnits;
	uisleep 15;
		};
	};

};

 

and there is also availabe ( as you already know ) the aiskill script:

 

 

Generally,

you can set a variable  (true) while the dust storm is running , to set your different settings for this certain period.

Share this post


Link to post
Share on other sites
7 hours ago, Larrow said:

 

That table seems difficult to interpret. It's either 0 or 1 which appears very broad

Share this post


Link to post
Share on other sites
5 hours ago, GEORGE FLOROS GR said:

you can set a variable  (true) while the dust storm is running , to set your different settings for this certain period.

 

I see, so (credit to Alias for his sand-storm script code), I could do something like:

while {true} do {
if (isServer) then {
	my_dust_storm_duration = 240 + random 600;
	publicVariable "my_dust_storm_duration";
	pause_between_dust_storm = 240 + random 600;
	publicVariable "my_dust_storm_duration";
};
waitUntil {(!isNil "my_dust_storm_duration") and (!isNil "pause_between_dust_storm")};

//SPOT DISTANCE ON
GF_Fog_Change_spotDistance = true;	

null = [340,my_dust_storm_duration,false,false,false,0.3] execvm "AL_dust_storm\al_duststorm.sqf";

//SPOT DISTANCE OFF
GF_Fog_Change_spotDistance = false;	

sleep (my_dust_storm_duration + pause_between_dust_storm);
};

Something like that @GEORGE FLOROS GR? Assuming your Set AI Skill script is included of course!

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, anfo said:

Something like that @GEORGE FLOROS GR

 

I will try for today , to check the Alias sand-storm script , in order to tell you how to do this.

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, GEORGE FLOROS GR said:

 

I will try for today , to check the Alias sand-storm script , in order to tell you how to do this.

 

Marvelous, thank you!

  • Like 1

Share this post


Link to post
Share on other sites
On 6/24/2019 at 12:27 PM, anfo said:

Marvelous, thank you!

 

Will your mission include spawned units at the same time that the dust storm script is enabled ?

Share this post


Link to post
Share on other sites

 

Just check in :

al_duststorm.sqf

 

there is an error showing up with the example of alias from the ini_dust_storm.

and in order to fix this , go at the last line ( of al_duststorm.sqf ) and change this:

deleteVehicle _stormsource;

to :

if(_dust_wall)then{deleteVehicle _stormsource;};

 

here is the code :

Spoiler

GF_spot_Debug = true;

if(GF_spot_Debug)then{
	onEachFrame{
		if(cursorTarget isKindOf "Man")then{
		hintsilent format[
			"aimingAccuracy %1\n  aimingShake %2\n  commanding %3\n  courage %4\n  general %5\n  reloadSpeed %6\n  spotDistance %7\n  spotTime %8\n",
			cursortarget skillfinal "aimingAccuracy",
			cursortarget skillfinal "aimingShake",
			cursortarget skillfinal "commanding",
			cursortarget skillfinal "courage",
			cursortarget skillfinal "general",
			cursortarget skillfinal "reloadSpeed",
			cursortarget skillfinal "spotDistance",
			cursortarget skillfinal "spotTime"
			];
		};
	};
};


GF_spot = {

	GF_spot_on = true;
	al_duststorm_on = true;
	while{GF_spot_on}do{

		if(al_duststorm_on)then{
			{		
			if(
			(alive _x)
			&& (!(isPlayer _x))
			)then{
				_x setSkill["spotDistance",0.05 + random 0.05];
				_x setSkill ["spotTime", 0.05 + random 0.05];
				};
				_x setVariable ["Var_GF_spot",true];
			}forEach allUnits;
				if(GF_spot_Debug)then{
					systemchat "GF_spot on";
					systemchat format["al_duststorm_on %1",al_duststorm_on];
				};
		}else{
			{
				_x setSkill["spotDistance",0.4 + random 0.3];
				_x setSkill ["spotTime", 0.4 + random 0.3];
			}forEach allUnits;
				if(GF_spot_Debug)then{
					systemchat "GF_spot off";
					systemchat format["al_duststorm_on %1",al_duststorm_on];
				};
			GF_spot_on = false;
		};
	uisleep 5;
	};
};


while {true} do {
	if (isServer) then {
		my_dust_storm_duration = 20;	//	240 + random 600;
		publicVariable "my_dust_storm_duration";
		pause_between_dust_storm = 20;	//	240 + random 600;
		publicVariable "my_dust_storm_duration";
	};
	waitUntil {(!isNil "my_dust_storm_duration") and (!isNil "pause_between_dust_storm")};
	null = [340,my_dust_storm_duration,false,false,false,0.3] execvm "AL_dust_storm\al_duststorm.sqf";
	[]call GF_spot;
	uisleep(my_dust_storm_duration + pause_between_dust_storm);
		if(GF_spot_Debug)then{
			systemchat "dust_storm loop";
		};
};

 

 

and some pics :

Se1n9Jd.pngMvSZcYU.png

  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, GEORGE FLOROS GR said:

Will your mission include spawned units at the same time that the dust storm script is enabled ?

 

Yes, using Jebus, but they spawn on triggers at various times during the mission

 

5 hours ago, GEORGE FLOROS GR said:

+ all the units will be affected from the dust ?

 

The AI, yes. At the moment they can see through the thick dust, but we can't. Until you came with this very impressive report, I was ready to turn visibility from 0.3 to 0

 

3 hours ago, GEORGE FLOROS GR said:

there is an error showing up with the example of alias from the ini_dust_storm

 

👍 😄

So first I see I need to fix a fault in al_duststorm.sqf, then second I add your new code above the existing Alias code to adjust AI skill during the sandstorm?
I appreciate all the help on this forum, but you, Sir are one of a kind!

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi GF
Reference:

my_dust_storm_duration = 20;	//	240 + random 600;

Can you please tell me what 20 value is? Is that minutes?

  • Like 1

Share this post


Link to post
Share on other sites
17 hours ago, anfo said:

what 20 value is? Is that minutes?

 

Seconds , i just put 20 for the test.

Thank you very much also anfo !

Have fun !

Share this post


Link to post
Share on other sites

Reference your pictures, I see the AI starts with a spotDistance and spotTime of ~0.8 and then drop to ~0.2 (which is what you would hope for). In my mission however, the AI start at ~0.13 and then goes up to ~0.5 which I thought was strange. I will put your code into a vanilla mission to see what happens.

 

edit: I was looking at playable characters and not AI. It seems to work differently between the two.

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, anfo said:

edit: I was looking at playable characters and not AI. It seems to work differently between the two.

On 6/26/2019 at 3:20 AM, GEORGE FLOROS GR said:

_x setSkill["spotDistance",0.05 + random 0.05]; _x setSkill ["spotTime", 0.05 + random 0.05];

 

I haven't notice anything about it , but generally you can play with the values and the Debug of my script and check it.

If i have time , i'll check it as well.

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

×