Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Nuke on July 08, 2004, 03:37:22 am

Title: player controled docking/passive rearm vessels
Post by: Nuke on July 08, 2004, 03:37:22 am
would it be possible to implement player controlled docking? that allows the player to manually line up with a dock point and connect to another ship.  you couls say fly a mission where you have to land marines or whatever on a capship. also it would be cool to be able to rearm from a capship instead of a rearm vessel so that you actually have to go to that vessel and dock with it in order to get a rearm/repair. would it also be possible to use the target info box to act as a dock cam that shows the ship to be docked with in relation to the normal of the dockpoint on the ship? it sounds crazy but i think it would be kinda fun
Title: player controled docking/passive rearm vessels
Post by: WMCoolmon on July 08, 2004, 03:49:03 am
When player-use-ai is implemented, you could probably do this via SEXPs.
Title: player controled docking/passive rearm vessels
Post by: Nuke on July 08, 2004, 04:14:27 am
well that would kinda work, but i was more thinking of having the chalenge of docking and a cool little dock gauge like you see in scifi movies. but i guess i ask too much.
Title: player controled docking/passive rearm vessels
Post by: Goober5000 on July 08, 2004, 10:57:12 am
All you have to do is
Code: [Select]
when
  key-pressed
   
  player-use-ai
  add-goal
   
    ai-dock
     
and
Code: [Select]
when
  has-docked
   
   
    1
    0
  player-no-use-ai
except for the fact that player ai docking doesn't work 100% correctly yet.  Freespace doesn't have the fine-tuned thruster control you'd need for what you're asking for.
Title: player controled docking/passive rearm vessels
Post by: Nuke on July 08, 2004, 09:57:48 pm
i was thingking about havint to manuver to a close proximity and lign up to within a certain tolderance then youd automatically connect. having the ai do it seems abit easy.
Title: player controled docking/passive rearm vessels
Post by: WMCoolmon on July 08, 2004, 10:07:26 pm
You could use the is-facing training SEXP. (Not sure about the name)

Edit: There might also be an get-distance-between-ships SEXP you could use too. At the very least you could use get-object-coords and find the distance from the two vectors.
Title: player controled docking/passive rearm vessels
Post by: Goober5000 on July 09, 2004, 09:41:46 am
The problem is that most docking paths cause the docker ship to move away from the dockee if it's too close.  So that invalidates your whole premise.

We could hack the docking routines to make the ships immediately jump to a docked position, like magnets snapping together, but that would feel jarring and look very weird.
Title: player controled docking/passive rearm vessels
Post by: Nuke on July 10, 2004, 01:48:05 am
how about an is- dock-aligned sexp

you could put in a minimum distance, and angle threshold you must achieve. the dock points would need to be < distance and the normals would have to be 180 degrees apart - angle threshold. it will return true if you get your dock point within the distance and angle specified in the sexp. so it would take some skill to align the dock. it would be like get close enough and the docking clamps could reach out and grab the ship. but if you hand the ship over to ai then youd have to come up with a way to make the ai forgo the path and just dock to the point. then you would just need a dock camera view and maybe a gauge of sorts.

for the capship rearming youd need a way to make the capship do the rearm. fred flag perhaps?