Home   Help Search Login Register  

Author Topic: Refueling Flight Script (ACCEPTED)  (Read 1858 times)

0 Members and 1 Guest are viewing this topic.

Offline Flaber

  • Members
  • *
    • Escuadron 13th TigerSharks
Refueling Flight Script (ACCEPTED)
« on: 03 Apr 2007, 21:39:50 »
I have been reading that would be nice to refuel aircrafts in flight, so I made a little script that I would like to share with you.

How it works.

Need a plane that will act as a gas station. (In this case i take an helicopter called cisterna).

need a trigger that will detect any aircraft closer than 30 mts to "Cisterna" .

If the aircraft is closer enought, Cisterna start bumping (i think is the right word) fuel to the second plane/chopper (0.01% / sec). so you need about 90 seconds to load fuel (it loads fuel only to 0.9)

I would like to know how it works in mp. and comments are always wellcome.

Thanks for your time, hope you enjoy it.

P.S. It's pretty dificult being close enought to Cisterna.

There are some words in spanish (If you think you need a translation, I could do it).
« Last Edit: 20 Sep 2007, 22:21:48 by Mandoble »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Refueling Flight Script
« Reply #1 on: 03 Apr 2007, 23:15:03 »
You may try to incorportate one of the following two things:

1 - Check that plane/chopper being refuelled is at the back of the tanker and a bit lower, not more than 10m. Then check that distance to tanker is kept (-+ 10m in horizontal and vertical) for 5 seconds, then you add a refuel action to the player. Once the player activates the action check that player's vehicle still keeps the distance while loading fuel.

2 - Once the player's vehicle is close enough, you simply add the refuel action to player's vehicle. When player activates it, the tanker starts to generate particles with a lifetime of 3 seconds, 0.5m sized, with some weight (the particles goes slight down, and pretty few rubber), A refuelling gamelogic is created too, you set an end-of-life script for every particle. That script just setPos the refuelling gamelogic at the end position of the particle when it dies (when particle dissapears that script will get the last position of the particle), now you check distance between player's vehicle and refuelling logic (instead of tanker). The "hose" of particles will represent the refuelling hose, the tail of that "hose" is everytime the last particle dissapearing and executing the script that will place there the refuelling gamelogic. So, as the tanker moves, the hose moves following tanker's path. Depending on tanker's type you may generate the hose starting from wings, or body, or even more than one hose (one comming out of each wing, etc).

Offline Flaber

  • Members
  • *
    • Escuadron 13th TigerSharks
Re: Refueling Flight Script
« Reply #2 on: 04 Apr 2007, 08:50:26 »
mmm nice.. i'll try to put all those things and see what happens, thank you.