Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Droid803 on March 20, 2008, 01:01:28 pm

Title: Making a beam miss
Post by: Droid803 on March 20, 2008, 01:01:28 pm
Well, I've been lurking for a while...and I haven't seen this asked, so:

1. Is there a way to make a direct-fire beam miss using SEXPs? (something like fire-beam, preferably without having to add a horridly inaccurate beam table entry.)
2. Is there a way to tell if a beam hit or miss its target?

Thanks.
Title: Re: Making a beam miss
Post by: FUBAR-BDHR on March 20, 2008, 01:13:11 pm
First part is easy if the battle is scripted.  If the mod you are working on has some type of target you can use it.  Asteroids also work if they are in the mission.  If it doesn't just put a small ship at the max range of the beam on the firing line you want. Have it arrive right before the beam fires with no warp, fire the beam at it, and have it jump out with no warp or possibly ship vanish.  Also make it invisible to sensors.  It shouldn't be noticeable if you time it right.  Haven't tried it since retail so I don't know if there is a better way now or not.
Title: Re: Making a beam miss
Post by: haloboy100 on March 20, 2008, 01:21:23 pm
I think there should be a SEXP that makes a beam fire at a specific coordinates

and...
:welcomeblue:
enjoy your stay! ;)
Title: Re: Making a beam miss
Post by: blowfish on March 20, 2008, 06:13:49 pm
To make a beam miss, use an object that is non-collidable, like a navbouy or an asteroid.  If you have FS2_Open (which you SHOULD), then you can replace its texture with invisible and make it stealth, and no one will see it.  If you decide to use a navbouy you should probably deactivate glowpoints just for future-proofedness.

