• 🏆 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!

[Solved] Single creep attack and GUI help

Status
Not open for further replies.
Level 3
Joined
Dec 29, 2010
Messages
40
Hello.
I have 2 questions you probably find simple:

1.I'm trying to make a "Peacefull creep" system, which means the creep only attacks if he is also attacked. How do you do that?

2.How do you create a GUI window in the corner of the screen for example "Gnolls killed: X/5"



Thank-you in advance :grin:
 
Level 3
Joined
Dec 29, 2010
Messages
40
Give the creeps Orc burrow ability with 0 capacity so they can't attack. When they take damage, remove the ability. Add it back if the units exit combat.

That could work.

Or make the creeps passive initially, change to hostile when taking damage.

My god that didn't even occur to me. +Rep. Any idea for the 2nd?
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
For second you need leaderboards/multiboards.

  • Leaderboard - Create a leaderboard for (All players) titled Gnolls killed
For adding players into leaderboard (and setting values within) you have to use:
  • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label <string> and value 0
Whenever player kills the gnoll change the value displayed via:
  • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to 0
Store the value (gnolls killed) via integer array where index array is the player's number.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
Or make the creeps passive initially, change to hostile when taking damage.

If you do this then it will affect all creeps, meaning they will attack players even if they aren't being attacked. I would recommend the Burrow system.

2.
  • Trigger
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Gnoll
    • Actions
      • Set Gnolls_Killed[(Player number of (Owner of (Killing unit)))] = (Gnolls_Killed[(Player number of (Owner of (Killing unit)))] + 1)
      • Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Gnolls_Killed[(Player number of (Owner of (Killing unit)))]
Leaderboard tutorial here.
 
Status
Not open for further replies.
Top