Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 3.17 KB | None | 0 0
  1. load_game_state
  2.     Options: Function
  3.     Return Type: Boolean
  4.     Parameters
  5.         save_slot = 0 <Integer>
  6.     Grammar Text: load_game_state(save_slot)
  7.     Hint Text: (None)
  8.     Custom Script Code
  9.     Local Variables
  10.         force = 0 <Integer>
  11.         upgrade = 0 <Integer>
  12.         unit = No Unit <Unit>
  13.         unit_slot = 0 <Integer>
  14.         success = False <Boolean>
  15.     Actions
  16.         Debug - debug_s(("*** LOADING GAME STATE *** slot" =  save_slot, ""), False, False)
  17.         ------- INDICATE THE LEAVING OF NORMAL GAME STATE
  18.         Variable - Set in_game = False
  19.         ------- IF INVALID, DO NOTHING
  20.         General - If (Conditions) then do (Actions) else do (Actions)
  21.             If
  22.                 save_slots[save_slot].valid == False
  23.             Then
  24.                 Debug - message_s("ERROR: save slot is invalid. Cannot load")
  25.                 General - Return False
  26.             Else
  27.         ------- TIMESTAMP
  28.         set_clock((seconds_to_minutes(save_slots[save_slot].time_stamp)), (left_over_seconds(save_slots[save_slot].time_stamp)))
  29.         ------- SET FORCE PROPERTIES
  30.         General - For each integer force from 0 to LAST_FORCE with increment 1, do (Actions)
  31.             Actions
  32.                 ------- LOAD UPGRADES
  33.                 load_upgrades(save_slot, force)
  34.                 ------- RESTORE FORCE_COLOURS
  35.                 Player - Set player (force_to_player(force)) color to save_slots[save_slot].force_colours[force] (Change the color of existing units)
  36.         ------- REMOVING ALL UNITS
  37.         remove_all_units()
  38.         ------- CREATE REPLACEMENT UNITS
  39.         replace_all_units(save_slot)
  40.         ------- LOAD UNIT VALUES ONTO REPLACEMENTS
  41.         Variable - Set success = (load_units(save_slot))
  42.         ------- CLEAR REPLACEMENT UNITS FROM SAVE SLOT RECORDS
  43.         General - For each integer unit_slot from 1 to save_slots[save_slot].last_unit with increment 1, do (Actions)
  44.             Actions
  45.                 Variable - Set save_slots[save_slot].units[unit_slot].replacement_unit = No Unit
  46.         General - For each integer force from 0 to LAST_FORCE with increment 1, do (Actions)
  47.             Actions
  48.                 ------- LOAD RESOURCES
  49.                 Player - Modify player (force_to_player(force)) Minerals: Set To save_slots[save_slot].resources.budget[TREASURY_CONSTS.MINERALS]
  50.                 Player - Modify player (force_to_player(force)) Vespene: Set To save_slots[save_slot].resources.budget[TREASURY_CONSTS.VESPENE]
  51.                 ------- RESTORE CAMERA LOCATIONS
  52.                 Camera - Pan the camera for player (force_to_player(force)) to save_slots[save_slot].camera_locations[force] over 0.0 seconds with Existing Velocity% initial velocity, 10.0% deceleration, and Do Not use smart panning
  53.                 ------- LOAD BUILD ORDERS
  54.                 load_bos(save_slot)
  55.         ------- UNPAUSE UNITS
  56.         unpause()
  57.         ------- RESUME NORMAL GAME STATE
  58.         General - If (Conditions) then do (Actions) else do (Actions)
  59.             If
  60.                 save_slot != 0
  61.             Then
  62.                 Variable - Set in_game = True
  63.             Else
  64.         ------- DONE
  65.         General - Return success
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement