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
_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