Author Topic: A hole in space-time, maybe?  (Read 2850 times)

0 Members and 1 Guest are viewing this topic.

A hole in space-time, maybe?
I've got to lay out a few SEXP's before diving into the heart of the problem, though reading through them, you'll probably guess what I'm taking issue with.

This, at some point, returns true....

Code: [Select]
(ship arrival cue)
destroyed-or-departed-delay
--118
--GTFr Esso


These never return true....

Code: [Select]
(wing 1 arrival cue)
destroyed-or-departed-delay
--16
--GTFr Esso


(wing 2 arrival cue)
destroyed-or-departed-delay
--32
--GTFr Esso


(Objective)
and
--has-departed-delay
----0
----GTFr Esso
--not
----is-destroyed-delay
------0
------GTFr Esso


These are for reference (noting that the Moscow doesn't arrive or depart until much later in the mission)....

Code: [Select]
(wing 1 departure cue)
or
--has-departed-delay
----36
----GTD Moscow
--and
----or
------is-destroyed-delay
--------12
--------Mjolnir 1
------not
--------has-arrived-delay
----------0
----------Mjolnir 1
----or
------is-destroyed-delay
--------12
--------Mjolnir 2
------not
--------has-arrived-delay
----------0
----------Mjolnir 2
----or
------is-destroyed-delay
--------12
--------Mjolnir 3
------not
--------has-arrived-delay
----------0
----------Mjolnir 3
----or
------is-destroyed-delay
--------12
--------Mjolnir 4
------not
--------has-arrived-delay
----------0
----------Mjolnir 4
----or
------is-destroyed-delay
--------12
--------Mjolnir 5
------not
--------has-arrived-delay
----------0
----------Mjolnir 5
----or
------is-destroyed-delay
--------12
--------Mjolnir 6
------not
--------has-arrived-delay
----------0
----------Mjolnir 6


(wing 2 departure cue)
or
--has-departed-delay
----30
----GTD Moscow
--and
----or
------is-destroyed-delay
--------27
--------Mjolnir 1
------not
--------has-arrived-delay
----------0
----------Mjolnir 1
----or
------is-destroyed-delay
--------27
--------Mjolnir 2
------not
--------has-arrived-delay
----------0
----------Mjolnir 2
----or
------is-destroyed-delay
--------27
--------Mjolnir 3
------not
--------has-arrived-delay
----------0
----------Mjolnir 3
----or
------is-destroyed-delay
--------27
--------Mjolnir 4
------not
--------has-arrived-delay
----------0
----------Mjolnir 4
----or
------is-destroyed-delay
--------27
--------Mjolnir 5
------not
--------has-arrived-delay
----------0
----------Mjolnir 5
----or
------is-destroyed-delay
--------27
--------Mjolnir 6
------not
--------has-arrived-delay
----------0
----------Mjolnir 6


During testing, I made damn sure that the Esso departed every time, yet wings one and two never arrived, and the objective was never completed (successful or otherwise), but the individual ship's arrival cue returned true right on cue.  The in-game event log notes the Esso's departure, but something gets mucked up along the way after that.  I've got to say, I'm baffled about this one, as I've never run into this particular bug before.  I'm a little curious how the game comes to the conclusion that a ship can be destroyed/departed for two minutes without having first been destroyed/departed for thirty seconds.

I posted the departure cues for the wings, just for reference.  In each test, thus far, either five or six of the Mjolnirs referenced are in play, and the Moscow doesn't arrive (much less depart) until about eight minutes after the Esso departs.

I'll take any insights that anybody has to offer on this one....

It bears mentioning that this is retail FRED & FS2 (mis)behavior.

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: A hole in space-time, maybe?
Hmm. Well, one problem I can see immediately is "not, is-destroyed-delay. That will trigger immediately at the start of the mission because the criteria (not being dead) has been fulfilled, and so all that needs to happen is the departure of the esso. That would mean that if the esso is destroyed, then it would never trigger as has-departed would never trigger, but that's a gven anyway. I think the not, is-destroyed-delay is redundant.

I often run into obscure, seemingly random errors like this and find that one way to fix them is to isolate the offending sexp from the event I want it to trigger by using a variable as a middleman. It adds to your sexp nodes, but if it works, it works. Make an event like this:

when
 - or
 - - is destroyed delay
 - - - GTFr Esso
 - - - 16
 - - has-departed-delay
 - - - GTFr Esso
 - - - 16
 - modify variable
 - - Wing_1_WarpIn (initial value = 0)
 - - 1
 - send message
 - - warpin works.

And then set the arrival cue on the wing to

=
 - Wing_1_WarpIn
 - 1

The message from before is just to prove the event is firing. Once it works, you can delete that part of the event.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: A hole in space-time, maybe?
What is the arrival anchor for those wings? Subspace? Cause I can see them not arriving if you've given them something like Hangerbay -> Moscow
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • FLAMES OF WAR
Re: A hole in space-time, maybe?
HE's right about not-destroyed event..it will allways come true.

If you want to check if something survives, you have to link it with an AND expression and a event that happens near the ned..

EXAMLE - I want to check if the space station Harmony is still alive at the end of the mission. I take some event that happens near the end...like arrival of the GTCv Warspite.

WHEN
and
- has arrived delay
-- GTCV Warspite
--0
- not
---is-destroyed-delay
----Harmony
----0
-
send-message
-- Good work, the station is still alive!
Nobody dies as a virgin - the life ****s us all!

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

 
Re: A hole in space-time, maybe?
Quote
If you want to check if something survives, you have to link it with an AND expression and an event that happens near the end...

Which I did, if you'd look at the posted code.  Saying that part of the objective should have been prematurely true is completely beside the point, though, since the problem was that whole expression was never becoming true, even when it should have been.

On that note, there had been some additional baggage floating around in that objective, that I thought I had removed.  Once I well and truly got rid of it, the objective began to function properly.

Now that I'm poking around with the mission in Crimson Editor, it looks like I'm running up against a SEXP node limit for the individual mission....  Looks like I've got some work to do, consolidating and compressing some of this mission's scripting....

 
Re: A hole in space-time, maybe?
(Apologies for the double-post, but I felt the need for an update, if only to keep my thought-process straight.)

Right....  Still can't get either of these wings to show up, so here's the wing entry, pulled straight from the mission file.

Code: [Select]
$Name: Sinope                               [see note 1]
$Waves: 3
$Wave Threshold: 1
$Special Ship: 0 ;! Sinope 1

$Arrival Location: Near Ship                [see note 2]
+Arrival Distance: 4000
$Arrival Anchor: GTSG Mjolnir 1
$Arrival Cue: ( or                          [see note 3]
   ( is-destroyed-delay 16 "GTFr Esso" )
   ( has-departed-delay 16 "GTFr Esso" )
)
$Departure Location: Hyperspace
$Departure Cue: ( [omitted] )               [see note 4]
$Ships: ( ;! 4 total
"Sinope 1"
"Sinope 2"
"Sinope 3"
"Sinope 4"
)
$AI Goals: ( goals ( ai-chase "GTSG Mjolnir 4" 89 ) ( ai-chase "GTSG Mjolnir 5" 87 ) ( ai-chase "GTSG Mjolnir 1" 85 ) )
+Flags:( "no-dynamic" )
+Wave Delay Min: 12
+Wave Delay Max: 24

Note 1:  Sinope is wing seventeen of twenty in this mission file.  Neither it, nor any of the wings after it appear, but the two remaining are tied directly or indirectly to Sinope's arrival.  Despite appearing so far down in the list of wings, it actually shows up fairly early in the mission.

Note 2:  Kara's point about the arrival anchor seemed a very valid one, so I've spent a good chunk of time toying with that, today.  I've made Mjolnir 1 invulnerable to ensure that it's there, when Sinope needs to arrive; I've changed the ship Sinope is anchored to to another invulnerable ship, and I've set the arrival location to Hyperspace.  None have had any degree of success.

Note 3:  I did away with the destroyed-or-departed-delay operator, on the hunch that there might be a code bug mucking things up.  No dice.

Note 4:  The departure cue is unchanged from the original post.  I omitted it here to save space.

Note 5:  In order to cut down on the number of SEXP's used in-mission, the second wing, Cyllene, has its arrival tied directly to Sinope's.  Obviously, Sinope needs to be debugged before Cyllene can arrive now.

For reference, my next step is to reduce the overall number of SEXP's used in-mission.  I'll then test to make sure I've not broken anything else, before inserting some chatter and directive events that can double as triggers for is-event-true arrival cues or variable manipulators, in line with the solution Black Wolf offered.

After that, I think I'm going to have a walk around town, find a guy named Fred, and punch him in the face....

 

Offline Roanoke

  • 210
Re: A hole in space-time, maybe?
Copy you're event into a new mission, as a test, and see if it works then.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: A hole in space-time, maybe?
For reference, my next step is to reduce the overall number of SEXP's used in-mission.  I'll then test to make sure I've not broken anything else, before inserting some chatter and directive events that can double as triggers for is-event-true arrival cues or variable manipulators, in line with the solution Black Wolf offered.

If you know anyone who can playtest for you with Open let them have a try. If the mission works for them then it's probably the SEXP limit.

Running it through a debug version of FRED2_Open would also be another suggestion if you have someone else who can do it for you.

If neither of those work for you I don't mind taking a look at the mission for you. If I run it via the debugger I'll be able to look at the actual code as it executes and see exactly which SEXP is returning false when it should be returning true.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: A hole in space-time, maybe?
Okay. BlueFlame sent me the missions and once again proved that seeing a mission on the forums is no substitute for having it in front of you.

As soon as I did the departure cue jumped out at me in a way that it hadn't before. The problem is this part

-not
--has-arrived-delay
---0
---Mjolnir 1

The has-arrived, has-departed and is-destroyed SEXPs all work by checking the mission log for an entry from that ship. When a ship arrives the game will write a message to the log saying that the ship has arrived. Only problem is that for anything with an arrival cue of true that message isn't written. That means that not has-arrived will report true for any ship that was present in the mission at the time the mission started.

I still haven't had a chance to run the mission yet BlueFlames but I'd bet money that your problem is that the departure cue is evaluating to true before the arrival cue is and therefore preventing the wing from jumping in.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

  
Re: A hole in space-time, maybe?
Ah.  I wasn't aware of that nuance.  I'll try replacing not ( has-arrived-delay ( 0 "Mjolnir 1" )) with not ( [Mjolnir 1 arrival cue] ).  Mjolnir 1's arrival cue isn't 'true', but it's only based on is-previous-event-true/false operators, so it's either there from the start, or it never appears later.