Author Topic: SEXP hits-left-subsystem Question  (Read 7611 times)

0 Members and 1 Guest are viewing this topic.

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
SEXP hits-left-subsystem Question
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.

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • FLAMES OF WAR
Re: SEXP hits-left-subsystem Question
How exactly did you set up the SEXP?

Write it down here so we can see it.
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXP hits-left-subsystem Question
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).
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: SEXP hits-left-subsystem Question
How exactly did you set up the SEXP?

Code: [Select]
$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:
« Last Edit: October 26, 2007, 10:56:08 am by Snail »

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • FLAMES OF WAR
Re: SEXP hits-left-subsystem Question
HM....the event looks good from here...Havn't got a clue :confused:
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: SEXP hits-left-subsystem Question
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.

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: SEXP hits-left-subsystem Question
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.
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: SEXP hits-left-subsystem Question
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.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXP hits-left-subsystem Question
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?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: SEXP hits-left-subsystem Question
And which build of FS2_Open are you using?

3.6.9, INF.
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: SEXP hits-left-subsystem Question
It is the SEXP. I created another test mission. The message doesn't appear until 11 minutes after I destroy the turret. :wtf:

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXP hits-left-subsystem Question
Post the mission and the bug in Mantis. I'll take a look at it later this evening.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Roanoke

  • 210
Re: SEXP hits-left-subsystem Question
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 ?

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: SEXP hits-left-subsystem Question
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...
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: SEXP hits-left-subsystem Question
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.

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • FLAMES OF WAR
Re: SEXP hits-left-subsystem Question
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
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXP hits-left-subsystem Question
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.

Code: [Select]
$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.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: SEXP hits-left-subsystem Question
:wtf: Okayyyyyy...

Is there an alternative?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXP hits-left-subsystem Question
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 that should deal with the problem.
« Last Edit: October 28, 2007, 09:21:52 am by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: SEXP hits-left-subsystem Question
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. :)
« Last Edit: October 29, 2007, 10:12:34 pm by Goober5000 »