• 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.

Need help for creep respawn system like XHERO event!

Status
Not open for further replies.
Level 6
Joined
Jun 19, 2010
Messages
143
Hi,
let me describe a bit about my map and my intent. 12 players have their own 12 heroes. create the same certain amount of creeps for the position of each hero for training. Then check if a hero kill that amount of creep units, create amount +1 of creeps for that hero. I try to make it with neutral hostile dies event, but unable to be successful for the MULTIPLAYERS game. I test it with my two laptops but it seems that just player 1 [red] has the right what I want, the other user player (second laptop) has inordered spawning of creeps and soonly get stucked by very big amount of creep units.
  • Hero Training
    • Events
      • Time - Time3 expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy Timer[3]
      • Set Event[3] = True
      • Unit - Pause all units
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Make (Picked unit) Invulnerable)
      • Countdown Timer - Create a timer window for TrainingTime with title Training Time
      • Countdown Timer - Start TrainingTime as a One-shot timer that will expire in 200.00 seconds
      • Set Timer[5] = (Last created timer window)
      • Unit Group - Pick every unit in HeroGroup and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Unpause (Picked unit)
      • Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) and do (Actions)
        • Loop - Actions
          • Set Hostiles[(Player number of (Picked player))] = 1
          • Camera - Pan camera for (Picked player) to (Center of Region[(Player number of (Picked player))]) over 0.10 seconds
          • Set Temp_Point = (Center of Region[(Player number of (Picked player))])
          • Unit - Create Hostiles[(Player number of (Picked player))] Peons[(Random integer number between 7 and 10)] for Neutral Hostile at Temp_Point facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_Temp_Point)
          • Unit Group - Add all units of (Last created unit group) to TrainingGroup[(Player number of (Picked player))]
          • Unit Group - Pick every unit in (Last created unit group) and do (Unit - Set life of (Picked unit) to 20.00%)
          • Set Temp_Point = (Random point in Region[(Player number of (Picked player))])
          • If ((Random integer number between 1 and 4) Equal to 4) then do (Item - Create (Random level 1 Charged item-type) at Temp_Point) else do (Do nothing)
          • Custom script: call RemoveLocation(udg_Temp_Point)
  • Respawn
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • Event[3] Equal to True
      • ((This trigger) is on) Equal to True
    • Actions
      • Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) and do (Actions)
        • Loop - Actions
          • Wait until ((All units of TrainingGroup[(Player number of (Picked player))] are dead) Equal to True), checking every 1.00 seconds
          • Set Hostiles[(Player number of (Picked player))] = (Hostiles[(Player number of (Picked player))] + 1)
          • Set Temp_Point = (Center of Region[(Player number of (Picked player))])
          • Unit - Create Hostiles[(Player number of (Picked player))] Peons[(Random integer number between 7 and 10)] for Neutral Hostile at Temp_Point facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_Temp_Point)
          • Unit Group - Add all units of (Last created unit group) to TrainingGroup[(Player number of (Picked player))]
          • Unit Group - Pick every unit in (Last created unit group) and do (Unit - Set life of (Picked unit) to 20.00%)
          • Set Temp_Point = (Random point in Region[(Player number of (Picked player))])
          • If ((Random integer number between 1 and 4) Equal to 4) then do (Item - Create (Random level 1 Charged item-type) at Temp_Point) else do (Do nothing)
          • Custom script: call RemoveLocation(udg_Temp_Point)
  • End Training Time
    • Events
      • Time - TrainingTime expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy Timer[5]
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in TrainingGroup[(Player number of (Picked player))] and do (Unit - Remove (Picked unit) from the game)
          • Unit Group - Remove all units from TrainingGroup[(Player number of (Picked player))]
          • Unit Group - Pick every unit in HeroGroup and do (Actions)
            • Loop - Actions
              • For each (Integer j) from 1 to 6, do (Item - Remove (Item carried by (Picked unit) in slot j))
      • Unit - Unpause all units
      • Set Event[3] = False
      • Countdown Timer - Create a timer window for Time4 with title All Duel
      • Countdown Timer - Start Time4 as a One-shot timer that will expire in 720.00 seconds
      • Set Timer[4] = (Last created timer window)
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Make (Picked unit) Vulnerable)
The respawn trigger seems not working properly as what I want.
 
Level 6
Joined
Jun 19, 2010
Messages
143
The checking will check (whenever or the condition) a hero kill that amount of creep units, it will repeatedly increase the amount of creeps spawning by 1 everytime that hero kill them all like XHERO training event if you have played it. Maybe the array couldn't work well somewhere. I donno if I should use custom value of unit..Please help me to do it..a tutorial map is appreciated...I can even post my map here to let everybody check it and help me on that.

Additionally, few players get disconnected when the game is loading the map or has just finished loading the map. +++++REP for the kind helps for those problems. Thank you very much.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
With this trigger, you should not use the wait inside the loop.
  • Respawn
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • Event[3] Equal to True
      • ((This trigger) is on) Equal to True
    • Actions
      • Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) and do (Actions)
        • Loop - Actions
          • Wait until ((All units of TrainingGroup[(Player number of (Picked player))] are dead) Equal to True), checking every 1.00 seconds
          • Set Hostiles[(Player number of (Picked player))] = (Hostiles[(Player number of (Picked player))] + 1)
          • Set Temp_Point = (Center of Region[(Player number of (Picked player))])
          • Unit - Create Hostiles[(Player number of (Picked player))] Peons[(Random integer number between 7 and 10)] for Neutral Hostile at Temp_Point facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_Temp_Point)
          • Unit Group - Add all units of (Last created unit group) to TrainingGroup[(Player number of (Picked player))]
          • Unit Group - Pick every unit in (Last created unit group) and do (Unit - Set life of (Picked unit) to 20.00%)
          • Set Temp_Point = (Random point in Region[(Player number of (Picked player))])
          • If ((Random integer number between 1 and 4) Equal to 4) then do (Item - Create (Random level 1 Charged item-type) at Temp_Point) else do (Do nothing)
          • Custom script: call RemoveLocation(udg_Temp_Point)
Do you want to wait until every hero has killed his own creeps and the spawn units for everyone? Or spawn units for a hero when he has killed his creeps even though other heroes have not killed theirs?
 
Level 6
Joined
Jun 19, 2010
Messages
143
I want spawning units for EACH hero who has killed all of his own creeps (for e.g. Integer[array] units) NOT for everyone. Number units to be spawned next will be Integer[array]+1 units, then Integer[array]+1+1 and so on...The function will repeatedly spawn like that within 3 mins.

Region[array]: those regions are used for the regions each hero stays in.
Unit[array]: unit-type of the creeps spawned.

In short, for your general understanding, the spawning is likely to:
pick all player matching player is playing & controlled by user
create integer[player number of picked player] unit[random integer from 1 to 6] for Neutral hostile at region[player number of picked player]

As I try to use in those triggers; I dont know for sure if I should have spawning and respawning separately or a combination of them. The waiting for condition couldn't work somehow and I dont figure out how to trigger it for MULTIPLAYERS. Putting the waiting for condition outside of the loop doesn't help multiplayers. I also gave a try by changing waiting for condition into new triggers: IF condition and Event unit dies's condition but none of them work out. Tested with 2 laptops many times...
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
This should work then.

  • Respawn
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • Event[3] Equal to True
    • Actions
      • Set Number = Player number of owner of killing unit
      • If
        • All units of TrainingGroup[Number] are dead) Equal to True)
      • Then
        • Set Hostiles[Number] = (Hostiles[Number] + 1)
        • Set Temp_Point = (Center of Region[Number])
        • Unit - Create Hostiles[Number] Peons[(Random integer number between 7 and 10)] for Neutral Hostile at Temp_Point facing Default building facing degrees
        • Custom script: call RemoveLocation(udg_Temp_Point)
        • Unit Group - Remove all units from TrainingGroup[Number]
        • Unit Group - Add all units of (Last created unit group) to TrainingGroup[Number]
        • Unit Group - Pick every unit in (Last created unit group) and do (Unit - Set life of (Picked unit) to 20.00%)
        • Set Temp_Point = (Random point in Region[Number])
        • If ((Random integer number between 1 and 4) Equal to 4) then do (Item - Create (Random level 1 Charged item-type) at Temp_Point) else do (Do nothing)
        • Custom script: call RemoveLocation(udg_Temp_Point)
      • Else
 
Level 6
Joined
Jun 19, 2010
Messages
143
I tried the one of your suggestion 3 hours ago with Owner of killing unit instead of Picked player and tested but still not work. I also used the same as yours with pick all player matching... and use picked player.

None of them work out for 2 user players.
 
Status
Not open for further replies.
Top