The best way I can think of to tell if a beam has hit is to see how much hull the target has left after the beam fires (possibly comparing it to how much it had before).  If you just want the beam to hit, I find that fire-beam with a specific subsystem is much less likely to miss its target.
Title: Re: Making a beam miss
Post by: Droid803 on March 20, 2008, 07:39:58 pm
Beam missing works like a charm.
However, the only problem is that my mission is in subspace, and setting the texture to be invisible (or any invalid texture), causes it to appear as black (like seeing through even the skybox). While that definitely would not be a problem under normal circumstances...the asteroid shows up quite well in the swirly-blue-white clouds of subspace :(

EDIT: although, setting a nav bouy, sending it VERY far away...its so small that noone will ever see it. That works wonders :D Since the whole exchange is scripted anyway, it should be easy to time when a beam is supposed to hit...and I guess that works 99% of the time. Good enough.
Title: Re: Making a beam miss
Post by: Roanoke on March 21, 2008, 07:03:26 am
That's a point. I wonder if there was any cannon info regarding cap-ship battles in subspace (other than the Lucifer) ? I thought there was but it was B5 I was thinking of.
Title: Re: Making a beam miss
Post by: Mobius on March 21, 2008, 11:56:58 am
To make a beam miss, use an object that is non-collidable, like a navbouy or an asteroid.  If you have FS2_Open (which you SHOULD), then you can replace its texture with invisible and make it stealth, and no one will see it.  If you decide to use a navbouy you should probably deactivate glowpoints just for future-proofedness.

I think sensor blips should have the same effect. In addition, you don't have to replace textures and deactivate glowmaps.
Title: Re: Making a beam miss
Post by: asyikarea51 on March 21, 2008, 01:05:48 pm
This sets me thinking, was this the same thing used in Derelict?
Spoiler:
That mission with the destroyed AWACS, the Orion and the enemy AWACS camping extremely far away with all the Erinyes fighters guarding it?
Title: Re: Making a beam miss
Post by: haloboy100 on March 21, 2008, 01:09:32 pm
yeah,
Spoiler:
Like when the orion snipes the AWACS from 10 kilometers away?
Title: Re: Making a beam miss
Post by: asyikarea51 on March 21, 2008, 01:16:07 pm
Yeah, that.

It was an
Spoiler:
Orion? Sniping the friendly AWACS? I thought it was something smaller that did the sniping.

Oh well, haven't played it in a long while now. Usually I play campaigns once and never come back to them... if I do, then it's a rare occurence... :nod:
Title: Re: Making a beam miss
Post by: haloboy100 on March 21, 2008, 01:19:24 pm
Ditto. But i actually remember the good moments :P
Title: Re: Making a beam miss
Post by: Flipside on March 21, 2008, 03:07:39 pm
Can you fire a beam at a Waypoint?
Title: Re: Making a beam miss
Post by: Droid803 on March 21, 2008, 04:02:18 pm
Doesn't show up in the "replace data" area in FRED.
I haven't tried "forcing" it to do so, though.
Title: Re: Making a beam miss
Post by: Mustang19 on March 24, 2008, 02:09:47 pm
In Derelict you had the Morgan Tech Orion snipe an AWACs because it "missed" the transport you're supposed to escort. Sync does this as well, with a Sobek "missing" it's target and hitting a Terran corvette... which supposedly triggered a second Terran-Vasudan war all on it's own. So it has happened before in user-made campaigns, although I've never seen someone make a beam deliberately miss and hit "nothing". Artifice IIRC actually had a table entry for an invisible beam target object, but I never saw it used.

Quote
Can you fire a beam at a Waypoint?

It'll probably crash the game, but try text editing and see what happens.

Quote
Beam missing works like a charm.
However, the only problem is that my mission is in subspace, and setting the texture to be invisible (or any invalid texture), causes it to appear as black (like seeing through even the skybox).

Odd. Invisible textures should be see-through. Look at the planet bitmaps; the planets are surrounded by a shade of puke green. That shade of green is the game's see-through color. Works fine for me.
Title: Re: Making a beam miss
Post by: Polpolion on March 24, 2008, 02:44:30 pm
Quote
the planets are surrounded by a shade of puke green

I really hope your puke doesn't look like that. :wtf:
Title: Re: Making a beam miss
Post by: haloboy100 on March 24, 2008, 05:56:41 pm
He means the alpha channel :P
Title: Re: Making a beam miss
Post by: Droid803 on March 24, 2008, 07:09:57 pm
Ya, I think I may try that.
Title: Re: Making a beam miss
Post by: blowfish on March 24, 2008, 07:14:11 pm
Quote
the planets are surrounded by a shade of puke green

I really hope your puke doesn't look like that. :wtf:

Its radioactive vomit! :nervous:
Title: Re: Making a beam miss
Post by: Goober5000 on March 24, 2008, 07:41:41 pm
although I've never seen someone make a beam deliberately miss and hit "nothing".
Derelict did that, in the mission where the Auriga was chasing the three civilian ships.
Title: Re: Making a beam miss
Post by: haloboy100 on March 24, 2008, 07:49:10 pm
How?
Title: Re: Making a beam miss
Post by: blowfish on March 24, 2008, 07:59:18 pm
It fires at a cargo container called "U Missed" which arrives (with no warp) right before the beam fires (it has a departure cue, but the beam will probably destroy it 90% of the time).
Title: Re: Making a beam miss
Post by: Goober5000 on March 24, 2008, 08:05:22 pm
Exactly the way people have been suggesting.  By making a small target ship appear a large distance away using "no arrival warp", then firing a beam at it.
Title: Re: Making a beam miss
Post by: blowfish on March 24, 2008, 08:08:44 pm
You should be able to replace the texture with invisible in most cases as well.
Title: Re: Making a beam miss
Post by: Kopachris on March 27, 2008, 08:02:41 pm
Make a small model with no texture, no engines, no anything.  It will appear gray in FRED, but invisible in the game.  Or at least, on FS2 open, converting the cob to pof with PCS1.
Title: Re: Making a beam miss
Post by: Droid803 on March 27, 2008, 08:57:07 pm
But using a Nav Buoy is so much easier :D
Title: Re: Making a beam miss
Post by: haloboy100 on March 27, 2008, 09:02:40 pm
To me people are making too much of a fuss over weather the object will be seen or not. If you actually do get a glance at a nav bouy or something the beam is firing at, you're only going to see it for a few seconds before the object is destroyed or disappears.
Title: Re: Making a beam miss
Post by: blowfish on March 27, 2008, 09:46:14 pm
Navbouys don't get destroyed.  They have no_collide enabled.  Its a good idea to have things depart before they can be seen though (eg. while the beam is firing)
Title: Re: Making a beam miss
Post by: Droid803 on March 27, 2008, 11:39:57 pm
Yea, but I need it to shoot there periodically. Tis a chase scene.
I should probably have more targets arrive and depart, however.
Title: Re: Making a beam miss
Post by: FUBAR-BDHR on March 28, 2008, 02:00:41 am
Here's a thought.  Put something small way off in the distance and limit the radar range so it can't be seen on radar.  Also make it invulnerable, stealthy, and invisible.  Then every time you want to fire at it you just use an event something like this

when
--> (what need to be true for it to fire)
-->set object position
----><target>
---->+
------->get-object-x
----------><ship to miss>
-------><x axis distance you want to miss by>
---->+
------->get-object-y
----------><ship to miss>
-------><y axis distance you want to miss by>
---->+
------->get-object-z
----------><ship to miss>
-------><z axis distance you want to miss by>
-->fire-beam
----><ship firing>
----><turret with beam>
----><ship to miss>
-->set object position
----><target>
----><original x position>
----><original y position>
----><original z position>


Note I've never tried this so I have no idea if it will work.  If it does you could even make it miss by random distances for a more realistic effect. 
Title: Re: Making a beam miss
Post by: haloboy100 on March 28, 2008, 02:12:32 am
How hard would it be to make a fire-at-coordinate SEXP? Sorry I have to stress this idea, but it might be worth the effort?
Title: Re: Making a beam miss
Post by: Kopachris on March 28, 2008, 07:39:59 am
How hard would it be to make a fire-at-coordinate SEXP? Sorry I have to stress this idea, but it might be worth the effort?
I think it would definitely be worth the effort!  Especially for a campaign with a mission in which one of your squad mates is being attacked with telepathy and goes crazy and shoots at one specific spot that doesn't have anything there.  Perhaps in a nebula...
Alpha 3: "What?  What's going on?  Who are you?"
Alpha 4: "Who are who?
Alpha 3: "Them!  They're here!"
Beta 1: "Who's here, pilot?"
Alpha 3: "I don't know!  Them!  They're in my mind!  They're sitting right in front of my ship!"
[Alpha 3 starts shooting at nothing, while a Shivan AWACS jumps in behind them]
Alpha 2: "Incoming jump signature, unknown configuration!"
Command: "Sensors are picking up some strange quantum pulses coming from that ship, not unlike what was used in Aken Bosch's ETAK project a few years ago."
Alpha 2: "Aken Bosch?  The rebel leader during the Second Shivan Incursion?"
Command: "Bosch's ETAK project was used to try to communicate with the Shivans.  It worked and Bosch escaped on a Shivan transport.  This ship appears to be the Shivan version of an AWACS device.  Sending in Delta wing now; destroy that ship, pilots!"

Kind of a challenge to destroy a ship when you're both getting bombarded with EM and your wingmen are going crazy...
Title: Re: Making a beam miss
Post by: karajorma on March 28, 2008, 11:54:06 am
How hard would it be to make a fire-at-coordinate SEXP? Sorry I have to stress this idea, but it might be worth the effort?

You'll really have to ask someone who knows more about the weapon code but I do know that the fire beam SEXP, the function it calls and the struct used to pass the info to it all require a target object.
Title: Re: Making a beam miss
Post by: Snail on March 28, 2008, 12:02:31 pm
Yeah, it can't be so hard to just add in a new Pharos beacon with invisible textures, friendly-ship-stealth and checking "no warp".
Title: Re: Making a beam miss
Post by: blowfish on March 28, 2008, 01:29:09 pm
Yeah, it can't be so hard to just add in a new Pharos beacon with invisible textures, friendly-ship-stealth and checking "no warp".

This apparently doesn't work in subspace though (not a problem for most missions).  Also disable glowpoints for future-proofedness (Firecrack's HTL pharos has glowpoints).
Title: Re: Making a beam miss
Post by: Snail on March 28, 2008, 01:43:26 pm
A better thing to do is to leave it there for the entire course of the mission. In this case, there will be no "Target Blip Arrived" in the F4 Mission Log, and no warp either.
Title: Re: Making a beam miss
Post by: Droid803 on March 28, 2008, 05:41:46 pm
Yea, I left it there the whole mission. The closest you get to it is around 15 clicks, and its stealth, and tiny. I guess you could see it if you really tried, but under normal circumstances, it should be stumbled upon. I hope.

