Home   Help Search Login Register  

Author Topic: Dune Buggy Texture respawn problem  (Read 444 times)

0 Members and 1 Guest are viewing this topic.

Mox2002

  • Guest
Dune Buggy Texture respawn problem
« on: 01 Aug 2003, 17:33:46 »
Hi, Im building a racetrack with the Dune Buggy addon from Sebastian Muller in it.
The addon is great but it has one major flaw in MP, only the host sees
the textures once the vehicles has been destroyed and respawned.
The other players see only an empty frame.
Sebastian admits its a problem but gives the sollution to add the textures manually.
The problem is I dont know the correct syntax for fitting this into the respawnscript, maybe someone can help me out with this which would be great since its a superb addon and I'd hate to see it wasted cause of this
"bug".

Here's what Ive got sofar:

(AI)Respawn.sqs
======================================================
requiredVersion "1.91"
? not local Server : exit
_obj = _this select 0

_pos = getPos _obj
_dir = getDir _obj
_type = typeOf _obj
_group = group _obj
_crew = []
"_crew = _crew + [typeOf _x]" forEach crew _obj
"_x addEventHandler [""Killed"", {(_this select 0) removeAllEventHandlers ""Killed""; deleteVehicle (_this select 0)}]" forEach crew _obj

#clear
_t = 0

#alive
~3
? not alive _obj : _delay = 20; goto "notalive"

? fuel _obj == 1 : goto "clear"
? count crew _obj != 0 : goto "clear"

? _t == 0 : _t = _time + 20
? _t > _time : goto "alive"

"_obj removeMagazine _x" forEach magazines _obj
_obj setFuel 0
_obj setDamage 1
_delay = 10

#notalive
~_delay


;;;;; This is the point where I would like some help on;;;;;;;;;

deleteVehicle _obj
~1
_obj = _type createVehicle _pos
_obj setObjectTexture [0,"\Buggy\Tex\streifen01.pac"]
_obj setObjectTexture [1,"\Buggy\Tex\streifen01.pac"]
_obj setObjectTexture [2,"\Buggy\Tex\streifen01.pac"]


;;;;0-1-2 are textureslots for the Buggy.

=
_obj setDir _dir

? count _crew < 1 : goto "clear"
Soldier = []
_crew select 0 createUnit [_pos, _group, "Soldier = this"]
Soldier moveInDriver _obj
Soldier doMove getWPPos [_group, 1]
Soldier addEventHandler ["Killed", {(_this select 0) removeAllEventHandlers "Killed"; deleteVehicle (_this select 0)}]

? count _crew < 2 : goto "clear"
Soldier = []
_crew select 1 createUnit [_pos, _group, "Soldier = this"]
Soldier moveInGunner _obj
Soldier doMove getWPPos [_group, 1]
Soldier addEventHandler ["Killed", {(_this select 0) removeAllEventHandlers "Killed"; deleteVehicle (_this select 0)}]

? count _crew < 3 : goto "clear"
Soldier = []
_crew select 2 createUnit [_pos, _group, "Soldier = this"]
Soldier moveInCommander _obj
Soldier doMove getWPPos [_group, 1]
Soldier addEventHandler ["Killed", {(_this select 0) removeAllEventHandlers "Killed"; deleteVehicle (_this select 0)}]

goto "clear"
======================================================