Author Topic: Feature request: is-docked  (Read 2549 times)

0 Members and 1 Guest are viewing this topic.

Offline 666maslo666

  • 28
  • Artificial Neural Network
Feature request: is-docked
Id like to request a sexp or a script which checks if one ship is docked to another ship.

Why not use has-docked-delay, you ask? Because when that sexp becomes true, not even Chuck Norris can make it false again. I need something which works with repeated docks and undocks and also with different ships each time it is called. It is possible to do this with has-docked delay and has-undocked-delay, but the event would be prohibitively big to check all cases.
"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return." - Leonardo da Vinci

Arguing on the internet is like running in the Special Olympics. Even if you win you are still retarded.

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Feature request: is-docked
Could you store the docking status as a variable? Has-docked adds one, has undocked subtracts one, it should always be either one or zero unless you're dealing with multiple dockers.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline 666maslo666

  • 28
  • Artificial Neural Network
Re: Feature request: is-docked
Could you store the docking status as a variable? Has-docked adds one, has undocked subtracts one, it should always be either one or zero unless you're dealing with multiple dockers.

Thats what I am already doing (storing a name of docked ship or <nothing> and dock count), but it does not solve any of the issues. I still need separate checks for when a docker docks once, then when he docks second time etc ("number of times they have to have docked"). And yes, ideally this should also work with multiple dockers and dockees, since I am making kind of an open world mission when the player can dock ships around freely.
"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return." - Leonardo da Vinci

Arguing on the internet is like running in the Special Olympics. Even if you win you are still retarded.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Feature request: is-docked
Has-docked-delay can already handle this! The 4th argument is an integer representing the number of times the ship will have to have docked. So, what you need to do is link that 4th argument to a variable. Then, every time has-docked-delay becomes true, do a VARIABLE + 1. Then, as long as your 'when' event has multiple triggers, you can detect every time 2 ships have docked.

Now, I suppose it could be that you want to check every time a single ship is docked and that it doesn't matter what it could be docked to. That gets a little more difficult and I don't have a solution off the cuff, but if you need it, I'll think it through.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline 666maslo666

  • 28
  • Artificial Neural Network
Re: Feature request: is-docked
Has-docked-delay can already handle this! The 4th argument is an integer representing the number of times the ship will have to have docked. So, what you need to do is link that 4th argument to a variable. Then, every time has-docked-delay becomes true, do a VARIABLE + 1. Then, as long as your 'when' event has multiple triggers, you can detect every time 2 ships have docked.

Already tried this, didnt work, when it became true it stayed true no matter that variable was incremented. Ill try again, maybe I made a mistake somewhere...

Now, I suppose it could be that you want to check every time a single ship is docked and that it doesn't matter what it could be docked to. That gets a little more difficult and I don't have a solution off the cuff, but if you need it, I'll think it through.

Yes, please. It seems like a simple sexp/script to do, I was surprised it didnt exist already.
"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return." - Leonardo da Vinci

Arguing on the internet is like running in the Special Olympics. Even if you win you are still retarded.