Trigger to Update Unit?

O

Oliveira

Guest
i would like to know how i can make a simple trigger to, when a Unit hits a targets 100 times or kills 20 units it will become another Unit, i dont know how to use world editor verywell , but i wanted to make a melle map with this feature ~~
 

Petoj

New Member
Reaction score
1
i would like to know how i can make a simple trigger to, when a Unit hits a targets 100 times or kills 20 units it will become another Unit, i dont know how to use world editor verywell , but i wanted to make a melle map with this feature ~~

You could do it this way, give the unit mana and 0 regen, then make a trigger that adds 1 mana every hit and 5 mana if it kills a unit, and on the end of the trigger just check if you have 100 mana.. well i guess you get the rest?
 
G

Gafandriel

Guest
Wait...the unit that it is attacking becomes another unit, or the unit doing the azttacking chnages?


So like, a knight kills 100 creeps, he then becomes a cavaleir?
 

THE_X

New Member
Reaction score
49
you could use costom values of the killing unit,

Event: Unit kills a unit

Conditions:

Actions: Set costom value of unit to Costom value of unit + 1
If/then/else

If: Costom value of killing unit is equal to 100
Then: Unit remove Killing unit from game
Unit create 1 (blablaba) at position of killing unit facing 0 degrees.
Else: (check if the costom vlaue is something else and go on like that)
 
G

Gafandriel

Guest
thats something alone the line of what I would suggest, but i'm not really sure what you're asking =-P
 
O

Oliveira

Guest
Wait...the unit that it is attacking becomes another unit, or the unit doing the azttacking chnages?


So like, a knight kills 100 creeps, he then becomes a cavaleir?

Yes , something like that...my idea is.... Swordman Level 1 , when he kills 20 units he becomes Swordman Level 2 , and when it kill another 50 units he becomes level 3 .
The mana system its really nice , but some units have mana , and i dont want any mana burn problems
Its supposed to be something very simple , that works like Combat Experience on normal units
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Hope this helps

Code:
Upgrade
    Events
        Unit - A unit Dies
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Killing unit)) Equal to Bear (Level 1)
                (Unit-type of (Killing unit)) Equal to Raging Bear (Level 2)
    Actions
        Set Count = (Count + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Killing unit)) Equal to Bear (Level 1)
                Count Equal to 20
            Then - Actions
                Unit - Replace (Killing unit) with a Raging Bear (Level 2) using The new unit's default life and mana
                Set Count = 0
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Killing unit)) Equal to Raging Bear (Level 2)
                Count Equal to 50
            Then - Actions
                Unit - Replace (Killing unit) with a Spirit Bear (Level 3) using The new unit's default life and mana
                Set Count = 0
            Else - Actions
                Do nothing
 

IceWarrior98

New Member
Reaction score
12
I think custom values would be easier. He said a melee map so using custom values would make it so much easier as all you would need to do is add a number depending on kill or hit, and check if that value is right then replace. Using a count variable may cause issues regarding multiple units. It's like each unit becomes their own variable and if their variable is true then it will do as you wish.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top