Home   Help Search Login Register  

Author Topic: move unit local to server in cargo of vehicle local to client  (Read 2067 times)

0 Members and 1 Guest are viewing this topic.

Offline TeRpEnTiN

  • Members
  • *
    • BWMod
Hi,

perhaps this is the wrong board, because it is related to Addon Editing, however it is a multiplayer issue only.

Ok:
I'm currently updating the BWMod Tiger to ensure multiplayer compability of the loadout script.

Some background information:
the loadout system the Tiger consists of two cargo proxies where weapon models defined as civilian soldiers get in. This system has been invented to ensure better performance on older computers, because you do not have to use setObjectTexture Scripts and do not have all weapon models and textures in the vehicles p3d.

If I'm using 'createVehicled' weapon proxys and move them in cargo, it works correctly in multiplayer, because objects are local on every client.
However, you get a CtD when a 'createvehicled' weapon ejects from the chopper or plane, even if you put all soldier specific LoDs into the p3d.

This way I had to use createUnit and here the trouble starts.

I have to create the weapon proxies local to the server, because the players group or the group the Tigers crew is in could have 12 soldiers.
Now the weapon proxies are local to the server and everything works ok if the Tiger is local to the server also.
However if the Tiger is controlled by a player, moveincargo does not work  :'(

The script which (should) move the proxies into the cargo is executed by the init-Eventhandler of the Tiger and thus executed on all clients as well as the server.

Here is the important part of the script

Code: [Select]
_tiger = _this select 0
_weapon1 = _this select 1
_weapon2 = _this select 2

;;Array consisting of all Tigers in game
_index = (count BWMOD_Tiger_Array) -1;

?!(local BWMOD_Server): GoTo "InitPlayer"

#InitServer
_wpn1_mdl = format ["BWMOD_%1_Proxy",_weapon1]
_wpn2_mdl = format ["BWMOD_%1_Proxy",_weapon2]

call format [{_wpn1_mdl createUnit [getPos _tiger,group BWMOD_Server,"BWMOD_Tiger%1_LWpn=this"]},_index]
call format [{_wpn2_mdl createUnit [getPos _tiger,group BWMOD_Server,"BWMOD_Tiger%1_RWpn=this"]},_index]

call format ["publicVariable {BWMOD_Tiger%1_LWpn}",_index]
call format ["publicVariable {BWMOD_Tiger%1_RWpn}",_index]

_wpn1_mdl = Nil
_wpn2_mdl = Nil

#InitPlayer
@(call format["BWMOD_Tiger%1_LWpn",_index]) != objNull
@(call format["BWMOD_Tiger%1_RWpn",_index]) != objNull

_wpn1_proxy = (call format ["BWMOD_Tiger%1_LWpn",_index])
_wpn2_proxy = (call format ["BWMOD_Tiger%1_RWpn",_index])

_wpn1_proxy disableAI "MOVE"
_wpn2_proxy disableAI "MOVE"
_wpn1_proxy disableAI "TARGET"
_wpn2_proxy disableAI "TARGET"
_wpn1_proxy disableAI "AUTOTARGET"
_wpn2_proxy disableAI "AUTOTARGET"

_wpn1_proxy assignAsCargo _tiger
_wpn2_proxy assignAsCargo _tiger
_wpn1_proxy moveInCargo _tiger
_wpn2_proxy moveInCargo _tiger

So in conclusion, is there a way to move that damn weapon proxies into my Tiger?

I'm sure there is one and it is simple, however I'm to fustrated right now to continue trying because I did not get it working in the last two hours :(
« Last Edit: 10 Dec 2005, 01:21:19 by TeRpEnTiN »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:move unit local to server in cargo of vehicle local to client
« Reply #1 on: 06 Dec 2005, 19:13:21 »
I'll leave this here for now, although I am sure it belongs in Addon Editing.

It will possibly end up there at some point anyway.   ;D


Planck
I know a little about a lot, and a lot about a little.

Chris330

  • Guest
Re:move unit local to server in cargo of vehicle local to client
« Reply #2 on: 25 Dec 2005, 07:07:19 »
I am afraid I do not have anything to offer in the way of help, but I have done alot of scripting work and released a couple of well received addons (one was part of the P:UKF pack). I do not follow much of what you are saying in your post but would be keen to learn. If I pm'ed you my e-mail address would you explain some of it for me?

Maybe if you explained to me the brass tacks of what you're trying to do I could throw some light on it from a new angle? ;)

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:move unit local to server in cargo of vehicle local to client
« Reply #3 on: 25 Dec 2005, 18:37:32 »
afaik cpu intense addons are brought about by high polygon counts and high texture details, would it not be better to create these p3d elements/textures as hidden detail or on a very low polygon detail,  / close up LOD rather than a createunit command which in itself can be quite laggy, especially if that unit class hasnt existed in the mission yet

vehicles arent the issue anyway, they are used in limited numbers on a mission, unlike units

 its the (extremely well done, but useless for missions), high res/polygon count units that lag the game out, especially when you are running max groups etc
gimme 64*12 BIS or hyk units anyday instead of the more recent better quality stuff that is now being made ....
"Hey look at my awesome units, shame they aint any good for ya"

The BAS style "send 8 men in go and blow something up and extract" missions are about all that these units can be used for.

Does your addon really need such an unusual system???
« Last Edit: 25 Dec 2005, 18:51:45 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123