Author Topic: Problem with campaign file  (Read 2946 times)

0 Members and 1 Guest are viewing this topic.

Offline SF-Junky

  • 29
  • Bread can mold, what can you do?
Problem with campaign file
Code: [Select]

$Name: xy
$Type: single
+Description:
 XSTR("Storm Front Episode II - xy", -1)
$end_multi_text
$Flags: 0


+Starting Ships: ( "GTF Ulysses"  "GTF Myrmidon"  "GTF Loki"  "GTF Pegasus"  "GTF Valkyrie"  "GTF Perseus"  "GTF Hercules"  "GTF Hercules Mark II"  "GTF Erinyes"  "GTF Ares"  "SF Mara (terrans)"  "GTB Zeus"  "GTB Medusa"  "GTB Artemis"  "GTB Artemis D.H."  "GTB Ursa"  "GTB Boanerges"  "GVF Anubis Mark II"  "GVF Ulysses"  "GVF Thoth"  "GVF Ptah"  "GVF Horus"  "GVF Serapis"  "GVF Seth"  "GVF Tauret"  "GVB Osiris"  "GVB Amun"  "GVB Sekhmet"  "GVB Bakha"  "SF Manticore#Player"  "SB Seraphim" )

+Starting Weapons: ( "Avenger"  "Subach HL-7"  "Mekhu HL-7"  "Disruptor"  "D-Advanced"  "Akheton SDG"  "Flail"  "Morning Star"  "Prometheus R"  "Prometheus S"  "Maxim"  "Banshee"  "UD-8 Kayser"  "Leech Cannon"  "Lamprey"  "S-Breaker"  "Circe"  "Shivan Light Laser"  "Shivan Heavy Laser"  "Shivan Mega Laser"  "Red Death"  "Fury"  "Fang"  "Tempest"  "MX-50"  "Rockeye"  "Interceptor"  "Talon"  "Harpoon"  "Hornet"  "Tornado"  "Phoenix VI"  "Trebuchet"  "Stiletto"  "Stiletto II"  "EM Pulse"  "EMP Adv."  "TAG-A"  "TAG-B"  "Synaptic"  "Piranha"  "Cluster Bomb"  "Infyrno"  "Tsunami"  "Cyclops"  "Harbinger"  "Helios"  "MX-64#Shivan"  "Trebuchet#Shivan"  "Piranha#Shivan"  "Shivan Bomb" )


$Mission: BtM-01a.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   (
      ( is-previous-event-true
         "BtM-01a.fs2"
         "Red Alert"
      )
      ( next-mission "BtM-01b.fs2" )
   )
   ( ( true ) ( next-mission "BtM-01a.fs2" ) )
)

+Level: 0
+Position: 1

$Mission: BtM-01b.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   (
      ( is-previous-goal-true
         "BtM-01b.fs2"
         "Defend Saxony (p)"
      )
      ( next-mission "BtM-02.fs2" )
   )
   ( ( true ) ( next-mission "BtM-01b.fs2" ) )
)

+Level: 1
+Position: 1

$Mission: BtM-02.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   (
      ( is-previous-goal-true
         "BtM-02.fs2"
         "Oversee investigation (p)"
      )
      ( next-mission "BtM-03.fs2" )
   )
   ( ( true ) ( next-mission "BtM-02.fs2" ) )
)

+Level: 2
+Position: 1

$Mission: BtM-03.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   (
      ( and
         ( is-previous-goal-true
            "BtM-03.fs2"
            "Secure node (p)"
         )
         ( is-previous-goal-true
            "BtM-03.fs2"
            "Destroy Lilith (p)"
         )
         ( is-previous-goal-true
            "BtM-03.fs2"
            "Escort Saxony (p)"
         )
      )
      ( next-mission "BtM-04.fs2" )
   )
   ( ( true ) ( next-mission "BtM-03.fs2" ) )
)

+Level: 3
+Position: 1

$Mission: BtM-04.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   (
      ( is-previous-goal-true
         "BtM-04.fs2"
         "Defend Saxony"
      )
      ( next-mission "BtM-04cut.fs2" )
   )
   ( ( true ) ( next-mission "BtM-04.fs2" ) )
)

+Level: 4
+Position: 1

$Mission: BtM-04cut.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   ( ( true ) ( next-mission "BtM-05.fs2" ) )
)

+Level: 5
+Position: 1

