Targetted abilities.

The_Reaping

Member
Reaction score
2
Edit:

Okay, my skill theme has changed. What it needs to do is for every 6/5/4/3 spells cast within a certain range, only from enemies, the explodes dealing damage. I can do the explosion bit, no problem. I just can't can't do the first bit..
 
Trigger:
  • Events
    • Unit - A unit starts the effect of an ability
    • Conditions
      • (target unit of ability being cast) equal to [your unit]
    • Actions
      • do actions
 
Trigger:
  • Events
    • Unit - A unit starts the effect of an ability
    • Conditions
      • (target unit of ability being cast) equal to [your unit]
    • Actions
      • do actions

Hmm.. [your unit] would be under what.. Because you can only have "triggering unit" and target unit of ability being cast only refers to the Event - A Unit Begins Casting An Ability. Also, my skill idea has changed.
 
Use an integer variable to track the number of spells cast. and do actions accordingly.
 
Trigger:
  • Combust Counter
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Set TempGroup = (Units of type Rage Demon)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is an enemy of (Owner of (Picked unit))) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between (Position of (Picked unit)) and (Position of (Triggering unit))) Less than or equal to 400.00
                • Then - Actions
                  • Set CombustCounter = (CombustCounter + 1)
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Combust for (Picked unit)) Equal to 1
              • CombustCounter Equal to 6
            • Then - Actions
              • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
              • Unit - Add Combust (Damage and Stun) to (Last created unit)
              • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to 1
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Unit - Remove (Last created unit) from the game
              • Set CombustCounter = 0
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Combust for (Picked unit)) Equal to 2
                  • CombustCounter Equal to 5
                • Then - Actions
                  • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
                  • Unit - Add Combust (Damage and Stun) to (Last created unit)
                  • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to 2
                  • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                  • Unit - Remove (Last created unit) from the game
                  • Set CombustCounter = 0
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Combust for (Picked unit)) Equal to 3
                      • CombustCounter Equal to 4
                    • Then - Actions
                      • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
                      • Unit - Add Combust (Damage and Stun) to (Last created unit)
                      • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to 3
                      • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                      • Unit - Remove (Last created unit) from the game
                      • Set CombustCounter = 0
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Combust for (Picked unit)) Equal to 4
                          • CombustCounter Equal to 3
                        • Then - Actions
                          • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
                          • Unit - Add Combust (Damage and Stun) to (Last created unit)
                          • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to 4
                          • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                          • Unit - Remove (Last created unit) from the game
                          • Set CombustCounter = 0
                        • Else - Actions


Will this work? :/ I don't think it will tbh.
 
You can combine all of those If/Then/Else into one, and set the level of "Combust (Damage and Stun)" to the same level as the Combust ability, like this:

Trigger:
  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
    • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
    • Unit - Add Combust (Damage and Stun) to (Last created unit)
    • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to (Level of Combust for (Picked unit))
    • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
    • Unit - Remove (Last created unit) from the game
    • Set CombustCounter = 0


and then use another If/Then/Else for tracking the CombustCounter.

Also, you do not pick any players in this trigger, so (picked player) will not work.
 
Eh, I can't figure it out.. It's just confusing me. :/ Could you post the entire code? if it's not too much to ask :p I'll learn better from that.
 
I don't have time to look at it right at the moment, but I will later today. As soon as I can, I'll take a look at let you know.
 
Okay sorry, I've been really busy today. I was planning on looking at it today, but real life came calling. I'll get to it tomorrow.

EDIT:

Okay I'm looking at the map right now. Just to clarify, do you want it to be MUI or does it matter?
 
(sorry for double post, forgot to mention I would just edit my last post)

Okay, it was hard to test the spell in your map because the enemies would rarely cast spells. But I changed the code a bit, it should be working correctly. I also added a debug line to track when the trigger runs, and how many the Combust Counts is at. You can easily remove that.

Trigger:
  • Combust Learned
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Combust
    • Actions
      • Unit - Add Combust (Visuals) to (Triggering unit)
      • Unit - Set level of Combust (Visuals) for (Triggering unit) to (Level of Combust for (Triggering unit))
      • Set Combust_MaxCount = (7 - (Level of Combust for (Triggering unit)))
      • Trigger - Turn on Combust Counter <gen>


Trigger:
  • Combust Counter
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempGroup = (Units of type Rage Demon)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is an enemy of (Owner of (Picked unit))) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between (Position of (Picked unit)) and (Position of (Triggering unit))) Less than or equal to 400.00
                • Then - Actions
                  • Set Combust_Counter = (Combust_Counter + 1)
                  • Game - Display to (All players) the text: Enemy spell is cast
                  • Game - Display to (All players) the text: (Combust Counter is + (String(Combust_Counter)))
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Combust_Counter Greater than or equal to Combust_MaxCount
            • Then - Actions
              • Set Combust_Point = (Position of (Picked unit))
              • Unit - Create 1 Spell Dummy for (Owner of (Picked unit)) at Combust_Point facing Default building facing degrees
              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
              • Unit - Add Combust (Damage and Stun) to (Last created unit)
              • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to (Level of Combust for (Picked unit))
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Set Combust_Counter = 0
              • Custom script: call RemoveLocation(udg_Combust_Point)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)


Here is the test map:
 

Attachments

  • Rage_Demon_Test_Map.w3x
    59 KB · Views: 147
(sorry for double post, forgot to mention I would just edit my last post)

Okay, it was hard to test the spell in your map because the enemies would rarely cast spells. But I changed the code a bit, it should be working correctly. I also added a debug line to track when the trigger runs, and how many the Combust Counts is at. You can easily remove that.

Trigger:
  • Combust Learned
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Combust
    • Actions
      • Unit - Add Combust (Visuals) to (Triggering unit)
      • Unit - Set level of Combust (Visuals) for (Triggering unit) to (Level of Combust for (Triggering unit))
      • Set Combust_MaxCount = (7 - (Level of Combust for (Triggering unit)))
      • Trigger - Turn on Combust Counter <gen>


Trigger:
  • Combust Counter
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempGroup = (Units of type Rage Demon)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is an enemy of (Owner of (Picked unit))) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between (Position of (Picked unit)) and (Position of (Triggering unit))) Less than or equal to 400.00
                • Then - Actions
                  • Set Combust_Counter = (Combust_Counter + 1)
                  • Game - Display to (All players) the text: Enemy spell is cast
                  • Game - Display to (All players) the text: (Combust Counter is + (String(Combust_Counter)))
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Combust_Counter Greater than or equal to Combust_MaxCount
            • Then - Actions
              • Set Combust_Point = (Position of (Picked unit))
              • Unit - Create 1 Spell Dummy for (Owner of (Picked unit)) at Combust_Point facing Default building facing degrees
              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
              • Unit - Add Combust (Damage and Stun) to (Last created unit)
              • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to (Level of Combust for (Picked unit))
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Set Combust_Counter = 0
              • Custom script: call RemoveLocation(udg_Combust_Point)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)


Here is the test map:

I tested it.. But whenever the counter gets to the required amount.. it crashes :/ I made triggers to check when one of the heroes is attack and make him cast a spell.
 
It's because you are creating an infinite loop. [DEL]You forgot to add a condition to check if it is your ability being cast.[/DEL]

I mean you forgot to add a condition to check that it is NOT Warstomp.

Trigger:
  • Combust Counter
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Not equal to Combust (Damage and Stun)
    • Actions
 
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

      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