• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Reload

Status
Not open for further replies.
Level 3
Joined
Aug 14, 2006
Messages
29
Hi all, my previus thread got lost some where o0
So i repost, i got the following issue: when map has initiated i want all units to be stored, to that i use the following:
  • Save units
  • Events
    • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- Set this variable to which units you want to save --------
      • Player Group - Pick every player in (All players) and do (Set UnitGroup = (Units in (Playable map area) owned by (Picked player)))
      • -------- --------------------------------------------------------------------------- --------
      • Unit Group - Add all units of UnitGroup to UnpickedUnits
      • Set NumberOfUnits = (Number of units in UnitGroup)
      • For each (Integer A) from 1 to NumberOfUnits, do (Actions)
        • Loop - Actions
          • Set Unit[(Integer A)] = (Random unit from UnpickedUnits)
          • Unit Group - Remove Unit[(Integer A)] from UnpickedUnits
          • Set CreepType[(Integer A)] = (Unit-type of Unit[(Integer A)])
          • Set SpawnPoint[(Integer A)] = (Position of Unit[(Integer A)])
          • Set UnitFacing[(Integer A)] = (Facing of Unit[(Integer A)])
          • Set Life[(Integer A)] = (Percentage life of Unit[(Integer A)])
          • Set Mana[(Integer A)] = (Percentage mana of Unit[(Integer A)])
          • Set UnitOwner[(Integer A)] = (Owner of Unit[(Integer A)])
I then use the following to restore:

  • Restore units
    • Events
      • Player - Player 2 (Blue) types a chat message containing -reload as An exact match
    • Conditions
    • Actions
      • Quest - Display to (All players) the Warning message: Blue has initiated ...
      • Cinematic - Fade out over 0.01 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Unit Group - Pick every unit in allunitsreload and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • For each (Integer A) from 1 to NumberOfUnits, do (Actions)
        • Loop - Actions
          • Unit - Create 1 CreepType[(Integer A)] for UnitOwner[(Integer A)] at SpawnPoint[(Integer A)] facing UnitFacing[(Integer A)] degrees
          • Unit - Set life of (Last created unit) to Life[(Integer A)]%
          • Unit - Set mana of (Last created unit) to Mana[(Integer A)]%
          • Unit Group - Add (Last created unit) to UnitGroup
          • Wait 2.00 seconds
          • Cinematic - Fade in over 0.01 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Player Group - Pick every player in (All players) and do (Player - Set (Picked player) Current gold to 300)
Now i think i messed this up since:
All units gets removed (well for some reason not all, theres always some random units left behind), however none are re-created.

If i set the
  • Actions
  • Set UnitGroup = (Units in (Playable map area) owned by Player 2 (Blue))
It removes all units, and replaces Player 2 (blue)'s units..
I'm using the reload system by Ketila
Group Saving system v.1.0 - The Hive Workshop - A Warcraft III Modding Site

Can any one help me out, on how to respawn all the units (for all players)?
 
Status
Not open for further replies.
Top