Author Topic: In SP modules, moving PC variables from one module to the next  (Read 315 times)

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
In SP modules, moving PC variables from one module to the next
« on: September 23, 2012, 10:03:26 pm »


               Okay, SP module...PC finishes Chapter 1 with NPC conversations unresolved. Conversations with those NPCs has placed variables on PC. PC starts Chapter 2...uh oh, conversations with NPCs start all over because the game didn't save variables on the PC when it saved the PC's character at the end of Chapter 1.

So, how is this avoided? What script can be run at the end of the Chapter 1 module to save these variables and  what script can be run at the beginning of the Chapter 2 to reapply these same variables to the PC?

Or is my methodology wrong and there is a better way to accomplish this?
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
In SP modules, moving PC variables from one module to the next
« Reply #1 on: September 23, 2012, 10:06:30 pm »


               Variables aren't saved in a local vault environment.  It's why the OC uses tokens given by NPCs to transfer their story progression from chapter to chapter.
               
               

               
            

Legacy_jackkel dragon

  • Full Member
  • ***
  • Posts: 178
  • Karma: +0/-0
In SP modules, moving PC variables from one module to the next
« Reply #2 on: September 24, 2012, 02:43:19 am »


               There are two ways you can get variables to move across modules that I know of: tokens or databases.

With tokens, you give the PC an item to represent something (whether during the module or at the very end is up to you). In the second module, you check for this item and can then set a variable if you want to remove the item from the PC. Henchman in the OC use this system to determine whether you've hired them before and how far you've gotten in their quests (if you have their quest reward, the game knows you've finished their quest in the previous chapter.)

With databases, you use the campaign database functions to save variables. This uses the SetCampaign<Variable> functions and saves to a database in the databases folder of the player's game. The downside to this is that you can only have one database of a particular name at a time, so repeat plays can overwrite the old databases. SoU and HotU use the database system to move henchman equipment between modules and move some variables. One of the ways I've seen used to avoid the main pitfall of overwritten databases was used in the community module the HeX coda 01, where the player is able to save to one of three databases (the scripts involved alter which database is used). Another way would be to manually move the database files to another folder to backup the database, but that's a bit complicated for some players to keep track of.
               
               

               
            

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
In SP modules, moving PC variables from one module to the next
« Reply #3 on: October 06, 2012, 09:41:04 pm »


               Thanks all! This is exactly what I needed to know. I'm going the token route....
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
In SP modules, moving PC variables from one module to the next
« Reply #4 on: October 09, 2012, 02:50:02 am »


               You can store them on an item that in a bag also for single player games.