Jump to content
ollem

TPWCAS for A3 - AI Suppression System - suggestions/comments/ideas discussion

Recommended Posts

Yes you are true : really strange cause I put the latest .hpp in userconfig : I'll retry this evening making sure the configs are in the right place.

Thanks

Sent from my iPhone using Tapatalk

Share this post


Link to post
Share on other sites

OK I made a mistake I was using a custom tpwcas. Here are logs with the newer version, seems to hang a lot in the init and identification of the HC ...

userconfig = default one from tpwcas2.5

New logs for you LordPrimate :

http://www.atchoom.fr/wp-content/uploads/2013/10/rpt2.rar

sorry for all the acre errors, I forgot to deactivate. I can redo the test without.

Share this post


Link to post
Share on other sites

gagi, your server and HC still don't use the same parameters.

In which directory on server and HC did you put the tpwcas_v2.hpp?

Are you sure these files are the same at both systems?

server:

"--- tpwcas parameters ---------------------------------------------------"
"20.949 TPWCAS Var: tpwcas_mode - [3]"
"20.949 TPWCAS Var: tpwcas_ir - [20]"
"20.949 TPWCAS Var: tpwcas_st - [6]"
"20.949 TPWCAS Var: tpwcas_bulletlife - [1.5]"
"20.949 TPWCAS Var: tpwcas_skillsup - [1]"
"20.949 TPWCAS Var: tpwcas_minskill - [0.1]"
"20.949 TPWCAS Var: tpwcas_reveal - [0]"
"20.994 TPWCAS Var: tpwcas_canflee - [0]"
"20.994 TPWCAS Var: tpwcas_getcover - [1]"
"20.994 TPWCAS Var: tpwcas_coverdist - [30]"
"20.994 TPWCAS Var: tpwcas_playershake - [0]"
"20.994 TPWCAS Var: tpwcas_playervis - [0]"
"20.994 TPWCAS Var: tpwcas_debug - [2]"
"20.994 TPWCAS Var: tpwcas_los_enable - [1]"
"20.994 TPWCAS Var: tpwcas_los_maxdist - [100]"
"20.994 TPWCAS Var: tpwcas_los_mindist - [2]"
"20.994 TPWCAS Var: tpwcas_los_minfps - [10]"
"20.994 TPWCAS Var: tpwcas_los_knowsabout - [4.1]"
"20.994 TPWCAS Var: tpwcas_getcover_minfps - [20]"
"-------------------------------------------------------------------------"
"22.516 - TPWCAS_A3 v5.2 mainloop started"
"22.516 - TPWCAS_A3 v5.2 Debug started"
"22.516 - TPWCAS_A3 v5.2 Active - tpwcas_mode: [3]"

HC:

"--- tpwcas parameters ---------------------------------------------------"
"5.077 TPWCAS Var: tpwcas_mode - [3]"
"5.077 TPWCAS Var: tpwcas_ir - [20]"
"5.077 TPWCAS Var: tpwcas_st - [7]"
"5.077 TPWCAS Var: tpwcas_bulletlife - [1.1]"
"5.077 TPWCAS Var: tpwcas_skillsup - [1]"
"5.077 TPWCAS Var: tpwcas_minskill - [0.15]"
"5.077 TPWCAS Var: tpwcas_reveal - [0]"
"5.077 TPWCAS Var: tpwcas_canflee - [0]"
"5.077 TPWCAS Var: tpwcas_getcover - [1]"
"5.077 TPWCAS Var: tpwcas_coverdist - [15]"
"5.077 TPWCAS Var: tpwcas_playershake - [0]"
"5.077 TPWCAS Var: tpwcas_playervis - [0]"
"5.077 TPWCAS Var: tpwcas_debug - [1]"
"-------------------------------------------------------------------------"
"5.618 - TPWCAS_A3 v5.2 mainloop started"
"5.618 - TPWCAS_A3 v5.2 Debug started"
"5.618 - TPWCAS_A3 v5.2 Active - tpwcas_mode: [3]"

---------- Post added at 06:10 ---------- Previous post was at 05:59 ----------

I just noticed a small error in the init.sqf of tpwcas, not sure of the impact:

diag_log format ["%1 tpwcas_mode = %2 - Server: [%3] - MP: [%4] - config: [%6] - isNil: [%7]", time, tpwcas_mode, isServer, isMultiPlayer, getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_mode"), isNil "tpwcas_mode"];

should be:

diag_log format ["%1 tpwcas_mode = %2 - Server: [%3] - MP: [%4] - config: [[color="#FF0000"]%5[/color]] - isNil: [[color="#FF0000"]%6[/color]]", time, tpwcas_mode, isServer, isMultiPlayer, getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_mode"), isNil "tpwcas_mode"];

this generates the error:

Error position: <tpwcas_mode, isServer, isMultiPlayer, tp>

Error Variable indéfinie dans une expression: tpwcas_mode

File tpwcas\init.sqf, line 26

Share this post


Link to post
Share on other sites

HI all !!!

I will recheck for the settings, (but I'm pretty sure it's something like ARMADIR/userconfig/tpwcas/nameoftheconfigfile.hpp, and I copied the userconfif from the server) in 30 minutes and relaunch the Dedi + HC and I'll try to make clean logs !!!

Ok for the error, if LordPrimate doesn't release the fix soon : I correct it before making the test.

Thanks a lot Ollem !

Share this post


Link to post
Share on other sites

Both your logs show:

"0 tpwcas_mode = 3 - Server: [true] - MP: [true] - config: [2] - isNil: [false]"

Error in expression < [%5] - isNil tpwcas_mode: [%6]", time, tpwcas_mode, isServer, isMultiPlayer, tp>

Error position: <tpwcas_mode, isServer, isMultiPlayer, tp>

Error Undefined variable in expression: tpwcas_mode

File tpwcas\init.sqf, line 26

This 'diag_log' line 26 will in most cases generate an error and better be removed here.

I'm not sure if the script exists at that moment or still continues.

Share this post


Link to post
Share on other sites
What does your config_v2.hpp look like?

If not set already, could you please try to set tpwcas_mode = 2 and tpwcas_debug = 2 ?

tpwcas_mode = 2 and tpwcas_debug = 2 already set

---------- Post added at 21:17 ---------- Previous post was at 21:16 ----------

Both your logs show:

"0 tpwcas_mode = 3 - Server: [true] - MP: [true] - config: [2] - isNil: [false]"

Error in expression < [%5] - isNil tpwcas_mode: [%6]", time, tpwcas_mode, isServer, isMultiPlayer, tp>

Error position: <tpwcas_mode, isServer, isMultiPlayer, tp>

Error Undefined variable in expression: tpwcas_mode

File tpwcas\init.sqf, line 26

This 'diag_log' line 26 will in most cases generate an error and better be removed here.

I'm not sure if the script exists at that moment or still continues.

I agree this one !!!

Share this post


Link to post
Share on other sites

before that diag_log there is a few check that should "set" tpwcas_mod" one is if there is a logic / module on the map that defines tpwcas_mode

the second check is if there is NO definition for tpwcas_mode it sets it to Zero..

the third check, is for single player, that sets it to 1.

after those checks is the diag_log.. I dont get that error because i always define tpwcas_mode with a module on the map.

I made a few changes to those checks one of them didnt make sense maybe ollem can explain this:

if ( (isNil "tpwcas_mode") && (count _this) == 1 ) then

{

tpwcas_mode = 0;

};

what is the (count _this) ==1

.. because if tpwcas_mode is not defined, this should set it to 0. (this is the first check)

then there is the single player check. that will define tpwcas_mode as one if it (isServer) && ! (isMultiplayer).. so at this point it should say, it is either logic enabled, or Zero because its not defined.. but it actually pushes an undefined variabled because some how those checks are being bypassed??

gagi if those were defined you should not get that undefined variable. Am I wrong here Ollem?

Share this post


Link to post
Share on other sites

Lordprimate, for some reason you seem to have reverted to a rather old (or at least ArmA2) version of the init.sqf in tpwcas_v2.6.

In your previous release you used a more recent version.

In this newer version 'tpwcas_mode logging in early stage' and 'count _this' are not used.

Looking at gagi's latest log files I do see that the config file is properly read, but at that stage 'tpwcas_mode' has already been forced to value '3' and the value in the config file is ignored.

my latest init.sqf:

//////////////////////////////////////////////////////////////////
// TPWCAS v5.3 init startup
//////////////////////////////////////////////////////////////////

private ["_temp_tpwcas_mode"];

if !( isClass(configFile >> 'CfgPatches' >> 'A3_Map_Stratis') ) exitWith 
{ 
hint "THIS VERION OF TPWCAS REQUIRES ARMA 3";
diag_log format ["ERROR: This version of TPWCAS requires ArmA 3 !"];
};

// HEADLESS CLIENT CHECK
tpwcas_isHC =  ( !(hasInterface) && !(isDedicated) );

if !(isNil "tpwcas_mode") then // tpwcas_mode set by logic module or by global pubvar
{
diag_log format ["%1 pre-init defined twpcas mode: 'tpwcas_mode = %2'", time, tpwcas_mode];
};

// SinglePlayer Mode (tpwcas_mode 1)
if ( (isServer) && !(isMultiPlayer) ) then 
{
if (isNil "tpwcas_mode") then 
{
	// check for forced disabled tpwcas for Single Player or (hosted or dedicated) Multi Player Server (tpwcas_mode 0)
	_temp_tpwcas_mode = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_mode");
	if ( _temp_tpwcas_mode == 0 ) exitWith 
	{
		tpwcas_mode = 0;
		diag_log format ["%1 disabled tpwcas by userconfig file: tpwcas_mode = %2", time, tpwcas_mode];
	};
};

// else force SinglePlayer Mode (tpwcas_mode 1) if not set above
tpwcas_mode = 1; 
};

diag_log format ["%1 twpcas mode init check: Server: [%2] - MP: [%3] - tpwcas_isHC: [%4] - isNil tpwcas_mode: [%5]", time, isServer, isMultiPlayer, tpwcas_isHC, isNil "tpwcas_mode"];

// Multi Player Client Mode (tpwcas_mode 0, 2, or 3)
if ( !(isServer) && !(tpwcas_isHC) && isMultiPlayer ) then 
{	
if ( isNil "tpwcas_mode" ) then 
{
	diag_log format ["%1 waiting for twpcas client mode variable set by server", time];
	0 = [] spawn // set parameter to close tpwcas if no server variable received within 4 minutes
		{ 
			sleep 240;
			if (isNil "tpwcas_mode") then 
			{
				tpwcas_mode = 0;
			}; 	
		};
	waitUntil { sleep 3;!(isNil "tpwcas_mode") };
	diag_log format ["%1 twpcas client mode set to tpwcas_mode: [%2]", time, tpwcas_mode];
};

if ( tpwcas_mode == 2 ) then // set by global pub var
{
	diag_log format ["%1 enabled tpwcas client mode: tpwcas_mode = %2", time, tpwcas_mode];
}
else //unknown value or value = 3 - disable tpwcas
{
	diag_log format ["%1 disable tpwcas client mode: detected value for tpwcas_mode = %2", time, tpwcas_mode];
	tpwcas_mode = 0;
};
};

// Multi Player Server or HC Mode (tpwcas_mode 2 or 3)
if ( ( ( isServer || tpwcas_isHC ) ) && ( isMultiPlayer ) ) then 
{  
diag_log format ["%1 tpwcas - Server: [%2] - MP: [%3] - config: [%4] - isNil tpwcas_mode: [%5]", time, isServer, isMultiPlayer, getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_mode"), isNil "tpwcas_mode"];

if ( isNil "tpwcas_mode" ) then // read tpwcas_mode value from userconfig file
{
	tpwcas_mode = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_mode");	
};

if !( (tpwcas_mode == 2) || (tpwcas_mode == 3) || (tpwcas_mode == 0) ) then 
{
	diag_log format ["%1 forcing tpwcas to value [3]: determined tpwcas_mode value: [%2]", time, tpwcas_mode];
	tpwcas_mode = 3; 
}; 
};

//////////////////////////////////////////////////////////////////////////
// Read TPWCAS Parameters from userconfig file
if ( isServer || tpwcas_isHC ) then 
{
tpwcas_hint = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_hint");
tpwcas_sleep = getnumber(configfile>> "tpwcas_key_setting" >> "tpwcas_sleep");

tpwcas_ir = getnumber(configfile>> "tpwcas_key_setting" >> "tpwcas_ir");
tpwcas_maxdist = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_maxdist");
tpwcas_bulletlife = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_bulletlife");
tpwcas_st = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_st");
tpwcas_mags = getarray(configfile>> "tpwcas_key_setting"  >> "tpwcas_mags");

tpwcas_skillsup = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_skillsup");
tpwcas_minskill = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_minskill");
tpwcas_reveal = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_reveal");
tpwcas_canflee = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_canflee");


tpwcas_los_maxdist = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_los_maxdist");
tpwcas_los_mindist = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_los_mindist");
tpwcas_los_minfps = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_los_minfps");
tpwcas_los_knowsabout = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_los_knowsabout");

tpwcas_coverdist = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_coverdist");
tpwcas_getcover_minfps = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_getcover_minfps");

tpwcas_playershake = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_playershake");
tpwcas_playervis = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_playervis");
//tpwcas_textdebug = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_textdebug"); => DEPRECATED

// if not set using logic read from userconfig file
if (isNil "tpwcas_debug") then { tpwcas_debug = getnumber(configfile>> "tpwcas_key_setting" >> "tpwcas_debug"); };
if (isNil "tpwcas_getcover") then { tpwcas_getcover = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_getcover"); };
if (isNil "tpwcas_los_enable") then { tpwcas_los_enable = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_los_enable"); };
};

if ( !(tpwcas_mode == 0) ) then  
{
nul = [] execvm "\tpwcas\tpwcas_init.sqf";
};

Edited by Ollem

Share this post


Link to post
Share on other sites

Ollem, when you released your script version . I took the top portion of the tpwcas_script_init.sqf and replaced the one i had (thinking that it would be more up to date/ and to save time). Thanks for the heads up i would have never known, I will put that into my init and release an update pronto.

Edited by Lordprimate

Share this post


Link to post
Share on other sites

just few errors about LOS?

Error in expression <;

_pos2 = _this select 1;

if(typename _pos1 == "OBJECT") then {_pos1 = getpos >

Error position: <_pos1 == "OBJECT") then {_pos1 = getpos >

Error Undefined variable in expression: _pos1

File A3\functions_f\geometry\fn_dirTo.sqf, line 20

Error in expression <_cansee > 0) exitwith

{

_dirto = ([_a, _b] call bis_fnc_dirto);

_unitdir >

Error position: <_a, _b] call bis_fnc_dirto);

_unitdir >

Error Undefined variable in expression: _a

File tpwcas\tpwcas_los.sqf, line 221

-----------------

And detaching balls ... but as they are just there for debugging purpose ...

"251.726 [bDetect_a3 v1.0] Frame:38264 L9: 'tpwcas_fnc_debug' tpwlos debug ball - unit [O Alpha 3-1:2 REMOTE] - new value: [1]"

LODShape::AddLoadHandler: Handler not present in shape [a3\weapons_f\acc\reticle_arco_f.p3d]

LODShape::AddLoadHandler: Handler not present in shape [a3\weapons_f\empty.p3d]

LODShape::AddLoadHandler: Handler not present in shape [a3\weapons_f\empty.p3d]

LODShape::AddLoadHandler: Handler not present in shape [a3\weapons_f\empty.p3d]

"254.543 [bDetect_a3 v1.0] Frame:38377 L10: 'tpwcas_los_fnc_mainloop' - set start value for unit [<NULL-object>]"

LODShape::AddLoadHandler: Handler not present in shape [a3\weapons_f\empty.p3d]

LODShape::AddLoadHandler: Handler not present in shape [a3\weapons_f\empty.p3d]

"256.223 [bDetect_a3 v1.0] Frame:38444 L9: 'tpwcas_fnc_debug' tpwlos debug ball - unit [O Alpha 3-1:2 REMOTE] - new value: [0]"

LODShape::AddLoadHandler: Handler not present in shape [a3\weapons_f\empty.p3d]

Error: Object(3 : 79) not found

Client: Object 3:79 (type Type_110) not found.

Client: Object 3:79 (type Type_85) not found.

LODShape::AddLoadHandler: Handler not present in shape [a3\weapons_f\acc\reticle_arco_f.p3d]

LODShape::AddLoadHandler: Handler not present in shape [a3\weapons_f\empty.p3d]

"257.383 [bDetect_a3 v1.0] Frame:38495 L10: 'tpwcas_los_fnc_mainloop' - set start value for unit [<NULL-object>]"

"257.383 [bDetect_a3 v1.0] Frame:38495 L10: 'tpwcas_los_fnc_mainloop' - set start value for unit [<NULL-object>]"

"257.412 Frame:38496 'tpwcas_fnc_debug()' - Added debug ball for <NULL-object>"

Error in expression <tVariable "tpwcas_debug_ball";

detach _cas_ball;

_cas_ball setPosATL [(random >

Error position: <_cas_ball;

_cas_ball setPosATL [(random >

Error Undefined variable in expression: _cas_ball

File tpwcas\tpwcas_debug.sqf, line 169

Share this post


Link to post
Share on other sites

the first one is a BIS error (since tpwcas is calling a BIS function and the BIS function is broken it passes an undefined variable), the second one about _cas_ball i have been getting as well..

EDIT:

looking at one of my older updates to the latest i can see a change was made..

the only change i see in the debug code is that somehow, an "if" statement was //commented out. //}; ..

I didnt get the _cas_ball errors before, and neither did you.. I am going to remove those commented out lines as that is all i can see that is changed in relation to debugging.

Edited by Lordprimate

Share this post


Link to post
Share on other sites

OK,

LordPrimate, did you have a look to the tpwcas version in the RPT (rpt4.rar)?

I just put Ollem's init code inside. Perhaps you want to adapt this code and releasing a new version? Cause I didn't check if it needs other changes.

There is also this test in Ollem's version about reading parameters :

"// Read TPWCAS Parameters from userconfig file

if ( isServer || tpwcas_isHC ) then "

your version :

"if ( isServer ) then"

It has to be executed on both dedi&HC I think.

Another thing :

Ollem's version :

" nul = [] execvm "tpwcas\tpwcas_init.sqf";"

Yours :

" nul = [] execvm "\tpwcas\tpwcas_init.sqf";"

don't know if the "\" can cause problems.

For the moment I'm using the modded version in rpt4.rar a few posts ago ...

Thanks in advance for your update on this subject.

Edited by gagi

Share this post


Link to post
Share on other sites

Right answer:

if ( isServer || tpwcas_isHC ) then " => otherwise HC might not be started correctly

" nul = [] execvm "\tpwcas\tpwcas_init.sqf";" => though " nul = [] execvm "tpwcas\tpwcas_init.sqf";" should be okay too the '\' is better in case of mod.

Share this post


Link to post
Share on other sites

Thanks a lot Ollem, awaiting answer from Lordprimate as he begun the mod packaging.

Share this post


Link to post
Share on other sites

Cool, so looking at all my older versions dating back to the beginning, has always been isServer, Nice Catch Gagi!! really!!

I have to apologize i have been working a bit more and i also signed up to test bCombat. so i have been testing that alot. Ill take the next few hours and go threw test tpwcas with the changes and post up and update I think that i have already packed it i just havent spent time testing it so i didnt want to release it!

Ollem, you might want to change that in your ARMA 2 version as well because that is also the same.. I just checked the arma 2 version (because of when you accidentaly posted the arma 2 script version here and i had adopted the HC check from that older version)

edit: yup i already packed it up with the corrections, ill post in a few after a few tests.

Update Shortly!

Edited by Lordprimate

Share this post


Link to post
Share on other sites

You great man!

Hey I saw you engaged in bcombat, so do I!

That´s why I thought you forgot about us :)

Edited by gagi

Share this post


Link to post
Share on other sites

having a few issues, for some reason the debug stuff doesnt work in MP.. does anyoneknow if BIS_fnc_MP is broken ??

ok just looked into it , older versions i have use CBA_fnc_globalvent and they work in MP on a dedi server. but the later version that use bis_fnc_MP dont work on a dedi..

anyone ?

Edited by Lordprimate

Share this post


Link to post
Share on other sites

With tpwcas and stable branch?

What are symptoms ? (Rpt or visuals?)

Share this post


Link to post
Share on other sites

I play on the dev branch almost exclusivily.

from my 10 hours of trying to figure out why in tpwcas "I" had broken, i came the the realization that it is indeed BIS_fnc_MP that is broken on dedicated servers. If i switch out the function to CBA_fnc_globalEvent it works... but thats an old version of the script i dont want to backtrack. so i am going to leave it as it..

I believe that it is only the debugging that is affected. I "think" the rest of the mod works ok (havent checked HC).

Share this post


Link to post
Share on other sites

This one sounds bad !!!

Ollem, what do you think, do you think it only affects debugging?

Thanks guys

Edited by gagi

Share this post


Link to post
Share on other sites

Looked at the debug code but I do not see what's wrong either.

I doubt BIS_fnc_MP is the error, but I play/develop on stable only - so could be dev branch issue

Will try to have a proper look at it this weekend.

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

×