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

Town Guards & Attack System {system that orders creeps to attack every 5 minutes}

Status
Not open for further replies.
Level 3
Joined
May 17, 2009
Messages
32
I have two questions:

1.How can I balance town guards with players and creeps?

2.Is it possible to setup a system where creeps attempt to attack a town every 5 minutes? How? (No jass please.)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
1. Is like with all ballencing, careful planning and making sure that they do not have anything abusable or that is better than anything else.

2. Yes via spawning or making creeps and then ordering them to attack or patrole to the town. Disabling sleeping is advisable as it gave me some grief when I tried such a system.
 
Level 4
Joined
Feb 25, 2008
Messages
58
Well that all depends on your map. I suggest making the guards able to quickly dispatch any threat, but don't go overboard. For instance, if your "town" is just the starting area of your heroes where they are killing level 1 spiders, then having a level 50 guard that does 200 damage probably isn't necessary. However, if you're making a huge city then you might want to have much more powerful guards to protect you from large threats.

Remember, it all depends on your map. Also, think of a real life situation. Back in the middle ages, the huge castles owned by feudal lords had the highly trained knights and mercenaries to protect the kings/lords. The country villages probably just had a peoples militia. In comparison, the trained castle's guards could easy defeat the inexperienced peasants.

As for making units attack the town, you'll need to use triggers for that. The trigger is fairly simple:

This is the first trigger, which sets up the timer. You'll need to create a "timer" variable to store the timer in.

  • Init
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start AttackTimer as a (One-shot OR Repeating) timer that will expire in 300.00 seconds
This is the second trigger:

  • Spawn
    • Events
      • Time - AttackTimer expires
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Neutral Hostile at (Center of (Spawn <gen>)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Attack-Move To (Center of Town <gen>)
Now, be warned, I think this leaks... you can get another user here to clean it up a bit, but this will do basically what you want (I hope)!
 
Level 3
Joined
May 17, 2009
Messages
32
Thank you NightSong! +rep

{EDIT}
ummm I tried editing first post but there was no prefix selection to make it solved so if admin could do that ty.
 
Last edited by a moderator:
Status
Not open for further replies.
Top