Game Logic: loadGlobalDict

loadGlobalDict()
  • Loads a saved globalDict from your computer hard drive.
Note:
  • globalDict is saved/loaded from same directory as blend file
     
  • globalDict is saved/loaded with the blend name and an extension of .bgeconf
Example:
  • Castle.blend in C:\MyBlenderGame
  • bge.logic.saveGlobalDict() saves the globalDict in C:\MyBlenderGame as Castle.bgeconf
  • bge.logic.loadGlobalDict() loads Castle.bgeconf from C:\MyBlenderGame as the globalDict
Sample Code

################## load the saved Global Dictionary
  

# import bge
import bge

# load a saved global dictionary
bge.logic.loadGlobalDict()
   
# get the saved player 1 stats from the just loaded global dictionary
player1_Stats = bge.logic.globalDict["player1"]