Home   Help Search Login Register  

Author Topic: Weird Parachute issue. Plz help  (Read 1431 times)

0 Members and 2 Guests are viewing this topic.

PRiME

  • Guest
Weird Parachute issue. Plz help
« on: 17 Jan 2003, 05:15:50 »
This is the second script I made to handle a start in parachute for all players and AI.

; eject.sqs
; ---------

_unit = _this select 0
_offset = _this select 1
_chp = _this select 2

@(parachuter) == 1
unassignVehicle _unit
_unit setpos [(getpos _chp select 0) +_offset , (getpos _chp select 1) +_offset, (getpos _chp select 2) +200]
_offset = "parachuteg" camCreate[(getPos _chp select 0) +_offset, (getPos _chp select 1) +_offset, (getPos _chp select 2) +130.5]
_unit moveindriver _offset

exit

Problem is it works, On the player screen tho all other chutes in the area show men droping to ground. On the main server it shows everyone in chute cept the other players...

Did anyone understand that? it seems the info is not getting to all the machines, it sometimes works but most the time doesn't. I am at a lost here, the script is executed in the Unit INIT btw!


PRiME

  • Guest
Re:Weird Parachute issue. Plz help
« Reply #1 on: 18 Jan 2003, 06:45:29 »
Basicly all the info doesn't get to everymachine. sometimes not even the server?


Heres another one I used at one stage.

; eject.sqs
;?!(local Server): Goto "Exit"
; ---------

_ch = chute
_chp = chp
_i = 0
_units = units Easy1
_n = count _units
_dur1 = 0
_dur2 = 0


#LOOP
   ~0.05
   _u = _units select _i
   _u setpos [(getpos _chp select 0) +_dur1 , (getpos _chp select 1) +_dur2, (getpos _chp select 2) +150]
   _ch = "parachuteg" camCreate[(getPos _chp select 0) +_dur1, (getPos _chp select 1) +_dur2, (getPos _chp select 2) +130.5]
   ~0.05   
   _u moveindriver _ch
   ;unassignVehicle _u
   _i = _i + 1
   _dur1 = _dur1 + 20
   _dur2 = _dur2 + 20

?(_i < _n) : goto "LOOP"

#Exit
exit



I have messed with Public variables but they have little effect.

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:Weird Parachute issue. Plz help
« Reply #2 on: 18 Jan 2003, 06:46:40 »
I had some nasty problems with parachuting in multiplayer missions as well.  I made one where you perform a HALO jump from a C-130, but had a lot of problems getting the ejection from the plane to work, as well as the actual parachuting.

Here are my findings:

1. You cannot use the action ["eject",player1] command in a script to force client-controlled players to eject.

2. You cannot spawn parachutes and move AI into the parachutes.  Doing so causes the AI to stop functioning after the unit has landed.  They'll move a little bit, but they will no longer follow the leader, and won't take any orders.

3. You cannot setPos a player-controlled unit out of a vehicle, otherwise he will be unable to use LAW/RPG/AT launchers.  I originally used setPos to get the units (player and AI) out of the C-130 so that they would free-fall until it was time to open the chute, but I found that I could no longer use a LAW launcher.

The solution:

In your script, add code that checks if the unit is a player or AI.  If the unit is a player, do what you've done: spawn a parachute and move the player into the driver position.

If the unit is AI, you'll have to do the lame, but operational instantaneous-move-chopper-then-eject method.  That is, place a flying friendly chopper somewhere in a remote corner of the map.  When it comes time for the AI unit to open his chute, use setPos to move the chopper to the unit's position, move the unit into the chopper's cargo, then force the unit to eject.  Next, move the chopper back to the remote corner.  When all units are done parachuting, delete the chopper and its crew to reduce some overhead.

As a side note, in the event that you are making these units "jump" out of a vehicle at the start (instead of simply starting in mid-air free-falling), the only way I could get around problem #3 above was to delete the aircraft.  Lame, but at least the jump works.
Ranger

PRiME

  • Guest
Re:Weird Parachute issue. Plz help
« Reply #3 on: 18 Jan 2003, 08:15:03 »
Yes I discovered these bugs as well, I am thinking of making the players already in a para once maps starts and having the intro use Dummy AI and then I can delete em after the intro.

PRiME

  • Guest
Re:Weird Parachute issue. Plz help
« Reply #4 on: 18 Jan 2003, 08:17:32 »
Place units in a parachute at start should be ok? then moving the parachutes with setpos? Iit shoudl work I will test it later.