• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help-need zombies to attack players

Status
Not open for further replies.
Level 4
Joined
Jun 18, 2008
Messages
70
hi.Im making a zombie survival game. I can make zombies spawn,but they just stand there until someone attacks them,even though I have a trigger telling a random zombie to attack-move to the center of my map every second.What happens is they inch theirv way forward in short bursts. If you can help me please do.
 
Level 17
Joined
Jan 21, 2007
Messages
2,013
This kind of trigger shouldn't cause a movement delay unless there's something really wrong with your trigger or you spawn too many zombies. Either way, heres my idea of a spawning.

Events
every second of game time
Conditions
Actions
Pick all units matching (owner of (matching unit) is equal to (player 12 (brown)) equal to false
Set variable (PlayerUnitGroup) = (last created player group)
Create 2 zombies at (region000)
order last created unit to attack random unit from (PlayerUnitgroup)

This creates 2 zombies every second and orders them to attack random player units. This works the best with a 1 unit per player map.
Just copy/paste the creat zombies and attack random units part for every region they should spawn.

If you want them to attack a special point, just order them to attack-move to that point.
 
Last edited:
Level 17
Joined
May 6, 2008
Messages
1,598
  • Actions
  • Set TempPoint = Region001 <gen>
  • Unit - Create 2 Zombie at TempPoint facing default building degrees.
  • Custom script: Call RemoveLocation(udg_TempPoint)
Do like that.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Uhmm.. even if he ordered all the units - the wc3engine can't handle more than x actions at the same time. It's the same as in a maul where enemies stay at certain places.. but with around 160 units on the map all being ordered to move, it works with almost no "camping" units..
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
You can do it like this..
  • For each Integer A from 1 to 20 do
    • Set temppoint = Center of Region001 <gen>
    • Unit - Create 1 Zombie for Player x at temppoint
    • Unit - Order (last created unit) to attack/move point x
    • Custom script - call RemoveLocation(udg_temppoint)
    • Set temppoint = Center of Region002 <gen>
    • Unit - Create 1 Zombie for Player x at temppoint
    • Unit - Order (last created unit) to attack/move point x
    • Custom script - call RemoveLocation(udg_temppoint)
    • Set temppoint = Center of Region003 <gen>
    • Unit - Create 1 Zombie for Player x at temppoint
    • Unit - Order (last created unit) to attack/move point x
    • Custom script - call RemoveLocation(udg_temppoint)
    • and so on...
    • Wait 0.1 seconds
and you have 20 zombies, each spawned at the defined regions with a pause of 0.1s and without leaks ^^
Be sure to clean up "point x"
 
Level 4
Joined
Jun 18, 2008
Messages
70
ok so I tried this trigger-I waited yet nothing happened! Please tell me why.Also how can I turn this trigger off after....75 seconds without making another trigger just to turn this one off-I want the zombies to spawn every .5 seconds for 75 seconds,then I wanna turn it off.


Events
Time - Elapsed game time is 60.00 seconds
Conditions
Actions
Set Temppoint1 = Spawn1 <gen>
Unit - Create 1 Lesser Zombie for Player 12 (Brown) at (Center of Spawn1 <gen>) facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Position of Flag 0024 <gen>)
Set Temppoint1_Copy = Spawn11 <gen>
Unit - Create 1 Lesser Zombie for Player 12 (Brown) at (Center of Spawn11 <gen>) facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Position of Flag 0024 <gen>)
Set Temppoint1_Copy_2 = spawn111 <gen>
Unit - Create 1 Lesser Zombie for Player 12 (Brown) at (Center of spawn111 <gen>) facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Position of Flag 0024 <gen>)
Set Temppoint1_Copy_3 = spawn1111 <gen>
Unit - Create 1 Lesser Zombie for Player 12 (Brown) at (Center of spawn1111 <gen>) facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Position of Flag 0024 <gen>)
Wait 0.50 seconds
 
Level 4
Joined
Jun 18, 2008
Messages
70
ok ill try the tags. Also I fixed the spawn problem-I added the event "every .5 seconds" so that it will wait my desired time then spawn the zombies for 75 seconds. I did encounter a problem though. My map is in the shape of a + sign. On the ends of the "+" i have 2 player start locations,so i have 8 spawn points in all. To get to the center of the "+" there are doors at the area were all the lines meet. Those doors only open after 5 waves. My trigger is making the zombies right click on the very center of the "+". Instead of going up the lines to the player start locations,they walk around the outside of the plus. I have 4 zombie spawn points near the outside of the lines on the "+". I want the zombies to go to the player start locations nearest to them.
 
