Replaceing the unit

gbubic2

Active Member
Reaction score
0
Can someone hellp me with replacing a unit?

I am trying to make some kind of lvl-ing for units. For example if Footman kills 3 other units i want him replaced with Footman "X" witch will be stronger. :banghead: And also i want to do this with other unit's?
Thanks!
 

SFilip

Gone but not forgotten
Reaction score
634
or simply use Unit - Replace action :rolleyes:
 
M

Mythic Fr0st

Guest
hmmm

Make the variable "Kills" array size about 200-300 (pending on how many footman is possible to have o_O)
TO high = Game breaking
Code:
Event - A unit dies
Conditions
Actions - Set kills[Custom Value Of Killing Unit] = Kills [Custom Value Of Killing Unit] + 1
   - if then else multiple functions
   - if conditions kills[custom value of killing unit] equal to 3
   - then actions replace killing unit with "footman stronger"
      - set custom value of last replaced unit to Count Number of units of type footmanstronger matching condition matching unit is alive
   - else actions (none)

Code:
Event - A unit is trained
Conditions unit type of trained unit equal to normal footman
Actions - Set Customvalue of trained unit to Count Number of units of type Footman matching condition Matching unit is alive
 

Slapshot136

Divide et impera
Reaction score
471
id go for change unit custom value for each kill and then if it's 3 to replace the unit, or adding an ability that gives +hp/damage
 
M

Mythic Fr0st

Guest
^_^ that'd work, same sorta thing, except mines a bit more complex lol... :)

Just make sure each kill you set the custom value of it up by 1 (Make sure teh conditions specifiy its an enemy, or players will kill they're units and abuse)
 

gbubic2

Active Member
Reaction score
0
Thanks for this!

Only i can't find this:
- set custom value of last replaced unit to Count Number of units of type footmanstronger matching condition matching unit is alive
- else actions (none)[/CODE]


Thanks
 
M

Mythic Fr0st

Guest
hmmm

Do you want to do it the way I said (With kills) or your way ?

nvm found easier way to do it
 

Slapshot136

Divide et impera
Reaction score
471
it's under actions -> unit
set custom value of (triggering unit) to (custom value of triggering unit + 1)
if (custom value of triggering unit) is equal to (3)
then replace (triggering unit) with (Footman X)
else do nothing
 
M

Mythic Fr0st

Guest
Heres the map

Heres the map I made for ya gbubic2
 

Attachments

  • Mettle.w3x
    15 KB · Views: 88

Mr Zero

Junior Regular (Got the T-shirt)
Reaction score
64
A very simple trigger :
(I have also attached a map)
Code:
Upgrade Unit
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Unit - Set the custom value of (Killing unit) to ((Custom value of (Killing unit)) + 1)
        Set Numbers_Of_Kills = (Custom value of (Killing unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Custom value of (Killing unit)) Equal to 3
            Then - Actions
                Unit - Replace (Killing unit) with a Captain using The new unit's default life and mana
                Unit - Set the custom value of (Last replaced unit) to Numbers_Of_Kills
            Else - Actions
                Do nothing
Hope it helps :)

EDIT: The map has been removed. PM me for the map if you want a copy.
 
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