Author Topic: Variable in a debriefing later in a campaign  (Read 2755 times)

0 Members and 1 Guest are viewing this topic.

Offline PotzUK

  • 28
    • PyroPort
Variable in a debriefing later in a campaign
I had this working once, but now it doesn't

Mission 1 - Campaign persistant variable $XYZ is set
Mission 2 - Debriefing has $XYZ in the text, but it gets displayed as $Squadron, instead of the variable.

Mission 2 follows Mission 1 in the campaign
Mission 1 has no debriefing
Mission 2 has no briefing

Does anyone have any ideas?  I'm using the lastest CVS build.

Calling the variable within the mission it's set seems to work OK
« Last Edit: August 27, 2006, 01:29:37 pm by PotzUK »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Variable in a debriefing later in a campaign
Submit it to mantis.

If you make a test campaign that does nothing other than set the variable in mission 1 and outputs it in mission 2 (both in mission and in the debrief) and attach it to the report then I'll almost certainly look at it quickly.

Saving me the bother of writing a test mission displaying odd behaviour makes it almost certain I'll check it more quickly because it drastically reduces the time I need free to start looking into the problem.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline PotzUK

  • 28
    • PyroPort
Re: Variable in a debriefing later in a campaign
I would, but I'm not sure how. 

I've created the account, but when I click Submit Issue, the only project I see is Inferno?

I've attached the two missions & campaign to this post, although in these two the variable doesn't seem to work at all in these test files (at least in the build I'm using at the mo).  In the campaign mission I have has  two messages use the $Squadron variable with no problem...

Essentially, in the actual campaign the player can choose their squadron name from 3 options given (by pressing 1, 2 or 3).  An event records the keypress using the key-pressed sexp and modifies the variable accordingly. 





[attachment deleted by admin]

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Variable in a debriefing later in a campaign
That's the wrong Mantis. HLP has it's own version for projects but you want the SCP mantis which you can find here.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline PotzUK

  • 28
    • PyroPort
Re: Variable in a debriefing later in a campaign
ahh, you may want to make the tab link @ the top a little clearer, at the mo it's labelled 'HLP Mantis' which is a little mis-leading :) 

I'll plop it up now

 

Offline PotzUK

  • 28
    • PyroPort
Re: Variable in a debriefing later in a campaign
Just tried to register on the proper Mantis, but I've not yet received the account password via email.  The Inferno one arrived within a few minutes so I know my spam filters aren't getting in the way... I'll check again in the morning - cheers Kara :)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Variable in a debriefing later in a campaign
The SCP mantis seems to have a longstanding vendetta against Yahoo and especially against Hotmail. You didn't use either of those to register did you?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline PotzUK

  • 28
    • PyroPort
Re: Variable in a debriefing later in a campaign
No, I used my own personal email - pyroport.com, the password hasn't arrived though :(

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Variable in a debriefing later in a campaign
Okay. I checked the mission. This wasn't an SCP bug at all but a misunderstanding in the way variable insertion into messages works on your part. I'm glad I had you build the mission cause otherwise I'd have spent ages trying to figure out what was wrong otherwise :)

Whenever you want to use a variable in a briefing, message or debriefing you put a $ in front of the variable name. This much you got. But what that refers to is only the text of the briefing, message or debriefing. You don't actually name the variable with a dollar sign in the name.

So when you included a message like this "The variable is currently set to $Squadron" the game doesn't find your variable cause it's looking for a variable called Squadron and all you have is a variable called $Squadron. The best thing you can do is rename the variable but updating the message to "The variable is currently set to $$Squadron" would probably work too.


That said this wasn't a complete waste of time. While working on this I uncovered a rather nasty bug that needs investigation :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline PotzUK

  • 28
    • PyroPort
Re: Variable in a debriefing later in a campaign
OK, that makes sense :)

But I renamed the actual variable from $Squadron to just Squadron which solved the message variable call, but the following mission still displays $Squadron :(

The variable doesn't have to be 'defined' in the second mission as well does it? 
« Last Edit: August 28, 2006, 08:15:55 am by PotzUK »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Variable in a debriefing later in a campaign
Yes it does. Squadron and $Squadron are completely different variables as far as the game is concerned. As far as it knows although Squadron exists as a persistent variable it's never used in mission 2 because no variable with that name exists in the mission file.

If you look at the variables in mission 2 you'll notice that at some point you defined $Squadron there too.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline PotzUK

  • 28
    • PyroPort
Re: Variable in a debriefing later in a campaign
OK, so despite the variable being campaign persistant, I have to 'define' the variable in the second mission... how do I tell the variable for Mission 2 to keep the value that was set previously?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Variable in a debriefing later in a campaign
Simply mark the variable as campaign persistant in the second mission too. The game will handle the rest.

I'm kinda surprised you're still having trouble with this in fact. You did it all correctly once before when you made the test campaign. You just simply picked the wrong name for the variable. All that needs to be done is to rename it in both missions.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

  

Offline PotzUK

  • 28
    • PyroPort
Re: Variable in a debriefing later in a campaign
Actually, I took a shortcut with the second mission - I just saved the first as under a different filename and forgot to remove the variable :)

That got it.

OK, for anyone reading this topic:

Set Variable mission
Define a variable in the event editor (Don't put a $ on the front of the name!)

Mission where variable is called
Do the same, using the same variable name as before

Call the variable using $VariableName where you need it...