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

Enemy NPC Heroes, Creeps, And Traps

Status
Not open for further replies.
Level 2
Joined
Mar 13, 2012
Messages
19
Hi, this is my first posted question, and I am new to warcraft 3 modding. I know how to make a map, but right now I am still learning the Trigger Editor.

In my first mod, I made a hero battle arena where hero characters move around inside a maze as they hunt each other in a deathmatch. The maze has four heroes, four creeps, and some traps. This map is single player, and the object of the game is to kill the opponents and survive. The last hero standing wins.

I want the enemy NPC heroes to move around inside the maze and attack when they spot another NPC or player, and then attack. The creeps will do the same thing and respawn after they die. The players and NPC heroes will each have three lives. When one of them runs out of lives, they will stop repsawning, and the last hero will win. The traps are suppose to inflict damage to the player and NPC heroes if they walk over or through them.

Anybody know the triggers I need to make this map function?

:eekani:
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
the lives can be stored in a variable that when empty cause the hero to stay dead
i am not sure if variable empty when hero die because still also u can handle dead unit well, also variable just pointer, but anyway have boolean condition for check if unit is alive or no, and that accurated, checking variables isnt accurated

(example unit indexer too keep custom value on unit, even unit dead, only after unit bone already decayed his index recycled)
 
Last edited:
Level 21
Joined
Mar 2, 2010
Messages
3,069
this trigger should be what you need.

example
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Paladin
Actions
Set test = (test - 1.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
test Greater than or equal to 1.00
Then - Actions
Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
Else - Actions
Do nothing
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
so overall for force enemy heroes to action, u need a ai system, example this
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/ai-tips-please-213112/

then u can try make something like this (its not most efficient but u can understand the main point)

Map init trigger - this running 1st time in your map

  • Map init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- he reveal the map for this demo test map --------
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • -------- we declare the potentional hero list --------
      • Set Heroes[0] = Paladin
      • Set Heroes[1] = Archmage
      • Set Heroes[2] = Mountain King
      • Set Heroes[3] = Blood Mage
      • Set Heroes[4] = Sylvanas Windrunner
      • Set Heroes[5] = Blademaster
      • Set Heroes[6] = Far Seer
      • Set Heroes[7] = Tauren Chieftain
      • Set Heroes[8] = Shadow Hunter
      • Set Heroes[9] = Rexxar
      • Set Heroes[10] = Chen Stormstout
      • -------- we set computer player lives --------
      • Set Lives[1] = 1
      • Set Lives[2] = 3
      • Set Lives[3] = 3
      • Set Lives[4] = 3
      • Set Lives[5] = 3
      • -------- player 1 is u, so i set life to 1 --------
      • -------- we set the starter position where the heroes spawn --------
      • Set StartPosition[1] = Player 1 <gen>
      • Set StartPosition[2] = Player 2 <gen>
      • Set StartPosition[3] = Player 3 <gen>
      • Set StartPosition[4] = Player 4 <gen>
      • Set StartPosition[5] = Player 5 <gen>
      • -------- we spawn to each player 1 hero --------
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set Point = (Random point in StartPosition[(Integer A)])
          • Unit - Create 1 Heroes[(Random integer number between 0 and 10)] for (Player((Integer A))) at Point facing Default building facing degrees
          • Set PlayingHeroes[(Integer A)] = (Last created unit)
then counting and revive trigger - this keep tracking how much life left the dieng unit, if he dont have more life then defeat to that player

  • Hero Die
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set PlayerNumber = (Player number of (Owner of (Dying unit)))
      • Set Lives[PlayerNumber] = (Lives[PlayerNumber] - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Lives[PlayerNumber] Greater than 0
        • Then - Actions
          • Set Point = (Random point in StartPosition[PlayerNumber])
          • Hero - Instantly revive (Dying unit) at Point, Hide revival graphics
          • Game - Display to (All players) the text: ((Name of (Dying unit)) + ( lost 1 life. + ((String(Lives[PlayerNumber])) + left.)))
        • Else - Actions
          • Game - Display to (All players) the text: ((Name of (Player(PlayerNumber))) + lost this game)
          • Game - Defeat (Player(PlayerNumber)) with the message: Defeat!
          • -------- we check how much player playing --------
          • Set Count = 0
          • For each (Integer A) from 1 to 5, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Lives[(Integer A)] Greater than 0
                • Then - Actions
                  • Set Count = (Count + 1)
                • Else - Actions
          • Game - Display to (All players) the text: (Still + ((String(Count)) + player in game.))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Count Equal to 1
              • Lives[1] Greater than 0
            • Then - Actions
              • Game - Display to (All players) the text: You win
              • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
            • Else - Actions
u can check in this map how its work
 

Attachments

  • Demo_maze.w3x
    22.5 KB · Views: 55
Level 21
Joined
Mar 2, 2010
Messages
3,069
ignore the troll and follow my examples instead. my solution is much easier. you do need to work with the ai editor though. you will need to copy the trigger i made for each hero and create 1 real variable for each hero. then you need a trigger to add values to each variable equal to the amount of lives each hero have.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
ignore the troll and follow my examples instead. my solution is much easier. you do need to work with the ai editor though. you will need to copy the trigger i made for each hero and create 1 real variable for each hero. then you need a trigger to add values to each variable equal to the amount of lives each hero have.

u could tell me why my post is troll lol?
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Paladin
  • Actions
    • Set test = (test - 1.00)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • test Greater than or equal to 1.00
    • Then - Actions
      • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
      • Else - Actions
-u do similiar thing but u use real variable instead integer (what kinda useless because mainly real variable used for more complex calculations for make more accurate result)
also for this u need 5 variable if have 5 hero, but acctually a integer array is enough
-u can store point to variable then u can remove the point leak :p
-u revive heroes to his dying position? idk if that have sense....
-u dont solved the problem "about who survive win" and who lost all life lose
-use
  • tag because easier to read.
  • -idk if somebody use ai only for make action to heroes its work similiar well than a ai system
  • .....................
  • its not against you, i just wrote have few hole point.
 
Last edited:
Level 21
Joined
Mar 2, 2010
Messages
3,069
victory script isnt my strength but i should be able to come up with something. your script is too advanced for even me to understand so how can i newbie understand it. please learn proper spelling. here is a victory trigger that should work.
example 2
Events
Game - heroes becomes Equal to 0.00
Conditions
Actions
Game - Defeat Player 1 (Red) with the message: Defeat!

heroes is the number of heroes in play on the player`s side. the victory condition would be similar except that you use a different variable to store the value of the computer heroes. you also need to replace game - defeat with game - victory. you also need to change the trigger i posted earlier to this:


example
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Paladin
Actions
Set test = (test - 1.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
test Greater than or equal to 1.00
Then - Actions
Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
Else - Actions
Set heroes = (heroes - 1.00)

position of dying unit is just a placeholder and you can change it to whatever you want.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
victory script isnt my strength but i should be able to come up with something. your script is too advanced for even me to understand so how can i newbie understand it. please learn proper spelling. here is a victory trigger that should work.
example 2
Events
Game - heroes becomes Equal to 0.00
Conditions
Actions
Game - Defeat Player 1 (Red) with the message: Defeat!

heroes is the number of heroes in play on the player`s side. the victory condition would be similar except that you use a different variable to store the value of the computer heroes. you also need to replace game - defeat with game - victory. you also need to change the trigger i posted earlier to this:


example
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Paladin
Actions
Set test = (test - 1.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
test Greater than or equal to 1.00
Then - Actions
Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
Else - Actions
Set heroes = (heroes - 1.00)

position of dying unit is just a placeholder and you can change it to whatever you want.

its isnt advanced just i use arrays and 5 region, because ok its placeholder but without region or useing another array/5 variable who u make different respawn location than dying unit position?

alos if u noticed it isnt advanced, just i made that part where u create heroes, u skipped that point also pls use
  • [/ trigger] becase when u use loop/if's or something, who read cant know where is the lines
  • and again, this absolute not advanced only more customizable (u can customize the lifes/respawn region/heroes)
  • if u remove the display text lines also map init trigger, i dont see too much difference exclude u use +1 trigger what is useless
  • (victory condition could be inside the dieing trigger)
  • also do nothing action is useless, u just complicated it more than it is :P
 
Level 4
Joined
Mar 12, 2009
Messages
64
victory script isnt my strength but i should be able to come up with something. your script is too advanced for even me to understand so how can i newbie understand it. please learn proper spelling. here is a victory trigger that should work.
example 2
Events
Game - heroes becomes Equal to 0.00
Conditions
Actions
Game - Defeat Player 1 (Red) with the message: Defeat!

heroes is the number of heroes in play on the player`s side. the victory condition would be similar except that you use a different variable to store the value of the computer heroes. you also need to replace game - defeat with game - victory. you also need to change the trigger i posted earlier to this:


example
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Paladin
Actions
Set test = (test - 1.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
test Greater than or equal to 1.00
Then - Actions
Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
Else - Actions
Set heroes = (heroes - 1.00)

position of dying unit is just a placeholder and you can change it to whatever you want.

One problem with that is if he has multiple heroes, he would need to make more triggers. your way only provides with one hero. Plus if he wants the dying hero to go back to a certain spot, using
Then - Actions
Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
just will not work. (just most people like the units to go back to their starting positions.)
I find shadows way a lot better way of making it run smoothly. I'm a pretty new to triggers myself and what shadow has made is not very advanced at all.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Level 2
Joined
Mar 13, 2012
Messages
19
I exported your demo maze trigger and imported it into my battle maze map. It works, but my characters are all attacking each other in one spot, and it says I was defeated after one of them died.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
I exported your demo maze trigger and imported it into my battle maze map. It works, but my characters are all attacking each other in one spot, and it says I was defeated after one of them died.

u can upload the map for me? i wanna check

(u copyed map init trigger too? there was stored the lifes)

(ups a little thing i forget too, u must create the regions in your own map where u want respawn the each heroe)
 
Level 2
Joined
Mar 13, 2012
Messages
19
How to I add the respawn spots? Also I want the enemy heroes to retreat and recover when their HP becomes low.

On your map, the opponents don't move. They only attack when the panda character attacks them.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
How to I add the respawn spots? Also I want the enemy heroes to retreat and recover when their HP becomes low.

On your map, the opponents don't move. They only attack when the panda character attacks them.

because i said u need ai system for that, i gived link in 1st page because have in spell section :)

respawn spot just 5 region what u can make in WE, and just set in map init.

for retreat computer hero also the ai system the answer because that also part of ai systems.

http://www.hiveworkshop.com/forums/spells-569/gui-ai-system-v1-2-5-a-211823/
 
Level 2
Joined
Mar 13, 2012
Messages
19
How do I set up the resawn regions in map init?

I added the ai system into my map, but the ai enemies are not working.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814

Attachments

  • 1.jpg
    1.jpg
    104.6 KB · Views: 153
  • 2.jpg
    2.jpg
    102.3 KB · Views: 116
Status
Not open for further replies.
Top