$Mission: BtM-05.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   (
      ( and
         ( is-previous-goal-true
            "BtM-05.fs2"
            "Guard fleet (p)"
         )
         ( is-previous-goal-true
            "BtM-05.fs2"
            "Protect Science Cruisers (p)"
         )
      )
      ( next-mission "BtM-06.fs2" )
   )
   ( ( true ) ( next-mission "BtM-05.fs2" ) )
)

+Level: 6
+Position: 1

$Mission: BtM-06.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   (
      ( is-previous-goal-true
         "BtM-06.fs2"
         "Destroy Device (p)"
      )
      ( next-mission "BtM-07.fs2" )
   )
   ( ( true ) ( next-mission "BtM-06.fs2" ) )
)

+Level: 7
+Position: 1

$Mission: BtM-07.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   (
      ( is-previous-goal-true
         "BtM-07.fs2"
         "Defend fleet (p)"
      )
      ( next-mission "BtM-07cut.fs2" )
   )
   ( ( true ) ( next-mission "BtM-07.fs2" ) )
)

+Level: 8
+Position: 1

$Mission: BtM-07cut.fs2
+Flags: 0
+Main Hall: 0
+Debriefing Persona Index: 0
+Formula: ( cond
   ( ( true ) ( end-of-campaign ) )
)

+Level: 9
+Position: 1

#End

Can anyone please tell me why FS2 is showing me the outro of the FS2 single player campaign after BtM-04cut and then ends the campaign even if there remain three more missions? I just don't get it... again.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Problem with campaign file
You didn't use the end-campaign SEXP anywhere else did you? Cause you shouldn't be using it in the actual mission files unless you want to play a cutscene in that way.
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: Problem with campaign file
You didn't use the end-campaign SEXP anywhere else did you? Cause you shouldn't be using it in the actual mission files unless you want to play a cutscene in that way.
Wait, what?  I thought we disabled the ending cutscene if any campaign other than FS2 was being played.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Problem with campaign file
Doesn't look like it.

Code: [Select]
void sexp_end_campaign(int n)
{
// in FS2 our ending is a bit wacky. we'll just flag the mission as having ended the campaign
//
// changed this to check for an active supernova rather than a special campaign since the supernova
// code needs special time to execute and will post GS_EVENT_END_CAMPAIGN with Game_mode check
// or show death-popup when it's done - taylor
if ( supernova_active()  /*(Game_mode & GM_CAMPAIGN_MODE) && !stricmp(Campaign.filename, "freespace2")*/ ) {
Campaign_ended_in_mission = 1;
} else {
// post and event to move us to the end-of-campaign state.  There we will play a movie, then
// go to debriefing.
gameseq_post_event( GS_EVENT_END_CAMPAIGN );
}
}
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: Problem with campaign file
That's not the salient part of the code. :p

This is.  You need to see what GS_EVENT_END_CAMPAIGN does.  (Notice that you get two good endings!)
Code: [Select]
void mission_campaign_end_do()
{
// play the movies
event_music_level_close();
mission_goal_fail_incomplete();
scoring_level_close();
mission_campaign_mission_over();

// eventually we'll want to play one of two options (good ending or bad ending)
// did the supernova blow?
if(Supernova_status == SUPERNOVA_HIT)
{
// no soup for you!
movie_play_two("endpart1.mve", "endprt2b.mve"); // good ending
} else {
// no soup for you!
movie_play_two("endpart1.mve", "endprt2a.mve"); // good ending
}

#ifdef FS2_DEMO
gameseq_post_event( GS_EVENT_END_DEMO );
#else
gameseq_post_event( GS_EVENT_MAIN_MENU );
#endif
}

I've added code to not play those movies if we're not in the FS2 campaign.  In the future we might want to provide the option to play custom movies.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Problem with campaign file
:wtf:

That's not the salient part of the code. :p

Oh yes it is. :p I posted that code cause the comment is pretty much spot on about what will happen. The only mistake it made was claiming that only one movie would be played rather than two.

Quote
You need to see what GS_EVENT_END_CAMPAIGN does.  (Notice that you get two good endings!)

I did. Did you?

Quote
I've added code to not play those movies if we're not in the FS2 campaign.  In the future we might want to provide the option to play custom movies.

I think you need to take a really long look at the code. It doesn't do what you think it does.

If the SEXP is used the game will post GS_EVENT_END_CAMPAIGN which sets the state to GS_STATE_END_OF_CAMPAIGN which calls mission_campaign_end_do() which regardless of Supernova_status will call movie_play_two() with two movie file names.

