Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.17 KB | None | 0 0
  1. load
  2. Options: Function
  3. Return Type: String
  4. Parameters
  5. save_index = 0 <Integer>
  6. Grammar Text: load(save_index)
  7. Hint Text: (None)
  8. Custom Script Code
  9. Local Variables
  10. rally index = 0 <Integer>
  11. collection_target = No Unit <Unit>
  12. closest_town = No Unit <Unit>
  13. order_target_unit = No Unit <Unit>
  14. order_target_index = 0 <Integer>
  15. ALL_of_the_units = (Empty unit group) <Unit Group>
  16. u = No Unit <Unit>
  17. summoned_unit_index = 0 <Integer>
  18. minerals = (Empty unit group) <Unit Group>
  19. town_halls = (Empty unit group) <Unit Group>
  20. training_slot = 0 <Integer>
  21. potential_builders = (Empty unit group) <Unit Group>
  22. commander_index = 0 <Integer>
  23. player = 0 <Integer>
  24. hatch_count = 0 <Integer>
  25. local_larvae = (Empty unit group) <Unit Group>
  26. hatch_unit = No Unit <Unit>
  27. building_index = 0 <Integer>
  28. building = No Unit <Unit>
  29. gas_buildings = (Empty unit group) <Unit Group>
  30. i = 0 <Integer>
  31. cargo_units = (Empty unit group) <Unit Group>
  32. in_luggage = False <Boolean>
  33. Actions
  34. General - If (Conditions) then do (Actions) else do (Actions)
  35. If
  36. unit_count[save_index] == -1
  37. Then
  38. Debug - Display "invalid save point" as debug output using Type 01, and Do display it in the game window
  39. General - Return "NOT A VALID LOADING POINT!"
  40. Else
  41. Cinematics - Turn cinematic mode On for (All players) over 1.0 seconds
  42. Cinematics - Fade Out over 1.0 seconds using color (0%, 0%, 0%) and 0.0% transparency (Normal style, Wait until it finishes)
  43. ------- disable bo triggers
  44. Trigger - Turn unit_built Off
  45. Trigger - Turn unit_training Off
  46. Trigger - Turn upgrade_training Off
  47. Trigger - Turn morph_ability Off
  48. General - Wait 1.0 Game Time seconds
  49. Variable - Set retval_bool = (load_time(save_index))
  50. Debug - debug_s("loading", False, False)
  51. General - For each integer commander_index from 1 to 2 with increment 1, do (Actions)
  52. Actions
  53. Variable - Set player = forcetoplayer[commander_index]
  54. ------- clear the list of control group units
  55. General - For each integer i from 0 to 9 with increment 1, do (Actions)
  56. Actions
  57. Variable - Set current_control_groups[commander_index][i] = (Empty unit group)
  58. ------- remove restrictions on unit creation
  59. Tech Tree - Disable tech tree requirements for player player
  60. ------- set upgrade levels
  61. General - For each integer i from 0 to 98 with increment 1, do (Actions)
  62. Actions
  63. ------- check that this upgrade is valid
  64. General - If (Conditions) then do (Actions) else do (Actions)
  65. If
  66. all_upgrades[i] != No Game Link
  67. Then
  68. General - If (Conditions) then do (Actions) else do (Actions)
  69. If
  70. upgrades_complete[save_index][(commander_index - 1)][i] == True
  71. Then
  72. Tech Tree - Set all_upgrades[i] upgrade level to 1 for player player
  73. Else
  74. Tech Tree - Set all_upgrades[i] upgrade level to 0 for player player
  75. Else
  76. ------- remove supply restrictions
  77. Player - Modify player player Supplies Made: Set To 400
  78. ------- remove all current units
  79. Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, with at most Any Amount) and do (Actions)
  80. Actions
  81. Unit - Remove (Picked unit) from the game
  82. ------- remove all creep
  83. General - If (Conditions) then do (Actions) else do (Actions)
  84. If
  85. save_index != 5
  86. Then
  87. Variable - Set retval_bool = (remove_creep())
  88. Else
  89. UI - Display "clearing all scouting information" for (All players) to Debug area
  90. Player Group - For each player player in (Active Players) do (Actions)
  91. Actions
  92. Visibility - Reveal (Entire map) for player player for 0.2 seconds and Do Not check cliff level
  93. General - Wait 0.5 Game Time seconds
  94. Player Group - For each player player in (Active Players) do (Actions)
  95. Actions
  96. Visibility - Change visibility for player player to Unexplored within (Entire map) and Do Not check cliff level
  97. UI - Display "restoring units" for (All players) to Debug area
  98. ------- create units from save point data
  99. General - For each integer i from 0 to (unit_count[save_index] - 1) with increment 1, do (Actions)
  100. Actions
  101. Variable - Set player = forcetoplayer[unit_owners[save_index][i]]
  102. General - If (Conditions) then do (Actions) else do (Actions)
  103. If
  104. Or
  105. Conditions
  106. save_index < 0
  107. i > 549
  108. building_index > 159
  109. hatch_count > 19
  110. summoned_unit_index > 79
  111. Then
  112. Debug - Display "invalid array index. Too many units..." as debug output using Type 01, and Do display it in the game window
  113. General - Return "OH NOES!!!111!1"
  114. Else
  115. ------- signal if we are finished with all non hidden active players units.
  116. General - If (Conditions) then do (Actions) else do (Actions)
  117. If
  118. unit_owners[save_index][i] == 0
  119. unit_types[save_index][i] != Vespene Geyser
  120. unit_types[save_index][i] != Vespene Geyser (Space Platform)
  121. Then
  122. Variable - Set in_luggage = True
  123. Else
  124. General - If (Conditions) then do (Actions) else do (Actions)
  125. If
  126. unit_owners[save_index][i] != 0
  127. (unit_types[save_index][i] has Structure attribute) == True
  128. completion[save_index][building_index][0] != 100.0
  129. training[save_index][building_index][0] == No Game Link
  130. researching[save_index][building_index][0] == No Game Link
  131. unit_order_ability[save_index][i] == No Ability Command
  132. Then
  133. Unit - Create 1 unit_types[save_index][i] for player player at unit_positions[save_index][i] using default facing (Under Construction, Ignore Placement)
  134. Variable - Set u = (Last created unit)
  135. Else
  136. ------- check if cargo unit
  137. General - If (Conditions) then do (Actions) else do (Actions)
  138. If
  139. in_luggage == True
  140. unit_owners[save_index][i] != 0
  141. Then
  142. ------- find the cargo unit and place inside
  143. Unit Group - Pick each unit in cargo_units and do (Actions)
  144. Actions
  145. General - If (Conditions) then do (Actions) else do (Actions)
  146. If
  147. (Position of (Picked unit)) == unit_positions[save_index][i]
  148. Then
  149. General - If (Conditions) then do (Actions) else do (Actions)
  150. If
  151. Or
  152. Conditions
  153. (Unit type of (Picked unit)) == Refinery
  154. (Unit type of (Picked unit)) == Extractor
  155. (Unit type of (Picked unit)) == Assimilator
  156. Then
  157. ------- if "cargo unit" is an extractor/assimilator/refirnery create as normal
  158. Unit - Create 1 unit_types[save_index][i] for player player at unit_positions[save_index][i] using default facing (Ignore Placement)
  159. Variable - Set u = (Last created unit)
  160. Unit - Order u to (Probe - Gather targeting (Picked unit)) (Replace Existing Orders)
  161. Variable - Set unit_order_ability[save_index][i] = Probe - Gather
  162. Else
  163. ------- create as cargo unit
  164. Unit - Create 1 unit_types[save_index][i] as cargo in (Picked unit)
  165. Variable - Set u = (Last created cargo unit)
  166. ------- should we really be breaking here? what about setting HP etc
  167. General - Break
  168. Else
  169. Else
  170. Unit - Create 1 unit_types[save_index][i] for player player at unit_positions[save_index][i] using default facing (Ignore Placement)
  171. Variable - Set u = (Last created unit)
  172. ------- add to cargo units if unit type matches
  173. General - If (Conditions) then do (Actions) else do (Actions)
  174. If
  175. Or
  176. Conditions
  177. (Unit type of u) == Bunker
  178. (Unit type of u) == Command Center
  179. (Unit type of u) == Command Center (Flying)
  180. (Unit type of u) == Orbital Command
  181. (Unit type of u) == Orbital Command (Flying)
  182. (Unit type of u) == Medivac
  183. (Unit type of u) == Overlord
  184. (Unit type of u) == Warp Prism (Phasing Mode)
  185. (Unit type of u) == Warp Prism (Transport Mode)
  186. (Unit type of u) == Assimilator
  187. (Unit type of u) == Extractor
  188. (Unit type of u) == Refinery
  189. Then
  190. Unit Group - Add u to cargo_units
  191. Else
  192. Unit - Pause u
  193. Unit Group - Add u to ALL_of_the_units
  194. ------- if a town hall add to that unit group
  195. General - If (Conditions) then do (Actions) else do (Actions)
  196. If
  197. Or
  198. Conditions
  199. unit_types[save_index][i] == Command Center
  200. unit_types[save_index][i] == Orbital Command
  201. unit_types[save_index][i] == Planetary Fortress
  202. unit_types[save_index][i] == Hatchery
  203. unit_types[save_index][i] == Lair
  204. unit_types[save_index][i] == Hive
  205. unit_types[save_index][i] == Nexus
  206. Then
  207. Unit Group - Add u to town_halls
  208. Else
  209. ------- assign to appropriate control group
  210. Variable - Set retval_bool = (decode_control_groups(control_group[save_index][i], u, unit_owners[save_index][i]))
  211. ------- restore protoss sheilds
  212. Unit - Set u Shields to unit_shields[save_index][i]
  213. ------- restore unit energy
  214. General - If (Conditions) then do (Actions) else do (Actions)
  215. If
  216. (unit_types[save_index][i] Energy Maximum) != 0.0
  217. Then
  218. Unit - Set u Energy to unit_energy[save_index][i]
  219. Else
  220. ------- doom unit to its fate
  221. General - If (Conditions) then do (Actions) else do (Actions)
  222. If
  223. Or
  224. Conditions
  225. (Unit type of u) == MULE
  226. (Unit type of u) == Infested Terran (From Terran Infestation Rupture)
  227. (Unit type of u) == Swarm Host - Locust
  228. (Unit type of u) == Brood Lord - Broodling
  229. (Unit type of u) == Auto-Turret
  230. (Unit type of u) == Point Defense Drone
  231. (Unit type of u) == Changeling
  232. (Unit type of u) == Force Field
  233. Then
  234. Unit - Add 1 Public Timed Life to u from u
  235. Unit - Set Public Timed Life duration to (Integer(summoned[save_index][summoned_unit_index])) on unit u
  236. Variable - Modify summoned_unit_index: + 1
  237. Else
  238. ------- set ability cooldown for mothershipcore and warpgate
  239. General - If (Conditions) then do (Actions) else do (Actions)
  240. If
  241. (Unit type of u) == Warp Gate
  242. Then
  243. Unit - Add summoned[save_index][summoned_unit_index] seconds to cooldown WarpGateTrain on ability Warp Gate - Train (Warp Gate) on unit u
  244. Variable - Modify summoned_unit_index: + 1
  245. Else
  246. General - If (Conditions) then do (Actions) else do (Actions)
  247. If
  248. (Unit type of u) == Nexus
  249. Then
  250. General - If (Conditions) then do (Actions) else do (Actions)
  251. If
  252. summoned[save_index][summoned_unit_index] > 0.0
  253. Then
  254. Environment - Execute Mothership Core Purify Nexus Set on u from u
  255. Unit - Set Purify remaining duration to summoned[save_index][summoned_unit_index] on unit u
  256. Else
  257. Variable - Modify summoned_unit_index: + 1
  258. Else
  259. ------- perform building specific stuff
  260. General - If (Conditions) then do (Actions) else do (Actions)
  261. If
  262. (Owner of u) != 0
  263. Or
  264. Conditions
  265. ((Unit type of u) has Structure attribute) == True
  266. (Unit type of u) == Egg - Zerg Cocoon
  267. Then
  268. ------- replace egg with larvae
  269. General - If (Conditions) then do (Actions) else do (Actions)
  270. If
  271. (Unit type of u) == Egg - Zerg Cocoon
  272. Then
  273. Unit Group - Remove u from ALL_of_the_units
  274. Unit - Remove u from the game
  275. Unit - Create 1 Larva for player player at unit_positions[save_index][i] using default facing (Ignore Placement)
  276. Variable - Set u = (Last created unit)
  277. Variable - Set retval_bool = (decode_control_groups(control_group[save_index][i], u, 0))
  278. Unit Group - Add u to ALL_of_the_units
  279. Else
  280. ------- train or upgrade units at this building
  281. General - For each integer training_slot from 0 to 7 with increment 1, do (Actions)
  282. Actions
  283. General - If (Conditions) then do (Actions) else do (Actions)
  284. If
  285. training_slot <= 1
  286. Then
  287. Variable - Set retval_bool = (train_or_research(progress = completion[save_index][building_index][training_slot], unit training = training[save_index][building_index][training_slot], upgrade = researching[save_index][building_index][training_slot], building = u, slot = training_slot))
  288. Else
  289. Variable - Set retval_bool = (train_or_research(progress = 0.0, unit training = training[save_index][building_index][training_slot], upgrade = researching[save_index][building_index][training_slot], building = u, slot = training_slot))
  290. ------- apply macro mechanics to buildings
  291. General - If (Conditions) then do (Actions) else do (Actions)
  292. If
  293. macro_mechanic_duration[save_index][building_index] != -1
  294. Then
  295. Variable - Set retval_bool = (macro_data(u, macro_mechanic_duration[save_index][building_index]))
  296. Else
  297. Variable - Modify building_index: + 1
  298. Else
  299. ------- spawn larvae for zerg hatches/lairs/hives
  300. General - If (Conditions) then do (Actions) else do (Actions)
  301. If
  302. (Unit type of u) != Hatchery
  303. (Unit type of u) != Hive
  304. (Unit type of u) != Lair
  305. Then
  306. Else
  307. Variable - Set retval_int = (spawn_larvae_at_hatch(u, larvae_counts[save_index][hatch_count]))
  308. Variable - Modify hatch_count: + 1
  309. ------- set resource values for minerals and gas
  310. General - If (Conditions) then do (Actions) else do (Actions)
  311. If
  312. Or
  313. Conditions
  314. (Unit type of u) == Vespene Geyser
  315. (Unit type of u) == Mineral Field
  316. (Unit type of u) == Rich Mineral Field
  317. (Unit type of u) == Vespene Geyser (Space Platform)
  318. Then
  319. Unit - Set u Resources to unit_health[save_index][i]
  320. Else
  321. Unit - Set u Life to unit_health[save_index][i]
  322. UI - Display ((Text((Number of Living units in ALL_of_the_units))) + " units restored") for (All players) to Debug area
  323. ------- restore creep spread
  324. Variable - Set retval_bool = (create_creep())
  325. UI - Display "recreating unit actions" for (All players) to Debug area
  326. ------- set rally points for buildings
  327. Variable - Set building_index = 0
  328. General - For each integer i from 0 to ((Number of Any units in ALL_of_the_units) - 1) with increment 1, do (Actions)
  329. Actions
  330. Variable - Set u = (Unit (i + 1) from ALL_of_the_units)
  331. General - If (Conditions) then do (Actions) else do (Actions)
  332. If
  333. (Owner of u) != 0
  334. Or
  335. Conditions
  336. ((Unit type of u) has Structure attribute) == True
  337. (Unit type of u) == Egg - Zerg Cocoon
  338. Then
  339. ------- found a building
  340. General - For each integer rally index from 0 to 1 with increment 1, do (Actions)
  341. Actions
  342. General - If (Conditions) then do (Actions) else do (Actions)
  343. If
  344. rally_points[save_index][building_index][rally index] != No Point
  345. Then
  346. General - If (Conditions) then do (Actions) else do (Actions)
  347. If
  348. (X of rally_points[save_index][building_index][rally index]) == -1.0
  349. Then
  350. ------- rally targets a unit
  351. Variable - Set order_target_index = ((Integer((Y of rally_points[save_index][building_index][rally index]))) + 1)
  352. Variable - Set order_target_unit = (Unit order_target_index from ALL_of_the_units)
  353. General - If (Conditions) then do (Actions) else do (Actions)
  354. If
  355. rally index == 1
  356. Then
  357. Unit - Order u to ( Set Rally Point targeting order_target_unit) (Replace Existing Orders)
  358. Else
  359. General - If (Conditions) then do (Actions) else do (Actions)
  360. If
  361. Or
  362. Conditions
  363. (Unit type of u) == Hatchery
  364. (Unit type of u) == Lair
  365. (Unit type of u) == Hive
  366. Then
  367. Unit - Order u to ( Set Rally Point targeting order_target_unit) (Replace Existing Orders)
  368. Else
  369. Unit - Order u to ( Set Rally Point targeting order_target_unit) (Replace Existing Orders)
  370. Else
  371. ------- rally targets a point
  372. Unit - Order u to ( Set Rally Point targeting rally_points[save_index][building_index][rally index]) (Replace Existing Orders)
  373. Else
  374. Variable - Modify building_index: + 1
  375. Else
  376. ------- set rally points for zerg eggs
  377. Unit Group - Pick each unit in (Egg - Zerg Cocoon units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
  378. Actions
  379. ------- only assign rally if no rally already exists
  380. General - If (Conditions) then do (Actions) else do (Actions)
  381. If
  382. (Rally point target point for point 1 with target 1 for (Picked unit)) == No Point
  383. Then
  384. ------- look for coresponding hatchery
  385. Variable - Set closest_town = (Closest unit to (Position of (Picked unit)) in town_halls)
  386. General - If (Conditions) then do (Actions) else do (Actions)
  387. If
  388. (Unit type of (Picked unit) training queue slot 1 item 1) == Drone
  389. Then
  390. Unit - Order (Picked unit) to ( Set Rally Point targeting (Rally point target unit of point 2 with target 1 for closest_town)) (Replace Existing Orders)
  391. Else
  392. General - If (Conditions) then do (Actions) else do (Actions)
  393. If
  394. (Rally point target point for point 1 with target 1 for closest_town) != No Point
  395. Then
  396. General - If (Conditions) then do (Actions) else do (Actions)
  397. If
  398. (Rally point target unit of point 1 with target 1 for closest_town) != No Unit
  399. Then
  400. ------- rally point targets unit
  401. Unit - Order (Picked unit) to ( Set Rally Point targeting (Rally point target unit of point 1 with target 1 for closest_town)) (Replace Existing Orders)
  402. Else
  403. ------- rally targets point
  404. Unit - Order (Picked unit) to ( Set Rally Point targeting (Rally point target point for point 1 with target 1 for closest_town)) (Replace Existing Orders)
  405. Else
  406. Else
  407. ------- give orders to ALL of the units!
  408. Variable - Set building_index = 0
  409. General - For each integer i from 0 to ((Number of Any units in ALL_of_the_units) - 1) with increment 1, do (Actions)
  410. Actions
  411. Variable - Set u = (Unit (i + 1) from ALL_of_the_units)
  412. General - Switch (Actions) depending on unit_order_ability[save_index][i]
  413. Cases
  414. ------- harvesting abilities
  415. General - If (SCV - Return Cargo)
  416. Actions
  417. return_cargo(unit = u, unit_energy[save_index][i](0 = minerals, !0 = gas) )
  418. General - If (Drone - Return Cargo)
  419. Actions
  420. return_cargo(unit = u, unit_energy[save_index][i](0 = minerals, !0 = gas) )
  421. General - If (Probe - Return Cargo)
  422. Actions
  423. return_cargo(unit = u, unit_energy[save_index][i](0 = minerals, !0 = gas) )
  424. General - If (MULE - Return Cargo)
  425. Actions
  426. return_cargo(unit = u, unit_energy[save_index][i](0 = minerals, !0 = gas) )
  427. ------- morphing abilities
  428. General - If (Command Center - Upgrade to Orbital Command)
  429. Actions
  430. Variable - Set retval_bool = (morph_building(Command Center - Upgrade to Orbital Command, completion[save_index][building_index][0], u))
  431. General - If (Command Center - Upgrade to Planetary Fortress)
  432. Actions
  433. Variable - Set retval_bool = (morph_building(Command Center - Upgrade to Planetary Fortress, completion[save_index][building_index][0], u))
  434. General - If (Hatchery - Mutate into Lair)
  435. Actions
  436. Variable - Set retval_bool = (morph_building(Hatchery - Mutate into Lair, completion[save_index][building_index][0], u))
  437. General - If (Lair - Mutate into Hive)
  438. Actions
  439. Variable - Set retval_bool = (morph_building(Lair - Mutate into Hive, completion[save_index][building_index][0], u))
  440. General - If (Spire - Mutate into Greater Spire)
  441. Actions
  442. Variable - Set retval_bool = (morph_building(Spire - Mutate into Greater Spire, completion[save_index][building_index][0], u))
  443. Default
  444. General - If (Conditions) then do (Actions) else do (Actions)
  445. If
  446. unit_order_point[save_index][i] == No Point
  447. Then
  448. ------- Order targets nothing
  449. ------- NOTE: There is currently an editor bug involving ability type checks
  450. ------- The only work around atm is to use custom code snippets
  451. General - Custom Script: UnitIssueOrder(lv_u, Order(libEE3D7A19_gv_uni...
  452. Else
  453. General - If (Conditions) then do (Actions) else do (Actions)
  454. If
  455. (X of unit_order_point[save_index][i]) == -1.0
  456. Then
  457. ------- Order targets specific unit
  458. General - If (Conditions) then do (Actions) else do (Actions)
  459. If
  460. Or
  461. Conditions
  462. (Unit type of u) == Rock Tower
  463. (Unit type of u) == Rock Tower (Diagonal)
  464. Then
  465. Unit - Make u face (Y of unit_order_point[save_index][i]) over 0.0 seconds
  466. Else
  467. Variable - Set order_target_index = ((Integer((Y of unit_order_point[save_index][i]))) + 1)
  468. Variable - Set order_target_unit = (Unit order_target_index from ALL_of_the_units)
  469. General - Custom Script: UnitIssueOrder(lv_u, OrderTargetingUnit(libEE...
  470. Else
  471. ------- Order targets point
  472. General - Custom Script: UnitIssueOrder(lv_u, OrderTargetingPoint(libE...
  473. ------- keep track of building count
  474. General - If (Conditions) then do (Actions) else do (Actions)
  475. If
  476. (Owner of u) != 0
  477. Or
  478. Conditions
  479. ((Unit type of u) has Structure attribute) == True
  480. (Unit type of u) == Egg - Zerg Cocoon
  481. Then
  482. Variable - Modify building_index: + 1
  483. Else
  484. General - For each integer commander_index from 1 to 2 with increment 1, do (Actions)
  485. Actions
  486. ------- restore user resource counts
  487. Player - Modify player forcetoplayer[commander_index] Minerals: Set To player_resources[save_index][(commander_index - 1)][0]
  488. Player - Modify player forcetoplayer[commander_index] Vespene: Set To player_resources[save_index][(commander_index - 1)][1]
  489. ------- set player race and starting location
  490. Variable - Set races[commander_index] = saved_race[save_index][commander_index]
  491. Variable - Set chosen_start_locations[commander_index] = saved_base[save_index][commander_index]
  492. ------- need to set resource counter on refinery/extractor/assimilator. based on vesene guyser
  493. Variable - Set retval_bool = (encapsulate guysers())
  494. ------- send scvs to construct buildings
  495. Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Required: Structure; Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
  496. Actions
  497. General - If (Conditions) then do (Actions) else do (Actions)
  498. If
  499. (Progress of (Picked unit) slot 1) != 100.0
  500. races[playertoforce[(Owner of (Picked unit))]] == Terran
  501. (Number of items in (Picked unit) training queue slot ) == 0
  502. (Upgrade type of (Picked unit) training queue slot 1 item 1) == No Game Link
  503. Then
  504. Variable - Set retval_bool = (scv_cont_building((Picked unit)))
  505. Else
  506. ------- reset unit restrictions
  507. Tech Tree - Enable tech tree requirements for player forcetoplayer[1]
  508. Tech Tree - Enable tech tree requirements for player forcetoplayer[2]
  509. ------- fix unit models for marines and zerglings
  510. General - For each integer commander_index from 1 to 2 with increment 1, do (Actions)
  511. Actions
  512. Variable - Set player = forcetoplayer[commander_index]
  513. General - If (Conditions) then do (Actions) else do (Actions)
  514. If
  515. upgrades_complete[save_index][(commander_index - 1)][73] == False
  516. Then
  517. ------- set combat shield to researched
  518. ------- this is so that setting upgrade level to zero will trigger the model to correct itself
  519. Tech Tree - Set Marine - Combat Shield upgrade level to 1 for player player
  520. Tech Tree - Set Marine - Combat Shield upgrade level to 0 for player player
  521. Else
  522. General - If (Conditions) then do (Actions) else do (Actions)
  523. If
  524. upgrades_complete[save_index][(commander_index - 1)][87] == False
  525. Then
  526. Unit Group - Pick each unit in (Zergling units in (Entire map) owned by player player matching Excluded: Missile, Dead, with at most Any Amount) and do (Actions)
  527. Actions
  528. Unit - Set unit (Picked unit) model to Zergling with variation 0 and textures ""
  529. Else
  530. Unit Group - Pick each unit in (Zergling units in (Entire map) owned by player player matching Excluded: Missile, Dead, with at most Any Amount) and do (Actions)
  531. Actions
  532. Unit - Set unit (Picked unit) model to Zergling Upgrade with variation 0 and textures ""
  533. Player - Modify player forcetoplayer[1] Supplies Made: Set To supply[save_index][0]
  534. Player - Modify player forcetoplayer[2] Supplies Made: Set To supply[save_index][1]
  535. General - For each integer commander_index from 1 to 2 with increment 1, do (Actions)
  536. Actions
  537. ------- restore camera locations
  538. Camera - Pan the camera for player forcetoplayer[commander_index] to camera_location[save_index][(commander_index - 1)] over 1.0 seconds with Existing Velocity% initial velocity, 10.0% deceleration, and Do Not use smart panning
  539. ------- delete all AI requests
  540. AI Advanced - Clear all build requests currently planned (but not yet started) for AI player forcetoplayer[commander_index]
  541. AI Advanced - Clear all research upgrades currently planned (but not yet started) for AI player forcetoplayer[commander_index]
  542. AI Advanced - Clear all train requests currently planned (but not yet started) for AI player forcetoplayer[commander_index]
  543. ------- load build orders
  544. load_bos(save_index)
  545. ------- enable bo triggers
  546. Trigger - Turn unit_built On
  547. Trigger - Turn unit_training On
  548. Trigger - Turn upgrade_training On
  549. Trigger - Turn morph_ability On
  550. Cinematics - Turn cinematic mode Off for (All players) over 1.0 seconds
  551. Cinematics - Fade In over 1.0 seconds using color (0%, 0%, 0%) and 0.0% transparency (Normal style, Wait until it finishes)
  552. ------- reset the autosave countdown
  553. Variable - Set seconds_till_autosave = (autosave_duration * 60)
  554. General - Return "loaded"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement