Jump to content
Sign in to follow this  
eggbeast

[RESOLVED] problem with code executing on client in mp server from trigger

Recommended Posts

this code has worked since A1, then all the way through A2, and into A3 for the past 18 months.

It failed a few weeks ago and i've not been able to fix it since.

 

It works in client running the mission, but as soon as i go on MP server, the servicing script fails - can anyone see what i'm doing wrong?

//pinit.sqf called on client contains this:
_cthread = [] execVM "scripts\MainThreadC.sqf";

//mainthreadC.sqf contains:
//THIS ROUTINE FAILS IN MP
EGG_EVO_Repair = 
{
	_vec = (vehicle player);
	_type = typeOf vehicle player;
	if !(_vec isKindOf "Man") then
	{ //not man
		if ( (getDammage _vec > 0) || (fuel _vec < 0.98) || (_vec isKindOf "staticweapon" and getDammage _vec > 0) ) then
		{ //damaged
			if ( (_vec in list AirportIn) || (_vec in list farp1) || (_vec in list reng1) || (_vec in list reng2) || (_vec in list reng3) || (_vec in list reng4) ) then 
			{ // in farp
				if ( (_vec != player) && (speed _vec > -2) && (speed _vec < 2) && (position _vec select 2 < 2) ) then //&& (local _vec)
				{ //stationary
					titleText [localize "STR_M04t83", "PLAIN DOWN",0.3];//Servicing - may work if stringtable same for A3
					for [{_loop2=0}, {_loop2<1}, {_loop2=_loop2}] do
					{
						sleep 0.2;
						if (getDammage _vec > 0) then {_vec setDamage((getDammage _vec)-0.0125)};
						if (Fuel _vec < 1) then {_vec setFuel ((Fuel _vec)+0.0125);};
						if (getDammage _vec == 0 and Fuel _vec == 1) then {_loop2=1;};
						if(_vec != vehicle player or speed _vec < -2 or speed _vec > 2 or position _vec select 2 > 2.0) then {_loop2=1;titleText [localize "STR_M04t84", "PLAIN DOWN",0.3];};//again stringtable may need looking at for A3
						_dam = (getDammage _vec)*100;
						_ful = (Fuel _vec)*100;
						hint format["Damage: %1\nFuel: %2",Round _dam,Round _ful];
					}; //repair loop
					_vec setVehicleAmmo 1;
				};//loop complete
				sleep 2;
			};//farp check
			sleep 2;
		};//damaged
		sleep 2;
	}; //vehicle
};
...
for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
{
	[] call EGG_EVO_Repair;
	sleep 1;
	[] call EGG_EVO_stationRepair;
	sleep 1;
	if (score player != _tscore and alive player) then {[] call EGG_EVO_Rank};
	sleep 1;
	if (EGG_EVO_MissionProgress > _currentprog) then {[] call EGG_EVO_CityClear};
	sleep 1;
	[] call EGG_EVO_CTime;
	sleep 1;
	[] call EGG_EVO_HPM;
	sleep 10;
};
//mission sqm, reng1-4 and farp1 are similar triggers
		class Item159
		{
			dataType="Trigger";
			position[]={4934.4912,6.1640625,2744.0381};
			class Attributes
			{
				name="AirportIn";
				text="Airport";
				sizeA=200;
				sizeB=450;
				repeatable=1;
				activationBy="ANY";
				isRectangle=1;
			};
			id=159;
			type="EmptyDetector";
		};

//also contains the trigger that calls pinit.sqf that initialises player and calls mainthreadC.sqf on the client
        class Item183
        {
            dataType="Trigger";
            position[]={916.32727,0.10696433,4848.0757};
            class Attributes
            {
                name="pinit";
                text="pinit";
                condition="local player";
                onActivation="plays = [] execVM ""scripts\pinit.sqf"";";
                sizeA=0;
                sizeB=0;
                timeout[]={1,1,1};
                interuptable=1;
            };
            id=183;
            type="EmptyDetector";
        };


could "list" be failing in MP?

Share this post


Link to post
Share on other sites
Larrow: As of ["Arma 3","Arma3",152,132676,"Stable",true] this command is still broken if checking against markers that have axisB larger axisA. To get around this if needed you can create your marker with the largest radius in axisA and rotate your marker by 90degrees

 

aha!

				sizeA=200;
				sizeB=450;

Share this post


Link to post
Share on other sites

nope that didn't fix it.  My trigger just doesn't want to work any more in a client script - can anyone see what i'm doing wrong?  it's something to do with  a recent A3 update, cos it works fine on the client, and used to work fine on the server...

Share this post


Link to post
Share on other sites

it's something to do with  a recent A3 update, cos it works fine on the client, and used to work fine on the server...

 

Hi eggbeast, I too have noticed editor-placed triggers becoming unresponsive on dedicated server after the recent A3 update (among other things), so I suggest you try replacing editor triggers with script-created.

 

 

Hope this helps,

 

Nikander

Share this post


Link to post
Share on other sites

Yeah that's the one - thanks for putting my mind at rest.

This is why i left Arma 3 and stayed in Arma 2 for the last 2 years. 

I really didn't like the uncertainty when your mission in broken, that you have no idea if you broke something or BIS did, and back then 90% of the time, it was BIS. Now i'd say it is more like 30%, but still significant.

 

Let's hope they fix this soon as MP missions converted to Eden are absolutely unworkable at present.

  • Like 1

Share this post


Link to post
Share on other sites

BIS fixed it - thank the lord

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  

×