I think it'll work in subspace if I gave it something like a texture that's got no alpha channel, but setting it to "invisible" (as in, no texture existing) didn't work as well as I wished.
Title: Re: Making a beam miss
Post by: haloboy100 on March 28, 2008, 05:44:33 pm
Well, since the texture of a pharos is white and blue, it might not even be visible > 20 klicks away in subspace, and in blank space, it might just be disregarded as part of the star field background.
Title: Re: Making a beam miss
Post by: Kopachris on March 28, 2008, 06:02:41 pm
What's wrong with in subspace?  Does FS2 make your jump drive not work in a subspace mission?  Then how are you supposed to exit subspace? :confused:
Title: Re: Making a beam miss
Post by: haloboy100 on March 28, 2008, 06:12:48 pm
Huh? how does this relate to this thread?
Title: Re: Making a beam miss
Post by: Kopachris on March 28, 2008, 06:18:35 pm
They said that the invisible ship idea wouldn't work in subspace, then they thought it might.  I'm confused :confused:
Title: Re: Making a beam miss
Post by: FUBAR-BDHR on March 28, 2008, 06:45:27 pm
A better thing to do is to leave it there for the entire course of the mission. In this case, there will be no "Target Blip Arrived" in the F4 Mission Log, and no warp either.

Isn't that what I said?  The only difference is my idea moves it into position for firing then moves it back.
Title: Re: Making a beam miss
Post by: FUBAR-BDHR on March 28, 2008, 08:41:50 pm
I've tested my theory.  It was a little harder than one simple event but is doable.  Basically it's 3 looping events that fire the beam first then move the target where you want the beam to fire (I know it seems backwards) then move it back.  It's backwards due to the beam warm up time.  Target needs to be where you want it when the beam actually fires not when the fire-beam is issued.  I'm attaching a semi-working test mission.  It needs refined for the beam cycle time and turret cone of fire but works for the first couple of shots. 

[attachment deleted by ninja]