Help with skill =/

Zorobay

Member
Reaction score
1
Hi,

I'm making a TD, and i have a tower that should represent Heimerdinger from LoL.

He has a skill where he spawns one, or two (if skill lvl >2) turrets (buildings). I have a trigger that prevents him from having more than two turrets active if the skill lvl is 3 or more. This trigger also removes the first turret he built if he tries to build a third one, and then builds the third one...hope you understand. The problem with this skill is that i store the turrets in a unit variable. This variable has two arrays, one for the first turret and one for the seconds. This works fine...as long as there is only ONE heimerdinger on the map =( If I build more than one, the onther heimers turrets begins to dissappear >.<

Is it possible to make a better version with triggers, or is there a skill that i can use that only allows him to have 1 or two turrets built?

TY!
 

Inflicted

Currently inactive
Reaction score
63
Firstly. Heimer is awesome. Total Fan.

And yeah try maybe having two unit arrays[]. One for each, like Turrets1[12] and Turrets2[12]. It wouldn't be appropriate if say there were 10 turrets. But for only two this is ok.
Although your triggers may not adjust perfectly.

This should be easy enough to make MPI.

I believe a Summon Ability like Feral Spirit or something only allowed it to be spawned once. And if you recast it, it removed the previous summons. However these were both spawned at the same time. So it's not the same as Heimer's selection.

About improving your trigger, we would need to see it first.
 

Zorobay

Member
Reaction score
1
Firstly. Heimer is awesome. Total Fan.

And yeah try maybe having two unit arrays[]. One for each, like Turrets1[12] and Turrets2[12]. It wouldn't be appropriate if say there were 10 turrets. But for only two this is ok.
Although your triggers may not adjust perfectly.

This should be easy enough to make MPI.

I believe a Summon Ability like Feral Spirit or something only allowed it to be spawned once. And if you recast it, it removed the previous summons. However these were both spawned at the same time. So it's not the same as Heimer's selection.

About improving your trigger, we would need to see it first.

Code:
Ya hmm i could use those arrays. The problem is that there can still only be 1 Heimer per player unless i make 24 variables with 12 arrays each >.<

code heimer turret lvl 1-2:
H28G Evolution Turret lvl 12
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to H-28G Evolution Turret (Heimerdinger)
        (Level of H-28G Evolution Turret (Heimerdinger) for (Casting unit)) Less than 3
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of H-28G Evolution Turret (Heimerdinger) for (Casting unit)) Equal to 1
            Then - Actions
                Unit - Create 1 H-28G Evolution Turret lvl 1 (Level 1 H-28G Evolution Turret) for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of H-28G Evolution Turret (Heimerdinger) for (Casting unit)) Equal to 2
                    Then - Actions
                        Unit - Create 1 H-28G Evolution Turret lvl 2 (Level 2 H-28G Evolution Turret) for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                unitThisLevelTurrets[1] Equal to No unit
            Then - Actions
                Set unitThisLevelTurrets[1] = (Last created unit)
            Else - Actions
                Special Effect - Create a special effect at (Position of unitThisLevelTurrets[1]) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                Unit - Remove unitThisLevelTurrets[1] from the game
                Set unitThisLevelTurrets[1] = (Last created unit)
'


level 3-5

Code:
H28G Evolution Turret lvl 345
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to H-28G Evolution Turret (Heimerdinger)
        (Level of H-28G Evolution Turret (Heimerdinger) for (Casting unit)) Greater than 2
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of H-28G Evolution Turret (Heimerdinger) for (Casting unit)) Equal to 3
            Then - Actions
                Unit - Create 1 H-28G Evolution Turret lvl 3 (Level 2 H-28G Evolution Turret) for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of H-28G Evolution Turret (Heimerdinger) for (Casting unit)) Equal to 4
                    Then - Actions
                        Unit - Create 1 H-28G Evolution Turret lvl 4 (Level 2 H-28G Evolution Turret) for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Level of H-28G Evolution Turret (Heimerdinger) for (Casting unit)) Equal to 5
                            Then - Actions
                                Unit - Create 1 H-28G Evolution Turret lvl 5 (Level 2 H-28G Evolution Turret) for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
                            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                unitThisLevelTurrets[1] Equal to No unit
            Then - Actions
                Set unitThisLevelTurrets[1] = (Last created unit)
            Else - Actions
                Special Effect - Create a special effect at (Position of unitThisLevelTurrets[2]) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                Unit - Remove unitThisLevelTurrets[2] from the game
                Set unitThisLevelTurrets[2] = unitThisLevelTurrets[1]
                Set unitThisLevelTurrets[1] = (Last created unit)
 

jnZ

I
Reaction score
64
to be honest, i didn't take the time to read the whole thread. but the problem is to refer to up to 2 turrets per heimerdinger via unique variables right?

you could do this by refering to custom values

Everytime you create a heimerdinger set its custom value to HeimerDingerIndex (Integer variable that starts at 0)
and set HeimerDingerIndex to HeimerDingerIndex + 2 afterwards.
when refering to his turrets set the first turret to HeimerDingerTurret[CustomValueOf(Heimerdinger)] and the second to HeimerDingerTurret[CustomValueOf(Heimerdinger) + 1]

i hope you get what i'am trying to say. like that every heimerdinger has a unique index (the first heimer has 0, the second has 2, the third has 4,...)
and their turrets are unique variables (heimerdinger 0(turret 0 and 1) heimerdinger 1(trurret 2 and 3), heimerdinger 3(turret 4 and 5), ....)
 

Zorobay

Member
Reaction score
1
to be honest, i didn't take the time to read the whole thread. but the problem is to refer to up to 2 turrets per heimerdinger via unique variables right?

you could do this by refering to custom values

Everytime you create a heimerdinger set its custom value to HeimerDingerIndex (Integer variable that starts at 0)
and set HeimerDingerIndex to HeimerDingerIndex + 2 afterwards.
when refering to his turrets set the first turret to HeimerDingerTurret[CustomValueOf(Heimerdinger)] and the second to HeimerDingerTurret[CustomValueOf(Heimerdinger) + 1]

i hope you get what i'am trying to say. like that every heimerdinger has a unique index (the first heimer has 0, the second has 2, the third has 4,...)
and their turrets are unique variables (heimerdinger 0(turret 0 and 1) heimerdinger 1(trurret 2 and 3), heimerdinger 3(turret 4 and 5), ....)

Huh, smart! There is one problem though. The custom values are used to as the amount of money you get when you sell a tower...hmm. I guess that i could make an exception for Heimerdinger...

TY!

Edit: Or wait...is point value and custom value the same thing?
Edit: Found out that is wasn't! How wonderful, then your trigger should work! TY!
 

Inflicted

Currently inactive
Reaction score
63
Code:
Ya hmm i could use those arrays. The problem is that there can still only be 1 Heimer per player unless i make 24 variables with 12 arrays each >.<

This should be easy enough to make MPI.
Apologies, I didn't realise it needed to be MUI.

Point Value is a preset value that's set in the Object Editor. More convenient for sell values as it is constant for each unit of that type.
Custom value is unique to each unit. It must be set via triggers.
 
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