When unit die a new unit

Vacko

New Member
Reaction score
0
Hey! ^^

Well as the title says, when a unit dies a new unit comes, like this.

One player is orc and the other is undead, if the undead kills orcs they become ghouls, but if the orc kills the undeads they become grunt. Is that possible?

Its like stealing units xD I'm not sure how to explain it but, I hope you will understand that.

And if thats possible, is it even possible to make it, that if the orc player upgrade so it will be lets say tauron, then tauron will be spawned instead of grunts when a undead is dead. It seems really hard to understand, I'm not even sure how I'm going to trigger this.

ty for reading this ^^
 

pwd

New Member
Reaction score
0
Look into Triggers, I'd give you the exact answer but I'm working on some things right now and its quite simple to create triggers.
 

miroking

New Member
Reaction score
0
i will do a little trigger here for u i dont know if will work but i test and if work better :)

here the triggers, lets say have 2 players (player 1 orc) and (player 2 undead)

Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Grunt
    • Actions
      • Unit - Create 1 Ghoul For (Owner of (Killing unit)) at (Position of (Dying unit)) facing Default building facing degrees


and

Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Ghoul
    • Actions
      • Unit - Create 1 Grunt For (Owner of (Killing unit)) at (Position of (Dying unit)) facing Default building facing degrees


;D
 

Jscooby

New Member
Reaction score
1
Hmmm, do you mean something like this?

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
      • (Race of Player 1 (Red)) Equal to Orc
    • Actions
      • Unit - Create 1 Ghoul for Player 2 (Blue) at (Position of (Triggering unit)) facing (Center of (Playable map area))


What my trigger says is when a unit dies owned by Red, and that unit is an orc then it will create a ghoul for Blue where the orc died.

Or you could do this...

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Grunt
    • Actions
      • Unit - Create 1 Ghoul for Player 2 (Blue) at (Position of (Triggering unit)) facing (Center of (Playable map area))


And...
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Ghoul
    • Actions
      • Unit - Create 1 Grunt for Player 1 (Red) at (Position of (Triggering unit)) facing (Center of (Playable map area))


Only problem I see with my triggers is the creation for the player. I don't know how to make it create for the killer of the triggering unit. (New to triggers myself.)
 

jomik

New Member
Reaction score
17
Think you want something like this?
Trigger:
  • Set Up
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Player(12))) Equal to Human
            • Then - Actions
              • Set Unit2Spawn[(Integer A)] = Footman
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Race of (Player(12))) Equal to Orc
                • Then - Actions
                  • Set Unit2Spawn[(Integer A)] = Grunt
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Race of (Player(12))) Equal to Undead
                    • Then - Actions
                      • Set Unit2Spawn[(Integer A)] = Ghoul
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Race of (Player(12))) Equal to Night Elf
                        • Then - Actions
                          • Set Unit2Spawn[(Integer A)] = Archer
                        • Else - Actions


Trigger:
  • Steal
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set tempPoint = (Position of (Triggering unit))
      • Unit - Create 1 Unit2Spawn[(Player number of (Owner of (Killing unit)))] for (Owner of (Killing unit)) at tempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_tempPoint)


Trigger:
  • Upgrade
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • -------- Check What Upgrade --------
      • Set Unit2Spawn[(Player number of (Owner of (Triggering unit)))] = Rifleman
      • -------- Set the new unit for the player --------


Unit2Spawn is a unit-type array.
tempPoint is a point variable.
 

Vacko

New Member
Reaction score
0
okay... Now I'm really confused, sometimes it works sometimes not o_O what does that mean xD
 

Vacko

New Member
Reaction score
0
The triggers from Jomik,

I'm sure i did them correct but still, its like gamble, I choose orc and have grunts, when i kill i get one grunt, but when i quit game and try again i got a something else, always something else after a game o_O but ingame when i get the first it stays that way, because I want that we can choose free which race we wanna be, so his was the closest one ^^ but ty for trying too ^^
 

bLu3_eYeS

New Member
Reaction score
31
DOWNLOAD THIS DEMO MAP ! it works and if you kill your own unit you do not get anything...only if you kill enemy unit you get a ghoul/grunt :thup:

Edit: I'm Making A Demo Map For'ya :D
EDIT2: Here'ya go:
Click to Download
 

HydraRancher

Truth begins in lies
Reaction score
197
The triggers from Jomik,

I'm sure i did them correct but still, its like gamble, I choose orc and have grunts, when i kill i get one grunt, but when i quit game and try again i got a something else, always something else after a game o_O but ingame when i get the first it stays that way, because I want that we can choose free which race we wanna be, so his was the closest one ^^ but ty for trying too ^^

His triggers confuse me, try out bLu3_eYeS's DEMO MAP.


>bLu3_eYeS
Please dont use so much colour and size.
Some guy whom I forgot the name said:
Colour annoys people.
 

jomik

New Member
Reaction score
17
DOWNLOAD THIS DEMO MAP ! it works and if you kill your own unit you do not get anything...only if you kill enemy unit you get a ghoul/grunt :thup:

Edit: I'm Making A Demo Map For'ya :D
EDIT2: Here'ya go:
Click to Download

Well as I understood it it was if you killed ANY unit, not just a grunt that turned to ghoul (that was an example) :p
But I don't get why it doesn't work all the time? You simply don't get a unit? Or you get another unit?

EDIT: Removed that damned color/size from the link in the quote -.-
 

bLu3_eYeS

