Home   Help Search Login Register  

Author Topic: Paradrop  (Read 1339 times)

0 Members and 1 Guest are viewing this topic.

Offline andersson

  • Members
  • *
  • I'm a llama!
Paradrop
« on: 21 Apr 2004, 14:14:46 »
First, this is NOT my script. Its a script from HAWKs C130 (HWK_c130.pbo).

I love that addon and the paradrop is great BUT there is a problem in MP.
Everything works fine except that the client-players dont get a parachute. The localserver-player are in a chute on all machines and all the AIs got their chutes.

It looks like there is no chute moved (or created) for the client-player.
I think the problem is something with the

_chute setpos (getpos (_allcrew select _c))  -> because I cant see a chute near the client-player

(_allcrew select _c) setpos (getpos _chute) -> because the client-player arent moved to [0,0,10]

(_allcrew select _c) moveindriver _chute -> becaúse the client-player arent moved away (into the chute createvehicled at [0,010])

Has anyone an idea of how to fix this script?

Quote
_helo = _this select 0
_allcrew = crew _helo

? (count crew _helo)<=2:exit
(group _helo) setspeedmode "limited"

_helo vehiclechat "Approaching Drop Zone, Jumpers hook the lines, check your gear, get ready to jump"

[_helo] exec "\HWK_c130\script\openramp.sqs"
_helo animate["jumpprepare",1]
_helo animate["r1",1]
_helo animate["r2",1]
_helo animate["r3",1]
~3.1

@ ((_helo animationPhase "rampa" > 0.5) and (_helo animationPhase "jump" == 1))
_helo animate["r1",0]
_helo animate["r2",0]
_helo animate["r3",0]
_helo animate["g1",1]
_helo animate["g2",1]
_helo animate["g3",1]

_helo vehiclechat "Green Light, Green Light, GO, GO, GO"
_helo say "eng20"
_array = []
"if (_x != driver _helo && _x != gunner _helo) then {_array = _array + [_x]}" foreach _allcrew
_allcrew = _array

? count _allcrew == 0 : goto "done"
_c = 0

#eject
_helo vehiclechat format ["%1, GO",_allcrew select _c]
unassignvehicle (_allcrew select _c)
(_allcrew select _c) action ["getout",_helo]
~0.1
_chute = "ParachuteWest" createvehicle [0,0,10]
_chute setpos (getpos (_allcrew select _c))
(_allcrew select _c) setvelocity (velocity _chute)
(_allcrew select _c) setpos (getpos _chute)
(_allcrew select _c) moveindriver _chute
~0.5

_c = _c + 1

? _c != count _allcrew : goto "eject"

~10
_helo animate["g1",0]
_helo animate["g2",0]
_helo animate["g3",0]
_helo animate ["jump",0]
_helo animate ["jumpprepare",0]
[_helo] exec "\HWK_c130\script\closeramp.sqs"
exit

Offline andersson

  • Members
  • *
  • I'm a llama!
Re:Paradrop
« Reply #1 on: 21 Apr 2004, 23:16:02 »
I been trying some things and I have a workaround now.

What I have done (I really needed a paradrop in one mission..) is this:

I placed a Game Logic  named "server" and a radiotrigger that executes this script (that are placed in the missionfolder) with the plane name in the array like this *[nameofhawksc130] exec "scriptname.sqs"*
So when you want to jump use the radiotrigger and then the group jump action.

Quote
_helo = _this select 0

;---NEW-----

?(local server):goto "local"

@!(player in _helo)
~0.1
_chute = "ParachuteWest" createvehicle [0,0,10]
_chute setpos (getpos player)
player setvelocity (velocity _chute)
player setpos (getpos _chute)
player moveindriver _chute

exit

#local

;----END NEW------

_allcrew = crew _helo

? (count crew _helo)<=2:exit
(group _helo) setspeedmode "limited"

_helo vehiclechat "Approaching Drop Zone, Jumpers hook the lines, check your gear, get ready to jump"

[_helo] exec "\HWK_c130\script\openramp.sqs"
_helo animate["jumpprepare",1]
_helo animate["r1",1]
_helo animate["r2",1]
_helo animate["r3",1]
~3.1

@ ((_helo animationPhase "rampa" > 0.5) and (_helo animationPhase "jump" == 1))
_helo animate["r1",0]
_helo animate["r2",0]
_helo animate["r3",0]
_helo animate["g1",1]
_helo animate["g2",1]
_helo animate["g3",1]

_helo vehiclechat "Green Light, Green Light, GO, GO, GO"
_helo say "eng20"
_array = []
"if (_x != driver _helo && _x != gunner _helo) then {_array = _array + [_x]}" foreach _allcrew
_allcrew = _array

? count _allcrew == 0 : goto "done"
_c = 0

#eject
_helo vehiclechat format ["%1, GO",_allcrew select _c]
unassignvehicle (_allcrew select _c)
(_allcrew select _c) action ["getout",_helo]
~0.1
_chute = "ParachuteWest" createvehicle [0,0,10]
_chute setpos (getpos (_allcrew select _c))
(_allcrew select _c) setvelocity (velocity _chute)
(_allcrew select _c) setpos (getpos _chute)
(_allcrew select _c) moveindriver _chute
~0.5

_c = _c + 1

? _c != count _allcrew : goto "eject"

~10
_helo animate["g1",0]
_helo animate["g2",0]
_helo animate["g3",0]
_helo animate ["jump",0]
_helo animate ["jumpprepare",0]
[_helo] exec "\HWK_c130\script\closeramp.sqs"
exit

IÂ'm leaving this thread open as this is just a temporary solution for one mission and IÂ'd like to see the internal script MP-compatible.