Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Talon 1024 on September 08, 2015, 05:58:14 pm

Title: Tractor Beams
Post by: Talon 1024 on September 08, 2015, 05:58:14 pm
I managed to make working tractor beams in FS2_Open.


Beams with 0 damage and negative mass don't normally pull objects towards them, as you would probably expect them to. In order to get around this, I managed to write a simple lua script to pull an object towards the firing point of a beam.

I'd like to be able to remove the damage particles, but I don't think there's a way of doing so without modifying the ships.tbl entry.
Title: Re: Tractor Beams
Post by: AdmiralRalwood on September 08, 2015, 06:05:05 pm
Beams with 0 damage and negative mass don't normally pull objects towards them, as you would probably expect them to.
This is probably no longer true since this commit (https://github.com/scp-fs2open/fs2open.github.com/commit/1a0f2cf0e053dd0a2e7facd3ed5ea3603b01db01) was merged. If this is the case; sorry you had to go through all that work!
Title: Re: Tractor Beams
Post by: Trivial Psychic on September 08, 2015, 06:43:16 pm
One way to simulate tractor beams for towing would be to have a dockpoint floating some distance behind the towing ship, and have the towing beam have no mass at all.  The only thing we would need would be a way to force a beam to fire continuously until commanded to stop.  That way a ship can appear to be towing a target via the beam. A way to conceal the "Docked" status might also help.
Title: Re: Tractor Beams
Post by: Talon 1024 on September 08, 2015, 06:57:38 pm
Oh, well. I just tried deactivating the pull script, and setting the beam mass to -1000. It worked, but the ship being pulled didn't slow down as it approached the beam firing point, and the ship was being turned before it started floating towards the beam.

The last time I tried doing this (without scripting) was back when FSO 3.6.12 was out, and it didn't work for me at all back then.
Title: Re: Tractor Beams
Post by: AdmiralRalwood on September 08, 2015, 09:01:36 pm
Oh, well. I just tried deactivating the pull script, and setting the beam mass to -1000. It worked, but the ship being pulled didn't slow down as it approached the beam firing point, and the ship was being turned before it started floating towards the beam.
Yeah, there's (currently) no way to attenuate beam whack like you can damage, so the script-based approach may still be preferable.

The last time I tried doing this (without scripting) was back when FSO 3.6.12 was out, and it didn't work for me at all back then.
The commit I linked was extremely recent; it was just merged 3 days ago.