Jump to content
Sign in to follow this  
sempavieh

Client <-> Server Problem

Recommended Posts

Hi Folks, after the thing with the Nuke i realized that i have one big problem with my Mission atm.

The Problem shows itself through the Ammoboxes i created with a little help of a script if found here in the forums.

If i Preview the Mission, everything works fine for me. I see the random stuff in the Crates i put in there with a function and i can use the UAV (if i take the slot that is directly synchronized with the module, all others cant use it although they are grouped with the synchronized player), till it crashes sometime (for an unknown reason).

If i host the Mission in Lan (not-dedicated) everything still works fine for me, but my mates cant see the random stuff in the crates, cant use the UAV (it tends to crash in the moment someone else tries to use it but me)

If we put the Mission on a dedictated Server, neither i, nor my mates can see the random stuff in the crates or get the uav working (says "UAV destroyed", if i try to activate it with the actionmenu)

This all points in one direction, for the Server, all Variables and Functions are published, but not for the Clients. I know that there is some Argument to use, if u want to make sure that this works but im too noob in scripting to use it in the right way.

I dont know if there is a JIP Problem too, because we never tried to use a slot again.

This is in the Initline of the respective crates

null0 = [this] execVM "functions\ammoXXX.sqf"

This is an example for one of those ammo.sqf

private ["_crate"]; 
_crate = _this select 0;

if(local _crate) then
{
clearWeaponCargo _crate;
clearMagazineCargo _crate;

		_crate addMagazineCargo["HANDGRENADE_WEST",50];
		_crate addMagazineCargo["SMOKESHELL",50];
		_crate addMagazineCargo["SMOKESHELLGREEN",50];
		_crate addMagazineCargo["SMOKESHELLRED",50];
		_crate addMagazineCargo["SMOKESHELLYELLOW",50];
		_crate addMagazineCargo["ACE_M7A3",50];
		_crate addMagazineCargo["ACE_M84",50];
		_crate addMagazineCargo["ACE_M34",50];


		_crate addMagazineCargo["MINE",50];
		_crate addMagazineCargo["PIPEBOMB",50];
		_crate addMagazineCargo["ACE_BBETTY_M",50];
		_crate addMagazineCargo["ACE_CLAYMORE_M",50];
		_crate addMagazineCargo["ACE_M2SLAM_M",50];
		_crate addMagazineCargo["ACE_M4SLAM_M",50];
		_crate addMagazineCargo["ACE_TRIPFLARE_M",50];
		_crate addMagazineCargo["ACE_M86PDM",50];


sleep 1800;
};

I tried precompiling the functions first but it made no difference i believe. I think theres just some Argument missing, publishing the crates loadout to all players around.

As you can see im using ACE² and yes its fully updated with Six-Updater, so there shouldnt be any problem i think.

Im using some other scripts like SimpleVehicleRespawn and a Weaponsavefunction Xeno wrote here in the forums but i cant imagine how they can influence this ammofunction.

Please help me, its really frustrating :(

My ArmA2.rpt shows some weird problems too i cant make a sense of.

First theres this part, that suddenly came out of nowhere after i made some changes, but those changes are back to normal again, but this keeps coming.

Warning Message: No entry 'bin\config.bin/CfgMagazines.ACE_15Rnd_9x19_USP'.
Warning Message: No entry '.picture'.
Warning Message: '/' is not a value
Warning Message: No entry '.scope'.
Warning Message: '/' is not a value
Warning Message: Error: creating magazine ACE_15Rnd_9x19_USP with scope=private
Warning Message: No entry '.displayName'.
Warning Message: '/' is not a value
Warning Message: No entry '.nameSound'.

Its a lot longer but i think this is the main problem.

Thanks and have a nice day

sempavieh

PS: If you want to, feel free to contact me on icq (645525468), im currently searching other missionmakers with (hopefully) more experience than me, for developement of my upcoming realwar project. for further details, just ask :)

Edited by sempavieh
minor stuff

Share this post


Link to post
Share on other sites

I could get rid of those messages in the RPT after deleting the USP Weapon and Magazines from my script. Unfortunatly it did not solve the publishing problem.

I tried various of other things again (with dedicated host too) but nothing worked so far.

Tried to redefined _crate(s) with numbers (_crate0 etc.), before all variables were named _crate in 6 separate function ... didnt do anything :(

i tried to get rid of the defining part of the function but then nothing worked.

i tried to alter the init-line of the crate, without success obviously ...

#define _this = noob

if fed_up_with_sit then

{ addAction Drink_Beer

end_if

dead

}

//eof :(

Share this post


Link to post
Share on other sites

May I ask why you're checking for the crate to be local?

Share this post


Link to post
Share on other sites

Because i dont have a clue what i'm doing atm. I just started a week ago again with editing after a long pause due to studying and other stuff.

is there another way? im pretty sure that this prob has something to do with this local stuff but i have no idea if i should just delete the argument, or to put wich argument in there. I tried "public" once, but then the script was messed up ...

Share this post


Link to post
Share on other sites

Pls try it again by dropping this check.

Share this post


Link to post
Share on other sites

Tried it while hosting a dedicated server on my own machine and it worked without the check. You made my day, thx alot :D

That is the problem if you try to learn scripting by scavanging through the scripts of others, there are always parts you are not certain about.

i hope this phase is over soon.

---------- Post added at 05:38 PM ---------- Previous post was at 04:36 PM ----------

Ok one down, two to go ... or something like that.

After finishing this part, there is another disturbing fact. I mentioned it earlier in the first post. Theres a strange Problem with the UAV, probably related to some Client <-> Server communication issue or caused by my nonexistent JIPrespawnscript.

Heres the Situation:

I have 1 Officer and 2 Soldiers. Grouped only over the ArmA2 Grouplinks (drag&drop).

First Problem is, even in Preview only the Officer (who is leader of this group by rank and drag&drop link) has access to the uav terminal and it works fine.

Second problem is, if i host the mission on a dedicated server even the Officer gets a Hint that the UAV has been destroyed, although it is flying right above his head ...

Third Problem, in Preview, normal and dedicated host, the Officer looses his ability to use the UAV ever again.

I got three opinions about this problem atm:

1. The reason is i did not group the Soldiers properly with _groupthis etc. (at least i think it is the reason for the problem, that the 2 soldiers cant use UAV even in Preview)

2. Using the "normal" BIS Respawn routines in description.ext, while using ACE Woundsystem & trying to establish working jip-compatible multiplayermaps just does not work out -> so i would need to find a working Respawnscript as a workaround.

3. the weaponstay function is not JIP-compatible and causes problems with other abilities like UAV handling.

[b]Initline[/b] of each one of the soldiers:

_handle = [] execVM "functions\weaponstay.sqf";

[b]Weaponstay.sqf[/b]
while {true} do {
   waitUntil {!alive player};
   _weapons = weapons player;
   _magazines = magazines player;
   waitUntil {alive player};
   _p = player;
   removeAllItems _p;
   removeAllWeapons _p;
   {_p addMagazine _x} forEach _magazines;
   {_p addWeapon _x} forEach _weapons;
   _primw = primaryWeapon _p;
   if (_primw != "") then {
       _p selectWeapon _primw;
       _muzzles = getArray(configFile>>"cfgWeapons" >> _primw >> "muzzles");
       _p selectWeapon (_muzzles select 0);
   };
};

It works fine so far, it does what it is supposed to, as expected of Xenos work afterall. but im not sure if something maybe disturbs respawn itself or the jip-compatibilty of the mission ...

All i need is a push in the right direction again i think ...

Share this post


Link to post
Share on other sites

ed:

Ah, I see where you've gone wrong: http://forums.bistudio.com/showthread.php?t=76731&highlight=weapon+loadout

A client is not a player model, and a player model is not resurrected but deleted and a fresh one made. So no new init. Xeno suggests a trigger, and the line you mentioned in the init of soldiers to go in that trigger, with 'local player' (the connecting computer) as the activation. Rommel suggests an eventHandler in the soldier Init. It just tells you're comp to watch for an event and can be deleted thereafter, so is respawn-safe. This has the advantage of being customisable (more easily so, anyway) to each player. If you want the same loadout for everyone just use player = eventHandler ["killed... in init.sqf. Look up exact wording (script and in-editor stuff differs slightly, so it's different than in Rommel's example) in Biki. There is no non-BIS respawn workaround that I know of. Revive scripts such as norrin's use base (3) respawn.

Bonn has an awesome looking GUI, though. Think I might borrow that myself later...

Never used a UAV nor intend to, so can't help there.

Edited by Reimann

Share this post


Link to post
Share on other sites

Sorry that i did not reply asap but i had to rest a while :D

I got it working in the init.sqf:

_xhandle = player addEventHandler ["killed", player execvm "functions\weaponstay.sqf"];

But still i cant use the UAV again after respawning ... this has to be something else.

But its better this way, less code in Soldiers init.

And i can now focus on this UAV Problem.

along with the fact that i still did not find out how i can virtually group ppl together. thought it must look like this, p2 is the name of the player i want to group:

echo1=group p2;

it does not seem to work because in the uav module it is said that all grouped ppl can use the uav, if the leader is sync with the module :(

do i have to define the leader or is the syntax wrong, i dont know :(

and theres a new error in the Init.sqf ... but ... the script works ... i dont know what that is about

Error in expression <kers_enabled = true;

_xhandle = player addEventHandler ["killed", player execvm>
 Error position: <addEventHandler ["killed", player execvm>
 Error Typ Script, erwartet Zeichenfolge

and the uav still does not think about working although i defined this

BIS_uav_0 setvariable ["rules",[p0,p1,p2]]; 

in the init line of the UAV Module (where i think this is supposed to be )

plz help me im going crazy, i manage to solve a problem and 2 new problems arise from the ashes -.- :(

---------- Post added at 07:52 PM ---------- Previous post was at 06:41 PM ----------

tried something else now:

i put this into the init.sqf:

//nul = this addAction ["Initialize UAV", "functions\inituav.sqf"];

nul=[]execVM "functions\inituav.sqf";

and this is what the inituav.sqf looks like

BIS_uav_0 setvariable ["rules",[p0,p1,p2]]; 

BIS_UAV synchronizeObjectsAdd [terminal1,uav1,p0]; 
BIS_UAV synchronizeObjectsAdd [terminal1,uav1,p1]; 
BIS_UAV synchronizeObjectsAdd [terminal1,uav1,p2];

tried both of the lines in Init.sqf (although i wonder if i need to set a Actionmenu Button for the Sync in Case of the "AddAction" Part) ... nothing works afterall -.- is there just no way to get the uav working in multiplayer or do i just not get it :(

Edited by sempavieh

Share this post


Link to post
Share on other sites
and theres a new error in the Init.sqf ... but ... the script works ... i dont know what that is about

player addEventHandler ["killed", 
{ 
       doStuff; 
       moreStuff;
       };	
               ];

Share this post


Link to post
Share on other sites

ok i try that l8er, thx.

after reading half a dozen threads about setting UAVs up in Multiplayer an trying all the Scripts that were posted here in the forums to my best abilities i give up on that uav thing, cause it seems it is just not possible to get it work in Multiplayer, thats very sad :(

Still, If theres a solution and someone knows about it ... plz share ur wisdom already :D

Share this post


Link to post
Share on other sites

Wait another 55-odd days:

Quote:

The Key Improvements over ARMA 2

FLIR (military grade thermal imaging simulation) system implemented

Night combat updated with laser markers, IR strobes and flashlight usage

Streamlined and reworked in-game UI / HUD

Full support for backpacks (including ability to carry static weapons, like mortars or UAV terminals)

Reworked and improved radio chatter between units (including whispered variant)

Remotely-controlled helicopter UAV

Share this post


Link to post
Share on other sites
But still i cant use the UAV again after respawning ... this has to be something else.

When you place a unit in Editor and syncronize it with UAV module, UAV initialization script runs for this unit. After you have respawned, you drive in fact another "body", that is not syncronized with UAV.

To be able to use UAV after respawn, (and on all clients, not just your) you have to do:

1) NOT to syncronize UAV with units (it is even not necessary to place this module on map)

2) Just run UAV initialization script from UAV module on each local machine, when local player starts game or respawns

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  

×