Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Snail on October 25, 2007, 12:26:57 pm
-
Is there a bug in the SEXP hits-left-subsystem? In a certain campaign, I've got a friendly capital ship facing off an enemy capital ship. There are several ships attacking the enemy capital ship's main beam cannon. When the enemy ship's main beam cannon is damaged to below 70%, the enemy ship will depart. It is also set to depart should the friendly ship be destroyed.
Here's the thing: Even after integrity is below 70%, it does not depart. Only about a minute after the integrity is below 70% does the ship depart. Though it's not a fatal error, I would like to know why it's happening.
Good day.
-
How exactly did you set up the SEXP?
Write it down here so we can see it.
-
The leading suspect here has to be a delay on the departure cue.
The others in the line up would be :-
Engine Subsystems below 30% (and being repaired later).
AI-Warpout orders countermanded by higher priority orders
Event isn't actually triggering when you think it is (add a message to it and see when that plays).
-
How exactly did you set up the SEXP?
$Formula: ( when
( <
( hits-left-subsystem
"*******"
"turret07"
)
70
)
( send-message-list
"#Command"
"High"
"******* withdraws"
0
)
( add-goal
"*******"
( ai-warp-out 89 )
)
( ship-guardian-threshold
13
"Alpha 1"
)
)
+Name: ******* Departs
+Repeat Count: 1
+Interval: 1
+Team: 0
Ship guardian'd Alpha 1 so that when the ship jumps out, it doesn't ram him and kill him.
Engine Subsystems below 30% (and being repaired later).
AI-Warpout orders countermanded by higher priority orders
Event isn't actually triggering when you think it is (add a message to it and see when that plays).
The Engine subsystem is never repaired, so if that is the problem the enemy ship probably wouldn't depart at all.
The enemy ship actually has no orders initially, and just sits there vaping the friendly ship's escorting cruisers. Once that is finished, the enemy ship will turn to attack the friendly ship. Usually, its main beam cannon is disabled before the escorting cruisers are destroyed. I don't think that is the problem.
There's already a message, and it seems that the game isn't constantly checking to see if its below 70%. The event is not chained, either. From what I can see, the event isn't triggering when I want it to.
EDIT:
Aww **** I hope no one saw that. :doubt:
-
HM....the event looks good from here...Havn't got a clue :confused:
-
HM....the event looks good from here...Havn't got a clue :confused:
Yes I is not n00b.
It seems to me that the circumstances isn't being checked constantly.
-
Is there a bug in the SEXP hits-left-subsystem? In a certain campaign, I've got a friendly capital ship facing off an enemy capital ship.
INFA SA, I suppose. I'm also having strange problems(shared special hitpoints, ships whose class has changed crash the game when they jump in), there could be something wrong with FRED-INF.
-
I was trying to hide the fact it was INFASA. :\
But from what I know the only difference between FRED-INF and normal FRED is that the FRED-INF has boosted ship limits. But the coders are always hiding something.
-
Quite frankly I doubt the problem is what you claim it is. I can't think of any reason why a SEXP would be checked inconsistently. It would either be checked or not checked.
Eliminating the SEXP as the cause is easy. Make a test mission with just one event and check if the SEXP fires when it should do. If you can that to misbehave then is when I'd start looking at the SEXP as the cause of this problem. Till then the smart money is on eliminating the mission as the cause first.
Does the message play only seconds before the ship jumps out?
And which build of FS2_Open are you using?
-
And which build of FS2_Open are you using?
3.6.9, INF.
-
It is the SEXP. I created another test mission. The message doesn't appear until 11 minutes after I destroy the turret. :wtf:
-
Post the mission and the bug in Mantis. I'll take a look at it later this evening.
-
gotta be the ship guardian ? I'd try and add a "not-facing" check instead (if that can be applied to AI ships ofcourse, haven't been in FRED for ages).
Not being funny but you did specify the correct turret ?
-
It is the SEXP. I created another test mission. The message doesn't appear until 11 minutes after I destroy the turret. :wtf:
I can't believe it.
Not being funny but you did specify the correct turret ?
It could be possible(no offense), we would all prefer it to a bug. But there are too many strange things about FRED INF, too many...
-
Not being funny but you did specify the correct turret ?
Yes. Definitely.
Post the mission and the bug in Mantis. I'll take a look at it later this evening.
Can you pop down to Inferno Alliance Internal? The mission should be in the last page of the first non-sticky thread. Thanks.
-
Heh..I never implied you're a newb Snail, sorry if you got that impression.
It's just thet even the best of us sometimes make n00bish mistakes :p
-
Okay. It's not a bug. Seems like the code is meant to work like that. :wtf:
Apparently Hits-left-subsystem doesn't work the way you would think it does. If use the following SEXP
when
- <
--hits-left-subsystem
---Ship Name
---Turret 01
---90
I'd probably expect the game to trigger that as soon as the turret hits 90%. That's not what the game does though. Instead it looks at what type of subsystem this is (a turret) and then works out how much damage has been done to all the turrets on that ship and then gives you the average. What I'm wondering now is how come in 7 years of FREDding I've never noticed this! :wtf:
Apparently though I'm not the only person confused by this one though. For instance look at this piece of FREDding from bearbaiting.
$Type: Primary
+Name: GUN 1b
$MessageNew: XSTR("Destroy Sathanas forward beam cannon 1", 1567)
$end_multi_text
$Formula: ( or
( =
( hits-left-subsystem
"Sathanas"
"turret01"
)
0
)
( is-subsystem-destroyed-delay
"Sathanas"
"turret01"
0
)
)
+Invalid
I suppose if I'd looked carefully enough I might have wondered why there was a completely redundant check for the turret being destroyed if the SEXP already checks if it has 0 hits left. Now it's obvious that James Agay tested the hitpoints first and after scratching his head/screaming at the monitor over why it wasn't working he just checked if they were destroyed too.
The calculations for engines are even stranger. The game will do the averaging normally until it gets below 15%. After that as long as any engine is running the game will report any of them as being at 15% even though the subsystem may even have been destroyed and the only engine left is at 1%
From the looks of it your ship was simply remaining in the mission until all of its turrets had taken 50% damage and then it could leave. I can't really start changing the hits-left-subsystem SEXP as it's been used in who knows how many campaigns which have no doubt been balanced on the weird behaviour it displays. I will however alter the text for it in FRED and make a new SEXP that works the way you would think it should work.
-
:wtf: Okayyyyyy...
Is there an alternative?
-
I should be able to cook up a working SEXP pretty easily. Part of the code does what we want. I simply need to get it to skip all the adding stuff together and taking the average nonsense.
EDIT: Posted a build (http://www.hard-light.net/forums/index.php/topic,50266.new.html#new) that should deal with the problem.
-
Err... weird. :wtf:
Looks like the original design should have been hits-left-subsystem plus hits-left-subsystem-type.
EDIT: On further thought, maybe we should "fix" it, even though it would change the original behavior. The reason is that this bug will show up in a very small number of cases: those being sexps which refer to a subsystem type that has more than one instance on the model (most likely engines or turrets). Ninety-nine percent of those cases would use is-subsystem-destroyed, leaving 1% questionable. That 1% might be a small enough margin to risk experimenting on. :)
-
Now that I think about it, I sometimes did run into problems getting specified turrets on ships to stay alive using a repeating event that reset the turret's strength whenever it fell too low. I always assumed that the strength was going down too fast for the event to fire in time, but this would explain it. This was back in the retail days, when we didn't have ship-subsys-guardian-threshold.
-
EDIT: On further thought, maybe we should "fix" it, even though it would change the original behavior. The reason is that this bug will show up in a very small number of cases: those being sexps which refer to a subsystem type that has more than one instance on the model (most likely engines or turrets). Ninety-nine percent of those cases would use is-subsystem-destroyed, leaving 1% questionable. That 1% might be a small enough margin to risk experimenting on. :)
What I did (eventually :rolleyes:) was add a 3rd argument.
By default the game will how the usual behavior. If you supply the 3rd argument (and it evaluates to true) then the game ignores type and simply works out the actual hits left of the subsystem mentioned. That way there is no need to alter the default behaviour and FREDders can still easily get what they probably want to happen.
One reason I was reluctant to actually fix it because of the way the SEXP is used in Argonautica. The SEXPs appear to repair the engine sequentially but cause of the weird design of the SEXP they'll all be repaired at the same time. It's obvious the mission has been balanced for that and if it suddenly starts taking longer to get the engines all working again that could have knock on effects. Especially if that thing about engines having to be at 30% for warpout hasn't been fixed yet.
-
I wouldn't like fixes like that since we'll get newbies popping up everywhere screaming about it.
-
(http://www.hard-light.net/forums/Smileys/HLP/necrodq3.png)
I'd use the other thread but N00ber5000 locked it. :doubt: (http://www.hard-light.net/forums/index.php/topic,50266.new.html#new)
That 3.6.10 build doesn't solve the problem. I have Snail's same problem in the same mission. Only difference is the value, lowered to about 50.
-
Did you add the 3rd argument?
-
I told him over MSN but he doesn't seem to get the point.
-
You mean:
-and
--hits-left-subsystem
<
<value>
--not
is-subsystem-destroyed-delay
etc. etc.
?
-
Yep, I think that's how it works.
-
No. I mean
-hits-left-subsystem
--Ship
--Subsystem
--TRUE
If you miss the 3rd argument it goes back to being false and you end up with the strange effects I mentioned in my earlier posts.
-
That
+
-and
--hits-left-subsystem
<
<value>
?
-
That's not even possible. FRED simply won't accept that. Do what I posted. Add the third parameter and set it to true.
-
Aaah, my mistake! The 3rd argument of the SEXP!!!
Thanks! :yes: