Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: FUBAR-BDHR on February 02, 2008, 01:16:08 pm

Title: Interesting quark with destroyed-or-departed-delay
Post by: FUBAR-BDHR on February 02, 2008, 01:16:08 pm
Spent hours last night trying to figure out why a simple event wasn't firing.  Standard scenario with multiple waves of fighters arriving until capship is destroyed.   Only thing unusual is that instead of arriving from the docking bay the fighters were set to arrive near the ship with a cue of not->is_destroyed_delay->capship.  Changed the arrival to the docking bay.  Still nothing.  I finally created a test mission with just the capship and fighters.  Same problem.  Gave up and went to bed.  Just created a new test mission in the original FRED2.  It worked.  Ran it in FS2_Open it worked.  Copied it to TBP and it still worked.  What was the difference?  I forgot to add the not->is_destroyed_delay->capship to the arrival cue of todays test mission.  Looks like destroyed_or_departed delay takes into ships that can never arrive due to the ship they are arriving from being destroyed but it does not take into account ships that can never arrive because of the arrival cue.  It also evaluates the arrival cue first even if the ship they are arriving from is destroyed. 

Scenario 1:  2 waves of fighters out of 3 arrive from docking bay before ship is destroyed arrival cue evaluates true. Works just fine

Scenario 2:  2 waves of fighters out of 3 arrive from docking bay before ship is destroyed arrival cue then evaluates false.  Doesn't work.

Scenario 3:  2 waves of fighters out of 3 arrive near ship before ship is destroyed arrival cue then evaluates to false.  Doesn't work.

Something doesn't seem quite right. 
Title: Re: Interesting quark with destroyed-or-departed-delay
Post by: jediben20 on February 06, 2008, 09:13:28 am
that seems like an awkward cue for a wave of fighters. I have no clue why it doesn't work, but i would add an event when>is_destroyed_delay>capship and then for the arrival cue I would change it to is event false>capship destroyed.

Just a couple questions:
a. are they launching from/near the same cap ship? (i.e. do they launch from the same capship that they shouldn't launch from if destroyed?)
b. is that capship there at the beginning of the mission?

Title: Re: Interesting quark with destroyed-or-departed-delay
Post by: karajorma on February 06, 2008, 10:18:58 am
I suspect this is one of those cases of NOT <SEXP name> not doing what you'd expect it to do if you don't think it through.

I say suspect cause quite frankly I'm having trouble figuring out what's going on unless I see an actual mission.
Title: Re: Interesting quark with destroyed-or-departed-delay
Post by: FUBAR-BDHR on February 06, 2008, 01:20:43 pm
I just got out of bed so I hope this is the right test mission.  This is the one that doesn't work.  If you change the arrival to true and the location to docking bay it will work.

Code: [Select]
#Mission Info

$Version: 0.10
$Name:  XSTR("Untitled", -1)
$Author: P4-3ghz
$Created: 02/02/08 at 13:29:36
$Modified: 02/06/08 at 14:16:51
$Notes:
This is a FRED created mission
$End Notes:

$Mission Desc:
 XSTR("Put mission description here
", -1)
$end_multi_text

+Game Type Flags: 1

+Flags: 0

+Disallow Support: 0

+Hull Repair Ceiling: 100.000000

+Subsystem Repair Ceiling: 100.000000

+Viewer pos: 0.000000, 1137.963013, -1911.199097
+Viewer orient:
1.000000, 0.000000, 0.000000,
0.000000, 0.866025, 0.500000,
0.000000, -0.500000, 0.866025


$AI Profile: TBP

#Command Briefing

#Briefing
$start_briefing
$num_stages: 0
$end_briefing

#Debriefing_info

$Num stages: 0

#Players ;! 1 total

$Starting Shipname: alpha 1
$Ship Choices: (
)

+Weaponry Pool: (
"40mm Pulse" 1
)

#Objects ;! 5 total

$Name: alpha 1 ;! Object #0
$Class: EA Aurora
$Team: Friendly
$Location: 0.000000, 0.000000, 0.000000
$Orientation:
1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000
$AI Behavior: None
$Cargo 1:  XSTR("Nothing", -1)
+Initial Hull: 100
+Initial Shields: 100
+Subsystem: Pilot
+Secondary Banks: ( "" "" )
$Arrival Location: Hyperspace
$Arrival Cue: ( false )
$Departure Location: Hyperspace
$Departure Cue: ( false )
$Determination: 10
+Flags: ( "cargo-known" "no-shields" "player-start" "invulnerable" )
+Flags2: ( )
+Respawn priority: 0
+Group: 0
+Score: 8

$Name: SCv Moloch 1 ;! Object #1
$Class: EA Nova
$Team: Hostile
$Location: -927.017578, 0.000096, 2443.569824
$Orientation:
1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000
$AI Behavior: None
+AI Class: EA Pilot
$Cargo 1:  XSTR("Nothing", -1)
+Initial Hull: 100
+Initial Shields: 100
+Subsystem: Pilot
+Subsystem: turret01a
+Subsystem: turret02a
+Subsystem: turret03a
+Subsystem: turret04a
+Subsystem: turret07a
+Subsystem: turret08a
+Subsystem: turret09a
+Subsystem: turret10a
+Subsystem: turret11a
+Subsystem: turret12a
+Subsystem: turret13a
+Subsystem: turret14a
+Subsystem: turret15a
+Subsystem: turret16a
+Subsystem: turret17a
+Subsystem: turret18a
+Subsystem: turret19a
+Subsystem: turret20a
+Subsystem: turret21a
+Subsystem: turret22a
$Arrival Location: Hyperspace
$Arrival Cue: ( true )
$Departure Location: Hyperspace
+Departure delay: 42
$Departure Cue: ( false )
$Determination: 10
+Flags: ( "no-shields" )
+Flags2: ( )
+Respawn priority: 0
+Orders Accepted: 0 ;! note that this is a bitfield!!!
+Group: 0
+Score: 440

$Name: leo 1 ;! Object #2
$Class: EA Aurora
$Team: Hostile
$Location: -906.857788, -0.000019, 954.657104
$Orientation:
1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000
$AI Behavior: None
$Cargo 1:  XSTR("Nothing", -1)
+Initial Velocity: 33
+Initial Hull: 100
+Initial Shields: 100
+Subsystem: Pilot
$Arrival Location: Hyperspace
$Arrival Cue: ( false )
$Departure Location: Hyperspace
$Departure Cue: ( false )
$Determination: 10
+Flags: ( "no-shields" )
+Flags2: ( )
+Respawn priority: 0
+Orders Accepted: 0 ;! note that this is a bitfield!!!
+Group: 0
+Score: 13

$Name: leo 2 ;! Object #3
$Class: EA Aurora
$Team: Hostile
$Location: -711.797180, 0.000034, 868.271484
$Orientation:
1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000
$AI Behavior: None
$Cargo 1:  XSTR("Nothing", -1)
+Initial Velocity: 33
+Initial Hull: 100
+Initial Shields: 100
+Subsystem: Pilot
$Arrival Location: Hyperspace
$Arrival Cue: ( false )
$Departure Location: Hyperspace
$Departure Cue: ( false )
$Determination: 10
+Flags: ( "no-shields" )
+Flags2: ( )
+Respawn priority: 0
+Orders Accepted: 0 ;! note that this is a bitfield!!!
+Group: 0
+Score: 13

$Name: leo 3 ;! Object #4
$Class: EA Aurora
$Team: Hostile
$Location: -749.161133, 0.000022, 639.453613
$Orientation:
1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000
$AI Behavior: None
$Cargo 1:  XSTR("Nothing", -1)
+Initial Velocity: 33
+Initial Hull: 100
+Initial Shields: 100
+Subsystem: Pilot
$Arrival Location: Hyperspace
$Arrival Cue: ( false )
$Departure Location: Hyperspace
$Departure Cue: ( false )
$Determination: 10
+Flags: ( "no-shields" )
+Flags2: ( )
+Respawn priority: 0
+Orders Accepted: 0 ;! note that this is a bitfield!!!
+Group: 0
+Score: 13

#Wings ;! 2 total

$Name: alpha
$Waves: 1
$Wave Threshold: 0
$Special Ship: 0 ;! alpha 1

$Arrival Location: Hyperspace
$Arrival Cue: ( true )
$Departure Location: Hyperspace
$Departure Cue: ( false )
$Ships: ( ;! 1 total
"alpha 1"
)
+Hotkey: 0
+Flags:( )

$Name: leo
$Waves: 6
$Wave Threshold: 0
$Special Ship: 0 ;! leo 1

$Arrival Location: Near Ship
+Arrival Distance: 1000
$Arrival Anchor: SCv Moloch 1
$Arrival Cue: ( not
   ( is-destroyed-delay 0 "SCv Moloch 1" )
)
$Departure Location: Hyperspace
$Departure Cue: ( false )
$Ships: ( ;! 3 total
"leo 1"
"leo 2"
"leo 3"
)
+Flags:( )
+Wave Delay Min: 20
+Wave Delay Max: 40

#Events ;! 2 total

$Formula: ( when
   ( destroyed-or-departed-delay 0 "leo" )
   ( send-message
      "#Command"
      "High"
      "test"
   )
)
+Name: Event name
+Repeat Count: 1
+Interval: 1
+Team: 0

$Formula: ( when
   ( has-time-elapsed 25 )
   ( sabotage-subsystem
      "SCv Moloch 1"
      "Hull"
      101
   )
)
+Name: Event name
+Repeat Count: 1
+Interval: 1
+Team: 0

#Goals ;! 0 total


#Waypoints ;! 0 lists total


#Messages ;! 1 total


$Name: test

$Team: -1
$MessageNew:  XSTR("true", -1)
$end_multi_text

#Reinforcements ;! 0 total


#Background bitmaps ;! 0 total

$Num stars: 500
$Ambient light level: 7895160
+Nebula: Nebula01
+Color: Blue
+Pitch: 343
+Bank: 339
+Heading: 346

#Asteroid Fields

#Music

$Event Music: None
$Briefing Music: None

#End

Title: Re: Interesting quark with destroyed-or-departed-delay
Post by: karajorma on February 07, 2008, 03:12:21 am
I'll try to take a look at that tonight.