Power Shield

I can't add a specific unit event in the trigger. The only possibility is if I select a unit from the map.
 
Thanks for all the help. Finnally is working :D

Thanks KaerfNomekop, GFreak45 and all others.

This is how is working (I know is not the best way to do it, but i'll leave it like this :p):

Trigger:
  • Power Shield
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Power Shield
    • Actions
      • Set PowerShield_Caster = (Casting unit)
      • Set PowerShield_Target = (Target unit of ability being cast)
      • Unit - Create 1 Dummy for Player 1 (Red) at (Position of PowerShield_Target) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pit Lord - Howl Of Terror
      • Unit - Remove (Last created unit) from the game
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Power Shield for PowerShield_Caster) Equal to 1
        • Then - Actions
          • Set PowerShield_ShieldLife = 200.00
          • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in 15.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PowerShield_TakesDamageEvent Equal to False
            • Then - Actions
              • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
              • Set PowerShield_TakesDamageEvent = True
            • Else - Actions
              • Do nothing
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Power Shield for PowerShield_Caster) Equal to 2
            • Then - Actions
              • Set PowerShield_ShieldLife = 300.00
              • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in 20.00 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PowerShield_TakesDamageEvent Equal to False
                • Then - Actions
                  • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
                  • Set PowerShield_TakesDamageEvent = True
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Power Shield for PowerShield_Caster) Equal to 3
                • Then - Actions
                  • Set PowerShield_ShieldLife = 400.00
                  • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in 25.00 seconds
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • PowerShield_TakesDamageEvent Equal to False
                    • Then - Actions
                      • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
                      • Set PowerShield_TakesDamageEvent = True
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • Set PowerShield_ShieldLife = 500.00
                  • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in 30.00 seconds
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • PowerShield_TakesDamageEvent Equal to False
                    • Then - Actions
                      • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
                      • Set PowerShield_TakesDamageEvent = True
                    • Else - Actions
                      • Do nothing


Trigger:
  • Power Shield Activate
    • Events
    • Conditions
      • (PowerShield_Target has buff Power Shield ) Equal to True
    • Actions
      • Unit - Set life of PowerShield_Target to ((Life of PowerShield_Target) + (Damage taken))
      • Set PowerShield_ShieldLife = (PowerShield_ShieldLife - (Damage taken))


Trigger:
  • Power Shield DeActivate 1
    • Events
      • Game - PowerShield_ShieldLife becomes Less than or equal to 0.00
    • Conditions
    • Actions
      • Unit - Remove Power Shield buff from PowerShield_Target


Trigger:
  • Power Shield DeActivate 2
    • Events
      • Time - PowerShield_Timer expires
    • Conditions
    • Actions
      • Unit - Remove Power Shield buff from PowerShield_Target
 
does a max of 1 unit at a time get this ability?
and np :)

Trigger:
  • Power Shield
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Power Shield
    • Actions
      • Set PowerShield_Caster = (Casting unit)
      • Set PowerShield_Target = (Target unit of ability being cast)
      • Unit - Create 1 Dummy for Player 1 (Red) at (Position of PowerShield_Target) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pit Lord - Howl Of Terror
      • Unit - Remove (Last created unit) from the game
      • Set PowerShield_ShieldLife = 100.00 + (100.0 x Real(Level of ability cast for triggering unit)
      • Countdown Timer - Start PowerShield_Timer as a One-shot timer that will expire in (10.0 + (5.0 x Real(Level of ability cast for triggering unit) seconds


Trigger:
  • Add Damage Event
    • Events
      • A unit learns an ability
    • Conditions
      • Ability learned is equal to (your ability)
    • Actions
      • Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)


thats how i would do it, MUCH smaller and it only adds the event once no matter what
(for first trigger that is)
 
Are you telling me that those two triggers are the same that all mine? I can't find the "A unit learns an ability" event.
 
its under hero or something like that, and those 2 should be a replacement for the large first trigger
instead of doing 5x for level 4, 4x for level 3 and all that, it just adds the level of the ability x something to each
for the Real(level of ability) stuff, thats an integer to real conversion
 
you would need a unit index, basically a system that assigns an unused integer to every unit that enters the map, so that it can be referenced in variable indexes using that integer, basically doing Variable[Unit], or assigning IDs to every unit, that way you can use that to check if that unit has it added already, but mine would do it i think, if you have the unit learns an ability event, because they should only learn it once, right?
 
This seems like a targeted ability, I believe.

There's a crude workaround though. Using Berserk.

Code:
    Power Shield
        Events
            [B]Unit - A unit Starts the effect of an ability[/B]
        Conditions
            (Ability being cast) Equal to Power Shield
        Actions
            Set PowerShield_Caster = [B](Triggering unit)[/B]
            Set PowerShield_Target = (Target unit of ability being cast)
            Unit - Add Berserk to PowerShield_Target
            Unit - Set level of Berserk PowerShield_Target to level of Berserk of PowerShield_Caster
            Unit - Order PowerShield_Target to cast Berserk
            Unit - Remove Berserk from PowerShield_Target

You will need to set the 'Damage taken' field in Berserk to a negative value to allow the damage to be absorbed.
One flaw is that this will stop the targeted unit's current order.

As for your problem for event stacking, store the units into unit groups to prevent multiple stacking.
For example,
Code:
Condition
 YourUnit is in SomeUnitGroup Equal to False <-- [I]A boolean[/I]
Then - actions
 Unit group - Add YourUnit to SomeUnitGroup
 Trigger - Add to Power Shield Activate <gen> the event (Unit - PowerShield_Target Takes damage)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top