Level 17
Joined
Jan 21, 2007
Messages
2,013
you do know that waits dont go down to .1 of a second right? The lowest is .23

Y, as far from what i've heard(and experienced) the lowest is 0.10 in GUI. This is the lowest i use since that's what i've been told.

As for randomly attacking players, that's what i wrote. the reason they go around is becuz u order them to go to the middle of the +. They cannot go through the gates, so they'll go around. Just use the attack random player from player group. That will work, although you will need to create playergroups for each spawn i guess, otherwise you'll encounter a similar problem.
 
Level 4
Joined
Jun 18, 2008
Messages
70
Ok, so I make a group for each of the 2 players on the 4 sides of +,and I tell zombies to randomly attack players from player group? Makes sense. But how do I make a player group? And also how do I make trigger tags?
 
Level 12
Joined
Apr 18, 2007
Messages
1,130
Okay I see your error with your first trigger it's common sense.
If you place too many units wc3 starts to lag, right?
Well, not only does the graphics engine lag, but with this rapid commanding, that lags, too, causing command delay, which is when you tell something to go somewhere and it begins to do the action about 2 seconds after the action was ordered. This is caused by too many units. This is more commonly seen in roleplays when the player is handling cities and armies.
What I see to do is to make the 4 regions of the map. Have every 5 seconds 2 new zombies created in each sector, or region. This prevents too much lag. Order them to randomly patrol their sector. Patrolling is basically an attack-move when they are going around the map randomly.
This is quite complicated so I won't give you the trigger for it.
Now I have a question.
Do the players get to select their hero? Or is there only one hero [for each player] that is already on the map in the world editor?
 
Level 12
Joined
Apr 18, 2007
Messages
1,130
Okay I have a system for if there is no hero selection. It's fully playable as well for up to 12 players. Sure there are no items and the heroes are normal units, and it's kinda cheap, but this is to show the system not the actual game itself.
 

Attachments

  • Zombiesurvivetriggers.w3x
    24.7 KB · Views: 30
Level 4
Joined
Jun 18, 2008
Messages
70
dont worry i got the hero selection system goin-i made a dialog. And also with the zombies spawning I want to know how to make a player group, because the area i want the zombies to attack-move to is blocked by doors, which open later. I have 4 zombie spawn points, each on 1 side of the map. near each spawn point are 2 player start locations. I want the zombies to attack the players nearest to them, like the northern zombie spawn areato attack the players right below them, not go around to attack the players on the eastern side. And I also changed the zombie spawning to 1 zombies per 1.5 seconds-I think it should work.
 
Level 4
Joined
Jun 18, 2008
Messages
70
Also the last thing that I cant figure out-how do I make the tooltips work? I see the code they put in, but I wana insert my own name into it. I tried erasing what they put and put in my name-it worked for 1. If there is a link to where I can get help or if you can help me that would be sooo useful.
 
Level 12
Joined
Apr 18, 2007
Messages
1,130
Yeah sorry I don't know what you're talking about on the second post.

For the first, I'll post some triggers that may help
 
Level 4
Joined
Jun 18, 2008
Messages
70
i think i fixed it somewhat-I made the zombies attack-move to the gates. The only problem is that if u make a barricade covering the entrance,they go around to a different area. I still need to know how to make them attack the player closest to them
 
Level 4
Joined
Jun 18, 2008
Messages
70
ok ok...I was kinda just bumping the forum to the top of the list, but I dont know if you do that or not in these forums. And also I really need to know how I make the zombies attack the barricades. If you build barricades blocking an area they wont come near. I can raise the priority, but that still wont help the zombies to not go around. I have the zombies attack-moving to a door. Is there a trigger were the zombies will attack thhe players closest to them, no matter what?

HELP?
 
Last edited:
Level 12
Joined
Apr 18, 2007
Messages
1,130
It's been awhile, dunno if you still need help. I kinda forgot about this, however...
I just remembered a trigger that might work
Lemmie boot up the editor hold on a sec
 
Status
Not open for further replies.
Top