Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Dragon on June 17, 2010, 05:29:17 pm

Title: Ramming
Post by: Dragon on June 17, 2010, 05:29:17 pm
Would that be possible to create a "Ram" operator, which would cause a ship to attack target just like Kamikaze, but instead of being destroyed, it'll be dealt the specified damage (target ship would be destroyed)?
It would be usefull for, for example, destroyers attempting to ram smaller ships, where the difference in size is large enough for the destroyer to come out alive.
Title: Re: Ramming
Post by: Shivan Hunter on June 17, 2010, 08:07:46 pm
you could hack this by setting the smaller ship to kamikaze and possibly using some of those new maneuvering SEXPs to control where the first ship goes. Aren't destroyers usually slower than other ships though?
Title: Re: Ramming
Post by: Aardwolf on June 18, 2010, 01:04:54 am
Well if there's a Fenris trying to blockade something, and it's facing the wrong way to be able to dodge, an Orion ought to be able to just plow straight through it, no problem.

The trick is indeed getting it to explode on cue.
Title: Re: Ramming
Post by: Colonol Dekker on June 18, 2010, 01:36:54 am
Distance less than?
Title: Re: Ramming
Post by: asyikarea51 on June 18, 2010, 01:48:39 am
I had a Hecate ram the backside of a Sathanas once but that was only because of the 1400 horsepower joke and the ensuing beat-up. :nervous:

For some reason this thread reminds me of the MOI issue.
Title: Re: Ramming
Post by: Goober5000 on June 18, 2010, 01:49:41 am
Well if there's a Fenris trying to blockade something, and it's facing the wrong way to be able to dodge, an Orion ought to be able to just plow straight through it, no problem.

The trick is indeed getting it to explode on cue.
That's easy.  Just plow the Orion right into it, and set the other ship to kamikaze.
Title: Re: Ramming
Post by: Scourge of Ages on June 18, 2010, 01:56:19 am
Distance less than?
I was just thinking that. You put your big ship on a waypoint that takes it through the other ship, and at distance-less-than whatever, self-destruct the little one. You'd have to be very careful to set it up right so that the distance is just right so that it'll explode on contact and not before, or at all.
Hmmmm, could you issue a ram order to the big ship, and set up another SEXP to clear orders when it got just close enough to the target? Inertia should carry it through, and then you can self-destruct the target.
Title: Re: Ramming
Post by: Dragon on June 18, 2010, 04:57:15 am
That's easy.  Just plow the Orion right into it, and set the other ship to kamikaze.
The problem is, I'd like an Orion to manouver like it was going to Kamikaze the ship. As far as I know, if something large is between a warship and a waypoint, the warship will try to fly around it. I'd me mostly interested in AI part of the SEXP, since destroying the rammed ship and dealing damage to one doing the ramming can be handled by other SEXPs. I only asked to include Kamikaze-like functionality into it due to potential problems that could arise from ship being rammed and not destroyed (I don't really know how the two should act in such case, I know that capship collisions sometimes behave awkwardly.).
Title: Re: Ramming
Post by: -Norbert- on June 18, 2010, 07:05:52 am
I see another problem with just putting the waypoint "though" the smaller ships. More often than not the big ships push each other away before they actually have any hull contact.
Title: Re: Ramming
Post by: Dragon on June 18, 2010, 08:25:42 am
That, or they intersect.
Title: Re: Ramming
Post by: sigtau on July 02, 2010, 02:20:06 pm
I see another problem with just putting the waypoint "though" the smaller ships. More often than not the big ships push each other away before they actually have any hull contact.

I can confirm this.  I had a corvette and an Orion duke it out, and the corvette jumped in dangerously close to the Orion--to the point of hitting it point-blank it--and pushed it out of the way before actual contact was made.
Title: Re: Ramming
Post by: FUBAR-BDHR on July 02, 2010, 02:35:43 pm
Yea that collision bug is already in mantis.  http://scp.indiegames.us/mantis/view.php?id=2222 (http://scp.indiegames.us/mantis/view.php?id=2222)
Title: Re: Ramming
Post by: Dragon on July 02, 2010, 06:41:10 pm
I also remember having an Argo effortlessly pass throught a Deimos, on retail (playing retail campaign, it was a long time ago).
It was flying waypoints and Deimos jumped in front of it.
Title: Re: Ramming
Post by: Snail on July 03, 2010, 05:52:21 pm
I also remember having an Argo effortlessly pass throught a Deimos, on retail (playing retail campaign, it was a long time ago).
It was flying waypoints and Deimos jumped in front of it.
Yeah that happens a lot in "Love the Treason..." especially. Some of the SOC loop missions, while epic, had shoddy FREDding work.
Title: Re: Ramming
Post by: Dragon on July 07, 2010, 06:58:24 pm
Indeed, there were some bugs which even most basic user campaigns avoid.
Maybe they were too difficult for beta testers to test. :)
Title: Re: Ramming
Post by: Mobius on July 07, 2010, 07:23:21 pm
That's easy.  Just plow the Orion right into it, and set the other ship to kamikaze.
The problem is, I'd like an Orion to manouver like it was going to Kamikaze the ship. As far as I know, if something large is between a warship and a waypoint, the warship will try to fly around it. I'd me mostly interested in AI part of the SEXP, since destroying the rammed ship and dealing damage to one doing the ramming can be handled by other SEXPs. I only asked to include Kamikaze-like functionality into it due to potential problems that could arise from ship being rammed and not destroyed (I don't really know how the two should act in such case, I know that capship collisions sometimes behave awkwardly.).

I would let the Orion fly on a collision course and then order the smaller ship to go kamikaze right before the collision. I wouldn't order it to do so earlier: if the smaller ship gets destroyed before the supposed impact, it would explode directly.

Code: [Select]
Set Kamikaze

-- op  when

---- <
------- distance
---------- Orion Destroyer
---------- Smaller Ship
------- X (insert value - distance)


---- op add-goal
------- Smaller Ship
------- op ai-chase
---------- Orion Destroyer
---------- 100

---- op kamikaze
------- X (insert value - damage)
------- Smaller Ship

If the smaller ship is already supposed to attack the Orion, the add-goal SEXP is not necessary. At this point, you simply need to find the optimal distance that allows you to trigger the ramming effect you intend to represent. Please note that collision detection (and its related problems) will not affect this. :)