Capping amounts of Sentry Wards

lionheadxO

New Member
Reaction score
3
I'm making a skill based off sentry wards, and I was wondering if there is a way to cap the amount of wards you can place down at a single time.
 

Yoshii

New Member
Reaction score
74
when the player cast the ability do a selection by unit type; aka ward on the map that you own and if its greater than X then delete them so that when you cast the ability it will create new one.
 

MateoSoetsu

New Member
Reaction score
9
I think the only summon spell that has a limit is carrion beetles. You could remove the requirement of being cast on a corpse and just have it a summon spell, although you wouldn't be able to target where you wanted to summon the ward.
 

Yoshii

New Member
Reaction score
74
does that work if multiple units have the ability sentry ward?

if multiple unit owned by a single player can cast ward then the only way to limit the ward that i can think of would be to play with the Cooldown of the spell and its cost

well you could also do that whenever a hero cast the ability it look within a certain range if there is more than X and then delete but that would not work if you want to cast it then move away; plus other unit owned by the player could be affected
 

lionheadxO

New Member
Reaction score
3
k, so heres the basis of what im trying to do,

Sentry Wards 0 Mana, 10 Second Cooldown
Places a ward with 5 life that lasts indefinitely , 3 wards may be placed at once.

This skill is given to every hero. Every player can only have 1 hero.

I wasn't sure how to make the cap though. And I wasnt sure what you meant to do when you said "when the player cast the ability do a selection by unit type; aka ward on the map that you own and if its greater than X then delete them so that when you cast the ability it will create new one." Could you explain this step by step, in event/condition/action
 

jwallstone

New Member
Reaction score
33
Actually plenty of summon spells have limits. Feral Spirit, Summon Bear, Summon Hawk, etc, etc.
 

Yoshii

New Member
Reaction score
74
something like this:
Untitled Trigger 001
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Serpent Ward
Actions
Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Sentry Ward) and do (If ((Number of units in (Units owned by (Owner of (Casting unit)) of type Sentry Ward)) Greater than 3) then do (Unit - Remove (Picked unit) from the game) else do (Do nothing)).

I believe summon bear and summer wolf ability also have what you want so you could try base your ability from that instead.
 

Aphurea

New Member
Reaction score
3
Trigger:
  • Sentry Ward
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Sentry Ward
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ward1[(Player number of (Owner of (Casting unit)))] is empty) Equal to True
        • Then - Actions
          • Unit Group - Add (Summoned unit) to Ward1[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ward2[(Player number of (Owner of (Casting unit)))] is empty) Equal to True
            • Then - Actions
              • Unit Group - Add (Summoned unit) to Ward2[(Player number of (Owner of (Casting unit)))]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ward3[(Player number of (Owner of (Casting unit)))] is empty) Equal to True
                • Then - Actions
                  • Unit Group - Add (Summoned unit) to Ward3[(Player number of (Owner of (Casting unit)))]
                • Else - Actions
                  • Unit Group - Pick every unit in Ward1[(Player number of (Owner of (Casting unit)))] and do (Actions)
                    • Loop - Actions
                      • Unit - Remove (Picked unit) from the game
                  • Unit Group - Pick every unit in Ward2[(Player number of (Owner of (Casting unit)))] and do (Actions)
                    • Loop - Actions
                      • Unit Group - Add (Picked unit) to Ward1[(Player number of (Owner of (Casting unit)))]
                      • Unit Group - Remove (Picked unit) from Ward2[(Player number of (Owner of (Casting unit)))]
                  • Unit Group - Pick every unit in Ward3[(Player number of (Owner of (Casting unit)))] and do (Actions)
                    • Loop - Actions
                      • Unit Group - Add (Picked unit) to Ward2[(Player number of (Owner of (Casting unit)))]
                      • Unit Group - Remove (Picked unit) from Ward3[(Player number of (Owner of (Casting unit)))]
                  • Unit Group - Add (Summoned unit) to Ward3[(Player number of (Owner of (Casting unit)))]


Just needs 3 variables. Ward1/Ward2/Ward3. Make them arrays, and make the array count how many players you have. The Variables are unit groups.
This could technically be done using just "unit", wouldn't be hard to change. All the essentials are there.

I believe that should work. Refine/rewrite all you want.
 

lionheadxO

New Member
Reaction score
3
So I made that trigger exactly like what you have down Aphurea, but I can still place more than 3 wards. When I placed the 4th ward or more, the first ward isn't getting removed.

At the moment, my array is at 1, because I haven't added the other players into the map, could that be a problem?
 

lionheadxO

New Member
Reaction score
3
Trigger:
  • Sentry Ward
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Sentry Ward
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ward1[(Player number of (Owner of (Casting unit)))] is empty) Equal to True
        • Then - Actions
          • Unit Group - Add (Summoned unit) to Ward1[(Player number of (Owner of (Casting unit)))]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ward2[(Player number of (Owner of (Casting unit)))] is empty) Equal to True
            • Then - Actions
              • Unit Group - Add (Summoned unit) to Ward2[(Player number of (Owner of (Casting unit)))]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ward3[(Player number of (Owner of (Casting unit)))] is empty) Equal to True
                • Then - Actions
                  • Unit Group - Add (Summoned unit) to Ward3[(Player number of (Owner of (Casting unit)))]
                • Else - Actions
                  • Unit Group - Pick every unit in Ward1[(Player number of (Owner of (Casting unit)))] and do (Actions)
                    • Loop - Actions
                      • Unit - Remove (Picked unit) from the game
                  • Unit Group - Pick every unit in Ward2[(Player number of (Owner of (Casting unit)))] and do (Actions)
                    • Loop - Actions
                      • Unit Group - Add (Picked unit) to Ward1[(Player number of (Owner of (Casting unit)))]
                      • Unit Group - Remove (Picked unit) from Ward2[(Player number of (Owner of (Casting unit)))]
                  • Unit Group - Pick every unit in Ward3[(Player number of (Owner of (Casting unit)))] and do (Actions)
                    • Loop - Actions
                      • Unit Group - Add (Picked unit) to Ward2[(Player number of (Owner of (Casting unit)))]
                      • Unit Group - Remove (Picked unit) from Ward3[(Player number of (Owner of (Casting unit)))]
                  • Unit Group - Add (Summoned unit) to Ward3[(Player number of (Owner of (Casting unit)))]


so i made the trigger also, but it doesnt seem to be working
 
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