Home   Help Search Login Register  

Author Topic: Moving the player  (Read 458 times)

0 Members and 1 Guest are viewing this topic.

Offline Colonel_Klink

  • Members
  • *
  • Independent Addon Creator
    • DC3D Game Modelling Zone
Moving the player
« on: 03 Jan 2003, 11:28:49 »
Ive been experimenting with the moveindriver command to place the player into a newly created vehicle using createvehicle. This works as long as the player isn't in a vehicle.
 Now I'm trying to remove the player from one vehicle and placing him in the new vehicle.
Is there a command to remove the player from a vehicle, before invoking the movein... command?
Thanks
Klink
« Last Edit: 03 Jan 2003, 11:35:32 by Colonel_Klink »
Rebel without a pause...D.I.L.L.I.G.A.F.

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:Moving the player
« Reply #1 on: 03 Jan 2003, 18:38:03 »
I know of three ways that'll get a player out of a vehicle.

1. Use the action command and force the player to eject.  This only works in single player or for the host-client in multiplayer.  It does not work for other clients in multiplayer.

Code: [Select]
unit1 action ["eject", vehicle1]
2. Use the setPos command.  Simply, set the player's position to anywhere on the map, and immediately move him into the new vehicle.  However, setPos causes an undesired side-effect.  From my experience, when setPos is used in this way, the player can no longer switch to a missile/rocket launcher weapon.  If you don't plan on using any such weapons, then by all means use this.  Otherwise, try option #3.

3. Delete the first vehicle with the deleteVehicle command, which will throw out any occupants.  The drawback is obviously that the vehicle will be gone from the game.  You can always create a new one in the place of the deleted one, but the stats (damage, fuel, and ammo) will not match, unless you set them.
Ranger

Offline Colonel_Klink

  • Members
  • *
  • Independent Addon Creator
    • DC3D Game Modelling Zone
Re:Moving the player
« Reply #2 on: 04 Jan 2003, 09:13:44 »
Thanks Ranger.
With a bit of experimenting I have found that using
Code: [Select]
unit1 action ["getout", vehicle1]works a real treat.

I've used moveindriver immediately and it also works.

And aha deletevehicle :) hadn't thought of that one.

Once again thanks. I'll post the results of my experiments here when they are done.
Cheers
Rebel without a pause...D.I.L.L.I.G.A.F.