Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Shivan Hunter on March 21, 2010, 03:31:23 am

Title: fire-beam apparently not working
Post by: Shivan Hunter on March 21, 2010, 03:31:23 am
OK. Long story, and it's 4:30 AM here so after I post this I'm going to bed.

I have three ships in my mission that are relevant to this problem: the GTCv FriendlyCorvette, the HostileCorvette, and the GTNB NavBuoy. In case it matters, the HostileCorvette is a custom ship (a Karuna with beamz). The FriendlyCorvette is a Deimos.

So, in an earlier battle the FriendlyCorvette is disabled (it's actually disabled by a SEXP, sabotage-subsystem <all engines>). I know this supposedly protects and beam-protects the ship, so I've used a SEXP to unprotect it later.

The HostileCorvette jumps in, sends a few messages, and fires a warning shot (a beam) at the NavBuoy (which is placed close to where the FriendlyCorvette will be at that point). A while later, it fires all four forward beams at the FriendlyCorvette... except, it doesn't. I've only once gotten it to actually fire at the FriendlyCorvette, and that was by breaking another aspect of the mission.

I tried moving the nav buoy back behind the FriendlyCorvette by using set-object-position and get-object-x/y/z. From what I can tell, the HostileCorvette won't fire on the navbuoy after it's been moved.

I tried making another nav buoy behind where the FriendlyCorvette would be at that point. The first time, the HostileCorvette shot sucessfully, but the second time, it missed by a somewhat large margin. This might work if I work it a bit, try to get the FriendlyCorvette to be disabled in a predictable location, but it's hackish and not a guaranteed solution.

I tried beam-unprotecting the ship after it was disabled. No effect. I added in a regular unprotect SEXP and it still didn't work. (technically I tried this first but whatever)

I tried using repair-subsystem, then the four fire-beam SEXPs, then sabotage-subsystem so that when the beams are told to fire, the ship is no longer disabled, but it's never noticeable. No effect. I removed the sabotage-subsystem SEXP, so it remained repaired. No effect. I moved the repair-subsystem SEXP into its own event so it happened a few seconds before the beams fired. Finally, success. But wait- now I have a magically-repairing ship in the mission.

I still haven't got a workable solution.

This is fire-beam, guys! I was under the impression that it, y'know, FIRED A BEAM. It's supposed to be very low-level control of how the mission plays out. I still haven't checked whether fire-beam would fire at a disabled or otherwise protected ship in retail. If so, this is technically a bug. Regardless, I don't like how it works.

Anyway, since this is FRED discussion- Solutions? Suggestions?

I'm going to bed now- will check in the morning. Or afternoon. Depending on when I get up.
Title: Re: fire-beam apparently not working
Post by: ReeNoiP on March 21, 2010, 04:00:16 am
A few things I can think of:

- Is the target within range of the beam?
- Did you try using "set subsystem strength" instead of "sabotage subsystem"?
- Do you lock the beam at some point? Make sure it's free.
Title: Re: fire-beam apparently not working
Post by: Aardwolf on March 21, 2010, 10:02:52 am
The beam shouldn't be free... if it were, it would fire at will.
Title: Re: fire-beam apparently not working
Post by: ReeNoiP on March 21, 2010, 10:20:40 am
Oh? They can fire when locked, using "fire-beam"? Well forget about the last one then.
Title: Re: fire-beam apparently not working
Post by: The E on March 21, 2010, 10:24:23 am
Actually, that is one of the points of fire-beam. It lets you control beam fire manually, and it may be desirable to disable automatic firing while doing so.
Title: Re: fire-beam apparently not working
Post by: Droid803 on March 21, 2010, 12:08:35 pm
Fire beam won't fire a beam if the target's out of the beam's fire arc.
Make sure it's actually in firing arc.
Title: Re: fire-beam apparently not working
Post by: Shivan Hunter on March 21, 2010, 01:06:24 pm
The beam is locked and likely out of range of its target; however, this point is moot, since it successfully fired on the nav buoy, which is located near the FriendlyCorvette.

The FriendlyCorvette is definitely in the HostileCorvette's firing arc. In fact, it's probably less then 5 degrees away from the beam turrets' normals.

Haven't tried set-subsystem-strength, but recall that repairing it actually did work at one point- it breaks the mission, since the 'vette really needs to stay disabled. It's incredibly obvious otherwise.
Title: Re: fire-beam apparently not working
Post by: Droid803 on March 21, 2010, 01:08:05 pm
Try setting the fire-beam to hit a specific subsystem?
Title: Re: fire-beam apparently not working
Post by: Shivan Hunter on March 21, 2010, 01:40:19 pm
Just tested. No effect.

[EDIT] I also gave the HostileCorvette an ai-chase order based on what happens in Their Finest Hour. Still nothing. I'm going to examine that mission more closely.
Title: Re: fire-beam apparently not working
Post by: FUBAR-BDHR on March 21, 2010, 02:03:39 pm
Trying to follow this.  You have a buoy that it will fire at at location X.  You have a disabled ship it won't fire at at location Y.  If you move the buoy to location X + some distance it will not fire.  This leads me to believe that the ship is out of the beams cone of fire.  What happens if you move the ship to location X?  If you do that and it fires then that would confirm it.  Some turrets have a very narrow code of fire or it's not pointed where you think. 
Title: Re: fire-beam apparently not working
Post by: Goober5000 on March 21, 2010, 04:01:01 pm
Make sure you're firing the right beam.  I was working on a mission where a corvette was supposed to fire its forward beams at another object, and a code trace revealed that it was being cancelled due to the target being out of its field of view.  It took me several minutes to figure out that I was actually firing the side beams as opposed to the front beams.
Title: Re: fire-beam apparently not working
Post by: Shivan Hunter on March 21, 2010, 05:38:24 pm
It's not a problem with the beams or the ship they're mounted on. In my first post, I said that the enemy corvette did fire at the friendly one - after I repaired the ship with a SEXP. As I said, I can't do that- it would completely ruin immersion and would be quite obvious.

It's a problem with the ship being protected since it's disabled. And a problem with fire-beam IMO, although if fire-beam was also this broken in retail there's not much the SCP can do about it.
Title: Re: fire-beam apparently not working
Post by: Droid803 on March 21, 2010, 07:32:49 pm
Can't you use SEXPs to get a ship's position and then set the nav's position?
Admittedly, this is very hackish. Firing beams directly at it should work :\
Title: Re: fire-beam apparently not working
Post by: Shivan Hunter on March 21, 2010, 08:06:56 pm
Can't you use SEXPs to get a ship's position and then set the nav's position?
Admittedly, this is very hackish. Firing beams directly at it should work :\

(http://i.cr3ation.co.uk/dl/s1/jpg/facepalm.jpg)


I tried moving the nav buoy back behind the FriendlyCorvette by using set-object-position and get-object-x/y/z. From what I can tell, the HostileCorvette won't fire on the navbuoy after it's been moved.

I know it's a long post, but could people at least check if I've already tried their solution? I've actually tried several variations on that one, all of which involve the beam not firing on the nav buoy after it's been moved. This is technically a bug, I know, and I'll mantis it soon, but I'd rather not wait for a bugfix.
Title: Re: fire-beam apparently not working
Post by: Droid803 on March 21, 2010, 08:36:47 pm
Blah, then just make a new nav buoy arrive in inside the corvette with no warp (near ship, distance 0), I don't know if FRED will let you do that though, so you might have to change it in notepad or something (to be honest, I don't know if FSO likes that either). That way you won't need to know where the corvette is though...
Title: Re: fire-beam apparently not working
Post by: General Battuta on March 21, 2010, 08:51:48 pm
There's no reason these gymnastics should be necessary, though. He's right. This ship should be a valid target.

Very odd.
Title: Re: fire-beam apparently not working
Post by: haloboy100 on March 21, 2010, 08:58:33 pm
Corrupt pilot files did it...

:nervous:
Title: Re: fire-beam apparently not working
Post by: Shivan Hunter on March 21, 2010, 08:58:51 pm
Blah, then just make a new nav buoy arrive in inside the corvette with no warp (near ship, distance 0), I don't know if FRED will let you do that though, so you might have to change it in notepad or something (to be honest, I don't know if FSO likes that either). That way you won't need to know where the corvette is though...

Distance probably can't be set to 0, but Notepad (or Vi :p) should take care of that. Thanks.

I'll mantis the thing about firing at the moved nav buoy later on. IMO, fire-beam should also ignore protect-ship (especially a hardcoded one that's not made clear at all!), and should be able to target waypoints as well. Just so I don't have to hide the nav using invisible textures and sensor magic.

[EDIT] @ Haloboy: lol

[EDIT2] So, I wasn't content with this hackish solution, and I went in and deleted the last half of the events in FRED, and rebuilt that part of the mission from scratch... and it worked. The enemy corvette even fires on the disabled corvette. And I have no idea why.

I'll try to reproduce the bug, but it may just have been some crazy event I put in somewhere.

:wtf: :wtf: :wtf: :wtf: :wtf: