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

I need a help with a Zombie Trigger

Status
Not open for further replies.
Level 2
Joined
Mar 7, 2011
Messages
15
OKs, so im farely new to Warcraft Editor, and english is not my nature language, so if i make any mistakes pls tell me.
Im not realy good at programming and have never make a thread b4, but im realy desperate and need help.
Me and my friends love Zombies, but we still have not found a single good zombie game, so i decided to build my own, but im stuck with a programming problem, my game to be realistic, summon too many zombies, and then, the zombies proceed to "eat" natural humans from the town(neutral passive).
But i cant make the zombies attack the heroes(players) nor the hummans properly.. im using this programming , but it laggs too much. Plz Someone Help me.
  • Attack
    • Events
      • Unit - A unit owned by Player 1 (Red) Uses an item
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
      • Unit - A unit owned by Player 2 (Blue) Uses an item
      • Unit - A unit owned by Player 2 (Blue) Begins casting an ability
      • Unit - A unit owned by Player 3 (Teal) Uses an item
      • Unit - A unit owned by Player 3 (Teal) Begins casting an ability
      • Unit - A unit owned by Player 4 (Purple) Uses an item
      • Unit - A unit owned by Player 4 (Purple) Begins casting an ability
      • Unit - A unit owned by Player 5 (Yellow) Uses an item
      • Unit - A unit owned by Player 5 (Yellow) Begins casting an ability
    • Conditions
    • Actions
      • Player Group - Pick every player in Player Group - Player 12 (Brown) and do (Unit Group - Pick every unit in (Units owned by Player 12 (Brown)) and do (Unit - Order (Picked unit) to Attack-Move To (Position of (Triggering unit))))
      • Player Group - Pick every player in Player Group - Player 11 (Dark Green) and do (Unit Group - Pick every unit in (Units owned by Player 11 (Dark Green)) and do (Unit - Order (Picked unit) to Attack-Move To (Position of (Triggering unit))))
Also, if there is any other way to reduce lagg from many units will help..
 
Level 13
Joined
Oct 16, 2010
Messages
737
I would have triggers that add all the player units and the neutral (I would also change this to an allied computer player) to a unit group (created as a variable) and have all the zombies in another unit group. Then as they are killed another trigger will take them out of the group which should help.

This way you would be able to have a trigger collect all zombies (the unit group variable) as a "Pick all units from unit group" and then you will be able to make them "attack-move to (random unit from (Unit Group for Players)).

Not sure how complicated you were making this map but using variables will get rid of most of the lag. (If not all lag)
 
Level 2
Joined
Mar 7, 2011
Messages
15
You don't need to post 3 times in 30 minutes.

Also you should be using an array.

  • Set Point = (Position of (Triggering unit))
  • Set Players_Inimigos[0] = (Units in (Playable map area) matching ((Player 11 (Dark Green) controller) Equal to Computer))
  • Set Players_Inimigos[1] = (Units in (Playable map area) matching ((Player 12 (Brown) controller) Equal to Computer))
  • Player Group - Pick every player in Players_Inimigos[0] and do (Unit - Order (Picked unit) to Attack-Move To Point)
  • Player Group - Pick every player in Players_Inimigos[1] and do (Unit - Order (Picked unit) to Attack-Move To Point)
  • Custom script: call RemoveLocation(udg_Point)
  • Custom script: call DestroyForce(udg_Players_Inimigos[0])
  • Custom script: call DestroyForce(udg_Players_Inimigos[1])
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
but we still have not found a single good zombie game
Try SWAT Aftermath. Most of the zombie busting community agrees that it was the best in WC3 and is far better than anything in SC2 to this date.
my game to be realistic
A realistic zombie game is an oxymoron. Zombie concept by nature is far from real.

But i cant make the zombies attack the heroes(players) nor the hummans properly.. im using this programming , but it laggs too much. Plz Someone Help me.
I do not understand what you are trying to do. Every time they use an item or ability you leak massive groups and then order them to attack the position of the triggering unit. This means that I can walk around and not use items and abilities and not be attacked while the fastest team member spams them to get all the agro? I am 99% certain this is not desirable for good gameplay.

Generally to achieve what you want 2 unit group variables are used.
1. Contains all targets the zombies should attack after. It is assumed that these are already hostile to the zombies otherwise they will just gather around and not attack.
2. Contains all the zombies that should be ordered around. To prevent them mobbing a single person break it into multiple unit groups (an array) and stagger the created zombies into them (round-robin cycle through the groups adding the zombies.

Then every 15-30 seconds of game time you pick one of the zombie groups and order them to attack move to a random unit from the zombie target group. You can cycle through the zombie groups in a round-robin fashion to stagger orders which will result in improved performance.

To make the zombies extra aggressive you then need to give them large acquisition range in object editor as well as full visibility of the map so players are unable to hide out of sight. About 2000-3000 acquisition range is recommended.

Do remember that WC3 has a limit on per-player unit movement. Moving 200 zombies per player is about the max you can get before they start to slow down due to overloading the movement system and become very easy targets. If players let that many zombies spawn you can spawn a single strong unit as a form of penalty (in SWAT AM this was the Tyrant which was a very strong and fast ranged unit).
 
Status
Not open for further replies.
Top