Author Topic: Player-Persistent Variables  (Read 2757 times)

0 Members and 1 Guest are viewing this topic.

Offline FelixJim

  • 28
  • User 11092
Player-Persistent Variables
The wiki has led me to believe that a player-persistent variable modified in one campaign can be accessed from another campaign played with the same pilot. Now, either that's not true, I need to file a Mantis report or (most likely) I just don't know what I'm doing. Setting up two variables in different missions under the same name and default value seemed to work for campaign-persistent variables, but the same doesn't seem to hold true for ppvariables.
I've attached a test mod which highlights either the problem or my inability to FRED. Each campaign in it has the same single mission, which continually spews out training messages with a variable's contents. When the '1' key is hit the value of the variable is modified. Warp out and load up the other campaign, which has the same mission and therefore definitely the same variable, however, and the variable has reset itself.

I'd also like to mention that I haven't ignored "Please do not report bugs in the forum" notice on Random Tiger's launcher, but as I've said it's probably some oversight on my part rather than a problem in the code.

[attachment deleted by admin]
In-Mission Techroom Script v0.4 - See information from the techroom in game
Simple Animation Script v0.2 - Make your own on-screen animations for FSO
Visible Waypoints Script - Makes waypoints visible in-game
Run From File Script - Get around the pesky 31 character limit for script-eval

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: Player-Persistent Variables
I've never used a player persistent variable, but from this mission and camapign files you've uploaded it seems that it's currently not working properly, like if the variable is reseted every time the mission is over (or not saved at all).

Go on and put this in Mantis, I don't believe you made a mistake with the variables from what I saw in the file.
el hombre vicio...

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Re: Player-Persistent Variables
Ask Karajorma about these.
 
He's the guy to ask about this matter.
Campaigns I've added my distinctiveness to-
- Blue Planet: Battle Captains
-Battle of Neptune
-Between the Ashes 2
-Blue planet: Age of Aquarius
-FOTG?
-Inferno R1
-Ribos: The aftermath / -Retreat from Deneb
-Sol: A History
-TBP EACW teaser
-Earth Brakiri war
-TBP Fortune Hunters (I think?)
-TBP Relic
-Trancsend (Possibly?)
-Uncharted Territory
-Vassagos Dirge
-War Machine
(Others lost to the mists of time and no discernible audit trail)

Your friendly Orestes tactical controller.

Secret bomb God.
That one time I got permabanned and got to read who was being bitxhy about me :p....
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Player-Persistent Variables
If the wiki says that, then the wiki is the one in error here. Player persistent variables do not persist across campaigns and AFAIK were not designed to do so either. Either way this definitely isn't a bug that can be fixed (if we fixed it, it would break any campaigns which used the same names for persistent variables).

Taylor is currently in the process of upgrading the pilot file code and one of the things he is looking at is whether we should add a 3rd persistence type which isn't reset at the start of a campaign.
« Last Edit: June 20, 2010, 08:49:35 pm by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Player-Persistent Variables
What might be even better is one that is only reset at the start of a specific campaign.  Would let things like trilogies carry across from one campaign to the next but still reset when the first campaign is started again. 

I believe the new pilot file code is supposed to allow for multiple campaigns.  Maybe a campaign grouping is needed as well. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Player-Persistent Variables
There's no need for that though. You can simply have a modify variable at t=0 in the first mission of the campaign. :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Player-Persistent Variables
Yea but what if you want the player to have a ship from the previous camping not normally available unless you complete a bonus?  Or for that matter from part 1 in part 3?
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Player-Persistent Variables
I think I need to make things more clear. I can see the point in persistent variables that can be passed from one campaign to another.

But there is no need to have a special way to reset them. You could do that in the method I mentioned. The only thing that wouldn't work for is using variables in the mission briefing/team loadout for campaign 1 mission 1. But since you're meant to be resetting the value of the variables to the default you know what those variables should have been anyway and you probably didn't need to use variables there anyway.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: Player-Persistent Variables
I don't understand why there are two different types of variables if they both work same way, or there's a difference between player persistent and campaign persistent variables that I'm not getting right now?
el hombre vicio...

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Player-Persistent Variables
Player-persistent variables always retain the last value you gave them.  So if you add 1 to a variable called number-of-tries, it will count the number of times you tried to play a mission.

Campaign-persistent variables are treated like campaign information in the same way that goals and events are; their values only retain the value given them when you advance past a mission.  So if you add 1 to a variable called number-of-tries, it will only ever be 1 -- because it resets itself when you restart the mission.

  

Offline FelixJim

  • 28
  • User 11092
Re: Player-Persistent Variables
Taylor is currently in the process of upgrading the pilot file code and one of the things he is looking at is whether we should add a 3rd persistence type which isn't reset at the start of a campaign.
Would that mean access from multiple campaigns, or merely access from the same campaign if reset?

EDIT: Attempted to fix the wiki article as best I can, although I'm still not entirely sure where these Player-Persistent variables are stored and the like. It'll prevent anyone else from getting the impression I did though.
« Last Edit: June 21, 2010, 11:59:42 am by FelixJim »
In-Mission Techroom Script v0.4 - See information from the techroom in game
Simple Animation Script v0.2 - Make your own on-screen animations for FSO
Visible Waypoints Script - Makes waypoints visible in-game
Run From File Script - Get around the pesky 31 character limit for script-eval