None of which contains any code to check which campaign is being played. The game does actually test if the supernova is active. But it certainly doesn't if it isn't.


Finally, even if you had been right about everything since your first post (and I've actually tested this in game so I assure you that you are not) you've failed to consider that SF-Junky might possibly have chosen a rather stupid name for his campaign and called it freespace2.fc2 :p
« Last Edit: June 15, 2009, 06:31:31 pm 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: Problem with campaign file
:wtf:

That's not the salient part of the code. :p

Oh yes it is. :p I posted that code cause the comment is pretty much spot on about what will happen. The only mistake it made was claiming that only one movie would be played rather than two.
No, the part you quoted is only dealing with the end-campaign sexp.  That sexp has a very specific purpose, which is to clean up the campaign in the middle of a mission.  (In this respect, it's similar to the end-mission sexp, but with the important difference that it dumps you to the main hall instead of to the debriefing - notwithstanding that one comment.)

Taylor's fix was to make the end-campaign sexp work correctly with the supernova code.  There's nothing in that method that has anything to do with movies.  And taylor correctly interpreted end-campaign as being dependent on the supernova (which uses a specific timing, and set of events) rather than the main FS2 campaign (which would make any other supernova-ending campaign not work correctly).


Quote
Quote
You need to see what GS_EVENT_END_CAMPAIGN does.  (Notice that you get two good endings!)

I did. Did you?
:nod:  The end-campaign state, which I quoted, performs a very specific set of actions.  It cleans up the campaign data structures and it plays a set of movies.  My fix was simply to make those movies contingent on the main FS2 campaign.


Quote
I think you need to take a really long look at the code. It doesn't do what you think it does.

If the SEXP is used the game will post GS_EVENT_END_CAMPAIGN which sets the state to GS_STATE_END_OF_CAMPAIGN which calls mission_campaign_end_do() which regardless of Supernova_status will call movie_play_two() with two movie file names.

None of which contains any code to check which campaign is being played. The game does actually test if the supernova is active. But it certainly doesn't if it isn't.
I think you might be confusing what the code is supposed to do with what it does do.

I've committed my fix to trunk.  Take a look at it; the changes I made should clarify what I'm saying.


Quote
Finally, even if you had been right about everything since your first post (and I've actually tested this in game so I assure you that you are not) you've failed to consider that SF-Junky might possibly have chosen a rather stupid name for his campaign and called it freespace2.fc2 :p
If anyone is stupid enough to name their campaign file that, then they deserve what they get. :p

 

Offline SF-Junky

  • 29
  • Bread can mold, what can you do?
Re: Problem with campaign file
Finally, even if you had been right about everything since your first post (and I've actually tested this in game so I assure you that you are not) you've failed to consider that SF-Junky might possibly have chosen a rather stupid name for his campaign and called it freespace2.fc2 :p
Nah, I'm not that stupid. ;-)

And I also didn't use the end-of-campaign sexp instead of where it is supposed to be used: the end of the campaign. I can't see any logical explanation why FS2 does what it does. There is nothing wrong with the campaign file. Maybe I should re-do it with a more recent build?

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Problem with campaign file
You could also use the end-mission sexp.

If you want to avoid all issues, just don't use the end-campaign sexp within the mission.  You may, however, use the end-of-campaign sexp in (and only in) the campaign file.  (Please note, those are two different sexps used for two different purposes.  Yes, it's slightly confusing.)

If you want, take a look at ST:R's campaign file.  That's an example of something that works on both retail and on recent FSO builds.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Problem with campaign file
And I also didn't use the end-of-campaign sexp instead of where it is supposed to be used: the end of the campaign. I can't see any logical explanation why FS2 does what it does. There is nothing wrong with the campaign file. Maybe I should re-do it with a more recent build?

The problem isn't your campaign file. It's the mission file. Your problem is almost certainly down to you using the end-campaign SEXP in a mission when that SEXP should only be used in the main Freespace2 campaign. I'll go further and say that it's probably in BtM-04cut.fs2 and it's probably somewhere that you meant to use end-mission.

If you want to avoid all issues, just don't use the end-campaign sexp within the mission.  You may, however, use the end-of-campaign sexp in (and only in) the campaign file.  (Please note, those are two different sexps used for two different purposes.  Yes, it's slightly confusing.)

You are aware that's basically what I said in my first post in a much shortened form, right? I told him not to use end-campaign in the mission files. Not the campaign file, the mission files.

No, the part you quoted is only dealing with the end-campaign sexp.  That sexp has a very specific purpose, which is to clean up the campaign in the middle of a mission.  (In this respect, it's similar to the end-mission sexp, but with the important difference that it dumps you to the main hall instead of to the debriefing - notwithstanding that one comment.)

And that is exactly what I suspect the SEXP is being misused to do.

Quote
Taylor's fix was to make the end-campaign sexp work correctly with the supernova code.  There's nothing in that method that has anything to do with movies.  And taylor correctly interpreted end-campaign as being dependent on the supernova (which uses a specific timing, and set of events) rather than the main FS2 campaign (which would make any other supernova-ending campaign not work correctly).

:wtf:

Code: [Select]
else {
// post and event to move us to the end-of-campaign state.  There we will play a movie, then
// go to debriefing.

That's why I quoted that code. That's exactly what happens if you use the end-mission SEXP in a mission which doesn't have a supernova running. I'd bet money that's exactly what is happening to SF Junky.


Quote
:nod:  The end-campaign state, which I quoted, performs a very specific set of actions.  It cleans up the campaign data structures and it plays a set of movies.  My fix was simply to make those movies contingent on the main FS2 campaign.

Goober. I suggest you actually test this rather than to continue to tell me I'm wrong when I'm not. Make a mission. Make a second mission. Call end-campaign in the second mission. Stick them in a campaign file that isn't called Freespace 2. Run it in RC3. See?

I have already done this! Both movies are played. The symptoms match SF-Junky's symptoms exactly. Stop telling me I'm wrong on this.


Quote
I think you might be confusing what the code is supposed to do with what it does do.

I've committed my fix to trunk.  Take a look at it; the changes I made should clarify what I'm saying.

It clarifies that you patched the code to do what you claimed it did all along once you noticed that it didn't do what you thought it did. That's cheating. :p

I'm not the one confused. I haven't argued in the slightest about what it is supposed to do. If you'd said that the code shouldn't play the movies I would have agreed with you. But you have stated repeatedly that that code can't play the movies. I posted code that proved that the movies play.

It may be that wasn't the intention. It may be that was a bug. It may be that you have now patched that bug. I really don't care because that was never what I was on about.  None of that changes the fact that it currently does play the movies. Nor that since your patch is in trunk, 3.6.10 will also play the movies. Nor that the solution to SF-Junky's problem is to track down his usage of the end-campaign SEXP and remove it.

Quote
Quote
Finally, even if you had been right about everything since your first post (and I've actually tested this in game so I assure you that you are not) you've failed to consider that SF-Junky might possibly have chosen a rather stupid name for his campaign and called it freespace2.fc2 :p
If anyone is stupid enough to name their campaign file that, then they deserve what they get. :p

I wouldn't actually disagree with that but it was the first cause that leapt to mind cause I didn't know that the SEXP would play both movies until I looked at the code. The code itself being broken doesn't really change what the fix should be, finding the use of the end-campaign SEXP in one of the .fs2 files.
« Last Edit: June 16, 2009, 02:40:42 am by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline SF-Junky

  • 29
  • Bread can mold, what can you do?
Re: Problem with campaign file
 :snipe:
I'm soooo stupid. I indeed used the end-campaign sexp instead of end-mission in BtM-04cut.fs2. :doubt:

It is working now. Thank you very much, you two.

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Problem with campaign file
You're welcome. :)  (Not to solely claim credit; karajorma will be along shortly to say "you're welcome" as well. :D)

And now karajorma's going to like this. :D
Quote
I'm not the one confused. I haven't argued in the slightest about what it is supposed to do. If you'd said that the code shouldn't play the movies I would have agreed with you. But you have stated repeatedly that that code can't play the movies. I posted code that proved that the movies play.
I was increasingly going :wtf: on your posts until I found this paragraph, and now it all makes sense.  We were talking about exactly the same thing, but from two different contexts.  I was saying that "I thought the code does this; it turns out it doesn't do this; it should do this", and you apparently thought I was saying that "The code does do this."  Reread my posts; they should make more sense now. :)

I think we can conclude this thread by agreeing that a) the FS2 cutscenes shouldn't play automatically except during the FS2 campaign; b) the code in trunk has now been fixed to not do that; c) SF-Junky's problem has been fixed.

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Problem with campaign file
I don't know how you managed to think I was talking about that but fair enough. :p
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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