Author Topic: Splitting campaign and transfering variables  (Read 1587 times)

0 Members and 1 Guest are viewing this topic.

Splitting campaign and transfering variables
Hey guys, due to time shortage my plans of releasing a campaign have been interrupted... But I think I'm at the right point in the campaign to split it into two different parts (~ 20 missions are done and there's even some kind of Cliffhanger...).

Iirc, with one of the last updates, a new kind of variable was introduced that let's you carry over the information of variables from one campaign to another. So am I right if I just need to copy via Sexp all the information (money available, ships, ammunition available and weapons gathered) during the campaign into these new variables, so they can be used by the pilot profile when starting the 2nd part later on?

I hope you get what I'm talking about... Since the time shortage won't go away any time soon, it would be a shame to just let these missions rot on the hdd... The story works well until here and all the missions are nearly complete.

Greatings!

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Splitting campaign and transfering variables
Yes that is correct. In the variable dialog box there is a check box for eternal variables, which will carry between campaigns.

 
Re: Splitting campaign and transfering variables
Wouldn't it be possible to save them as txts too? I think quite many use the 1-player-per-campaign rule, so it's quite likely that the progress won't be available if the rest will be released a couple years later.

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Splitting campaign and transfering variables
It's certainly possible to save as text (I've used that method before), but that requires a good amount of scripting knowledge and I wouldn't recommend that for this situation. I would imagine the player could just play through the first release again once the second release comes out.  :) 

 
Re: Splitting campaign and transfering variables
Sure (and I'm 90+% sure that this would be the best way to go).

Wouldn't it be possible to safe the stats via the checkpoint-script, than load them from another mission?

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Splitting campaign and transfering variables
Sure (and I'm 90+% sure that this would be the best way to go).

Wouldn't it be possible to safe the stats via the checkpoint-script, than load them from another mission?

Yeah, that could certainly be another route too, since the check-point script writes it's own save file :)

 

Offline 0rph3u5

  • 211
  • Oceans rise. Empires fall.
Re: Splitting campaign and transfering variables
Iirc, with one of the last updates, a new kind of variable was introduced that let's you carry over the information of variables from one campaign to another.

The feature existed since retail but the original descriptors were a bit misleading - the rework made it 99 percent more usable (give eternal thanks to the great Coder Gods of the SCP for that).

Note that any given mission can only referrence 258 (please verify) variables total - and I don't know what you are doing but I have noticed them piling up like crazy in campaigns with persistence :)

And there is a limit on the number of eternal variables, which I don't recall...
"As you sought to steal a kingdom for yourself, so must you do again, a thousand times over. For a theft, a true theft, must be practiced to be earned." - The terms of Nyrissa's curse, Pathfinder: Kingmaker

==================

"I am Curiosity, and I've always wondered what would become of you, here at the end of the world." - The Guide/The Curious Other, Othercide

"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Splitting campaign and transfering variables
I would strongly advise prefixing any eternal variables with the initials for your campaign. That way you don't get a situation where, for instance, a Blue Planet Hull-Strength variable gets overwritten by one from Between the Ashes.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Re: Splitting campaign and transfering variables
@0rph3u5

I think this won't be a problem since there are only around 50 variables until now....

@karajorma

The variables have their own names, so there won't be any kind of collision I guess...

But this sounds all very encouraging, thx for the replies. So expect the launch of my stuff around January, I guess  ;7

 

Offline Cyborg17

  • 29
  • Life? Don't talk to me about life....
Re: Splitting campaign and transfering variables
Just as a note, having separate pilots for separate campaigns or mods is no longer necessary since campaigns have independent saves now.  I just played through Diaspora, a Total Conversion, with the pilot I use for every other campaign.

 
Re: Splitting campaign and transfering variables
Oh that's certainly nice. I actually already did before the new pilot code came, with err, bad results. :warp:

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Splitting campaign and transfering variables
Iirc, with one of the last updates, a new kind of variable was introduced that let's you carry over the information of variables from one campaign to another.

The feature existed since retail but the original descriptors were a bit misleading - the rework made it 99 percent more usable (give eternal thanks to the great Coder Gods of the SCP for that).
Misleading descriptors I'll grant you, but it's not so much it existed since retail as everyone thought it existed since retail, because of the aforementioned misleading descriptors; no matter where the variable was stored, there was no way to share it between two campaigns. The fact that you eventually could in FSO was technically a bug.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Splitting campaign and transfering variables
Well persistence itself is an SCP feature not a retail one. But it's a very old SCP feature. So it had been around a long time before the bug occurred.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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