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

Make units attack players even if out of sight

Status
Not open for further replies.
Level 3
Joined
Oct 3, 2009
Messages
29
Hiho

I have tried many times to make ehm lets say zombies attack players even if they are not in sight. I want like in zombie tags, kodo tag etc. How do you make that? :p

Ive tried many different things, and I still cant make it o.o Im a bad triggerer I guess haha

Sorry for bad english :e
Thanks in advance! :)
 
You will create a custom attack system, based on missiles.
First of all, go to your unit in your object editor, scroll to Combat - Attack 1 - Show UI and set it to False. Then, create an ability based on Channel ability and make your proper settings. Set Target type to No Target (Instant). Then comes the missile system part.

But, be more specific, how exactly does this work?
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
Woudln't it be easier to just turn fog of war off? You don't need it in Zombie maps, or Tags.
 
Level 3
Joined
Oct 3, 2009
Messages
29
You will create a custom attack system, based on missiles.
First of all, go to your unit in your object editor, scroll to Combat - Attack 1 - Show UI and set it to False. Then, create an ability based on Channel ability and make your proper settings. Set Target type to No Target (Instant). Then comes the missile system part.

But, be more specific, how exactly does this work?

How is this going to work? What does the ability "Channel"? :e
Does it make the units to go after and attack the players unit?
If youve played zombie tag or kodo tag you know what I mean, I want it to be exactly like there so zombies "search" or target the players and kill them.. and the humans should be able to build blocks and towers etc but the zombies will destroy whats in the way..

I've created the ability now and it does not work, what am I doing from? :-S Or could you explain easier haha? Do you know that its working?
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
First of all, please dont double post, second of all, i thougth it would work? What is the trigger?
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
I think he means that the ZOMBIES that spawns will go on and attack to the target unit, as in search for him.
 
Level 3
Joined
Oct 3, 2009
Messages
29
No, I haven't played Zombie Tag, so you need to define what "search" means. Do you cast an ability and a missile will search for the enemies, what?

Ah, okey.. Search means that the zombie (cpu) is going to walk around on the map and try to found the players wich is hiding somewhere on the map, when the zombie finds the player(s) it is going to attack and kill the player(s). And when they are dead the zombie is going to start running around again until he finds another player.

And the player is supposed to survive by building walls(block) and towers and such to protect themselfs, while the zombie(s)(cpu) is after them.

Did you get it?
 
I now realized how it works, but I guess I need to play that map-type to realize the mechanics. So far, I can understand a trigger like this:
  • Trigger1
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Oick every unit in (Units in (Playable Map Area) matching ((Matching unit) is a Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • Set Hero = (Picked unit)
        • Custom script: set udg_X1 = GetUnitX(GetEnumUnit())
        • Custom script: set udg_Y1 = GetUnitY(GetEnumUnit())
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units of type (Zombie)) and do (Actions)
          • Loop - Actions
            • If (All conditions are true then do (Actions) else do (Actions)
              • If - Conditions
                • ((Picked unit) belongs to an enemy of (Owner of (Hero)) Equal to True
              • Then - Actions
                • Set Point1 = (X1,Y1)
                • Unit - Order (Picked unit) to Attack - Move to Point1
                • Custom script: call RemoveLocation (udg_Point1)
              • Else - Actions
X1, Y1 => Real variables
Point1 => Point variable
Hero => Unit variable

References:
[•] http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/
[•] http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
[•] http://www.hiveworkshop.com/forums/...als-279/complete-concise-gui-tutorial-111863/
 
Last edited:
Level 13
Joined
Feb 18, 2009
Messages
1,381
OK i've been thinking and to do this you MUST have 1 variable
  • Adding zombies to Zombiegroup
  • Event : A unit enters playable map area
  • Conditions : Triggering unit is a zombie equal to true
  • Actions : Add triggering unit to ZombieGroup (The variable)
  • Searching
  • Event : Time - Every 30 seconds of gametime
  • Conditions :
  • Actions : Pick all units in ZombieGroup and do actions :
  • Order picked unit to attack to a random point in playable map area.
  • Attacking
  • Event - Unit - A unit takes damage
  • Conditions : Triggering unit is a zombie
  • Actions : Pick all units in ZombieGroup and do actions
  • Unit - Order Picked unit to attack to position of triggering unit
I don't hope it leaks, or i suck.. Lawl

EDIT : Pharaoh_ answered before me :)
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You could create regions and set them to an array. When you spawn zombies make them move to the closest region.

Then you can use "Unit enters region". You could randomize the region for the zombie to go to next when it enters some region. Create this kind of pseudo-random wandering system.

It might or might not work better than zombies automatically knowing where the hero(es) are.
 
Level 3
Joined
Oct 3, 2009
Messages
29
Thanks everyone for suggestions! :)
It works with the trigger Pharaoh and Etzer send me, thank you! +Rep for you! :D

But I have one more problem!
When you build block and a arrow tower behind it, the zombie just stands there, I want it to attack the block and then attack the arrow tower. Since the zombie is targeted on the arrow tower it dosnt attack the block so you can cheat if you do so. ( If its just 1 way in and its a tower in the way the zombie dosnt attack the tower wich is in the way because the attack tower makes the zombie target the attack tower when it attack.. I need help to make the zombie attack the tower in the way first! )

What I want: To make so the zombie attacks the "block" and after that it attacks the "attack" tower.
+Rep for the helper(s) (A) :)
 