New Member
Reaction score
31
Well as I understood it it was if you killed ANY unit, not just a grunt that turned to ghoul (that was an example) :p
But I don't get why it doesn't work all the time? You simply don't get a unit? Or you get another unit?

EDIT: Removed that damned color/size from the link in the quote -.-

Erm. I used a condition so if you're orc race and you kill a grunt you don't get a ghoul because it's undead race. so it works just if you kill enemy units.
 

Vacko

New Member
Reaction score
0
Okay here is the triggers,
Trigger:
  • Set Up
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Player(12))) Equal to Human
            • Then - Actions
              • Set Unit2Spawn[(Integer A)] = Footman
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Race of (Player(12))) Equal to Orc
                • Then - Actions
                  • Set Unit2Spawn[(Integer A)] = Grunt
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Race of (Player(12))) Equal to Undead
                    • Then - Actions
                      • Set Unit2Spawn[(Integer A)] = Ghoul
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Race of (Player(12))) Equal to Night Elf
                        • Then - Actions
                          • Set Unit2Spawn[(Integer A)] = Archer
                        • Else - Actions

Trigger:
  • Steal
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set tempPoint = (Position of (Triggering unit))
      • Unit - Create 1 Unit2Spawn[(Player number of (Owner of (Killing unit)))] for (Owner of (Killing unit)) at tempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_tempPoint)


So I can't see any difference between them.
but maybe those Variable, here;
Variable name: tempPoint
Variable type: Point
[ ] Array
Initial Value: none

Variable name: Unit2Spawn
Variable type: Unit-type
[X] Array
Initial Value: None

Well, when I'm in the WE editor and try it out it always become a ghoul, dunno why, and when save it, and go to wc3 then load it up and play there it has sometimes like 50% to be correct, but when I'm finished and I click Restart instead of Quit game or something, then its like 90% to not work o_O I just don't understand that.
 

jomik

New Member
Reaction score
17
Can you upload a demo map with it so I can see ? :O It worked for me, but I deleted the map.
 

Vacko

New Member
Reaction score
0
Okay here it is.

-thank bLu3_eYeS, never had used it, normaly filefront or something xD

Ehm it is 5 grunts already, and 1 footman, I choose orc then I play, it works but second time I try or something I get a ghoul or archer o_O its weird.
 

jomik

New Member
Reaction score
17
Umm, I figured the problem :p It's supposed to be this :D


Trigger:
  • Set Up
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Player(Integer A))) Equal to Human
            • Then - Actions
              • Set Unit2Spawn[(Integer A)] = Footman
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Race of (Player(Integer A))) Equal to Orc
                • Then - Actions
                  • Set Unit2Spawn[(Integer A)] = Grunt
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Race of (Player(Integer A))) Equal to Undead
                    • Then - Actions
                      • Set Unit2Spawn[(Integer A)] = Ghoul
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Race of (Player(Integer A))) Equal to Night Elf
                        • Then - Actions
                          • Set Unit2Spawn[(Integer A)] = Archer
                        • Else - Actions


Trigger:
  • Steal
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set tempPoint = (Position of (Triggering unit))
      • Unit - Create 1 Unit2Spawn[(Player number of (Owner of (Killing unit)))] for (Owner of (Killing unit)) at tempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_tempPoint)


Trigger:
  • Upgrade
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • -------- Check What Upgrade --------
      • Set Unit2Spawn[(Player number of (Owner of (Triggering unit)))] = Rifleman
      • -------- Set the new unit for the player --------


Unit2Spawn is a unit-type array.
tempPoint is a point variable.
 

Vacko

New Member
Reaction score
0
Trigger:
  • Set Up
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Player((Integer A)))) Equal to Human
            • Then - Actions
              • Set Unit2Spawn[(Integer A)] = Footman
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Race of (Player((Integer A)))) Equal to Orc
                • Then - Actions
                  • Set Unit2Spawn[(Integer A)] = Grunt
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Race of (Player((Integer A)))) Equal to Undead
                    • Then - Actions
                      • Set Unit2Spawn[(Integer A)] = Ghoul
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Race of (Player((Integer A)))) Equal to Night Elf
                        • Then - Actions
                          • Set Unit2Spawn[(Integer A)] = Archer
                        • Else - Actions


I tried it again o_O but this time I was Orc, with those 5 grunts, I got archer 3 times in a row o_O this was much harder than I though ._.
 

Bogrim

y hello thar
Reaction score
154
A much, much easier way to approach this is to use the ability "Spawn Hydra". Change ownership of the spawned unit and use the ability Chaos to morph the units you spawn into higher forms with upgrades.

Take a look at the attached map to form yourself an idea of how this ability system would work.

You would still need to work out a system depending on what races and units you plan to use.
 

jomik

New Member
Reaction score
17
Umm Bogrim, that seems like a pain in the ass to do :p
Vacko, you're sure you weren't Night Elf? :p

Bogrim, that method fails :D How would you know if it should be Red, Blue, Green, Orange, whatever? :p You have no way of detecting what player :D
 

Bogrim

y hello thar
Reaction score
154
Umm Bogrim, that seems like a pain in the ass to do :p
Vacko, you're sure you weren't Night Elf? :p
It depends on how elaborate the trigger needs to be. If he's just using two players with two different races, Spawn Hydra simplifies the system by allowing you to set which units they should morph into in the object editor itself.

If he's using eight players with 4 different races, your approach with a variable system is required.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top