Thanks everyone for suggestions! :)
When you build block and a arrow tower behind it, the zombie just stands there, I want it to attack the block and then attack the arrow tower. Since the zombie is targeted on the arrow tower it dosnt attack the block so you can cheat if you do so. ( If its just 1 way in and its a tower in the way the zombie dosnt attack the tower wich is in the way because the attack tower makes the zombie target the attack tower when it attack.. I need help to make the zombie attack the tower in the way first! )

What I want: To make so the zombie attacks the "block" and after that it attacks the "attack" tower.

make the walls deal 1 point of damage (you can set the attack speed to a very high value like once in every 10 seconds [probably even more] )
to make them influence the gameplay even less you can disable the UI and set the damage type to a damage type which is weak against your zombies or even change the gameplay data to make some attack type deal 0% damage against all armor types

spells and triggers don't work to pull the aggression of the attackers for some reason (but there might be a way to do it though)
unchecking "Is building" works, too but unfortunately it disables the pathblocking of towers/walls

regarding your first post:
  • MakeUnitsAttack
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile (or any other player)
    • Actions
      • Unit - Set (Triggering unit) acquisition range to 12345.00 (makes units automatically attack an enemy within that range)
 
Last edited:
Level 3
Joined
Oct 3, 2009
Messages
29
make the walls deal 1 point of damage (you can set the attack speed to a very high value like once in every 10 seconds [probably even more] )
to make them influence the gameplay even less you can disable the UI and set the damage type to a damage type which is weak against your zombies or even change the gameplay data to make some attack type deal 0% damage against all armor types

spells and triggers don't work to pull the aggression of the attackers for some reason (but there might be a way to do it though)
unchecking "Is building" works, too but unfortunately it disables the pathblocking of towers/walls

regarding your first post:
  • MakeUnitsAttack
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile (or any other player)
    • Actions
      • Unit - Set (Triggering unit) acquisition range to 12345.00 (makes units automatically attack an enemy within that range)

Thanks for the tip! It worked :) But the acquisting range thing didnt work if you have cliffs and stuff and some blocks the zombies just walks into the cliffs haha :p

Thanks! :))
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
set target acquiring range of zombies to 9999999 (its in object editor)

and make dummy birds with sight 9999999 than can go with a group of zombies to see the enemy heroes
OR Better
make players treat owner of zombie as an enemy with shared vision

did you try it ? -.-,it works and its better than setting groups every 1 seconds,but do whatever you want -.-


just use some more simple suggestion,not some dumb large trigger that will run every second
 
Level 3
Joined
Oct 3, 2009
Messages
29
set target acquiring range of zombies to 9999999 (its in object editor)

and make dummy birds with sight 9999999 than can go with a group of zombies to see the enemy heroes
OR Better
make players treat owner of zombie as an enemy with shared vision

did you try it ? -.-,it works and its better than setting groups every 1 seconds,but do whatever you want -.-


just use some more simple suggestion,not some dumb large trigger that will run every second

Yes, the thing you said right now I'm using and it works very good.
But theres a problem with it, if the zombies are going for a far trip they stop after a while and walks back to where they spawn. When back they begin running to the enemy again and after a while they walks back again.

How do I fix this? :/ I want the zombies to not stop walking o.o and kill everything on the map, when all enemies are dead then they can stop.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Yes, the thing you said right now I'm using and it works very good.
But theres a problem with it, if the zombies are going for a far trip they stop after a while and walks back to where they spawn. When back they begin running to the enemy again and after a while they walks back again.

How do I fix this? :/ I want the zombies to not stop walking o.o and kill everything on the map, when all enemies are dead then they can stop.
when zombie kills a unit order that zombie to stop
OR
maybe you just need to set bigger acquiring range (press shift+enter and than set to more)
OR
ignore unit´s guard position (use it on created zombies,its in trigger actions for units)
OR
maybe you need to change unit flee (its in object editor)


and about the blocks,i think you will need to add them an aura that damages for 1 hit point per sec just like D4RK_G4ND4LF said

not sure if you know it but ... xD Edit/Find is best way to find things,just type "damage aura (tornado)"
 
Last edited:
Level 3
Joined
Oct 3, 2009
Messages
29
when zombie kills a unit order that zombie to stop
OR
maybe you just need to set bigger acquiring range (press shift+enter and than set to more)
OR
ignore unit´s guard position (use it on created zombies,its in trigger actions for units)
OR
maybe you need to change unit flee (its in object editor)


and about the blocks,i think you will need to add them an aura that damages for 1 hit point per sec just like D4RK_G4ND4LF said

not sure if you know it but ... xD Edit/Find is best way to find things,just type "damage aura (tornado)"

Yes I have max in acquiring range, but the problem is that the zombies run back to the place they were spawned. ._.
How do you make "ignore units guard position" can you explain easier? :e
And I've changed "flee" to faulse but it dosnt matter. :p
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Yes I have max in acquiring range, but the
How do you make "ignore units guard position" can you explain easier? :e
not sure where it is now.... :(


here is another way

EVENT
unit is ordered targeting a point
CONDITION
issued order equal to move
unit type of trigger unit equal to zombie
ACTION
pause trigger unit
unpause trigger unit
order trigger unit to stop


here is a testing map for it too :D
http://www.mediafire.com/file/jnz2mmmurt1
 
Level 3
Joined
Oct 3, 2009
Messages
29
not sure where it is now.... :(


here is another way

EVENT
unit is ordered targeting a point
CONDITION
issued order equal to move
unit type of trigger unit equal to zombie
ACTION
pause trigger unit
unpause trigger unit
order trigger unit to stop


here is a testing map for it too :D
http://www.mediafire.com/file/jnz2mmmurt1

Oh god, it really worked! Thanks so much, and for having the time to make a map! Its really apreciated! thanks man :)
 
Status
Not open for further replies.
Top