• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Need help with a custom ability!

Status
Not open for further replies.

VAC

VAC

Level 3
Joined
Feb 18, 2017
Messages
34
Hi guys this is my first post. I'm super new at World Editor, so I'm just trying to do basic stuff, like creating custom heroes and skills. I am trying to create a stomp skill that can damage both enemies and friendly units nearby, except for the caster. I imitated Flame Strike because it can damage allies (checked all the boxes in target allowed that Flame Strike has) and it is still not working. Could someone please help me with this?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Warstomp and Thunderclap cannot target allies. This is hardcoded. You need the stun/damage from a different spell. You would need triggers for that.
 

VAC

VAC

Level 3
Joined
Feb 18, 2017
Messages
34
So I suppose dummy unit is the way to go? That's probably too much for me right now. Thanks for the reply.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Yes either you use a dummy unit that is enemy to all players casting warstomp (you would need a unused player that is hostile to everyone else) or you use a modified storm bolt and cast it on every nearby unit.
 

VAC

VAC

Level 3
Joined
Feb 18, 2017
Messages
34
The first solution probably won't do, since the caster would also take damage. If I use the latter, would I need a dummy unit?
 

VAC

VAC

Level 3
Joined
Feb 18, 2017
Messages
34
Can you show me an unprotected map with a dummy unit hostile to everything nearby the caster, except for the caster? I know triggers are tricky for me atm, but I'm getting a bit too hyped.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
I used warstomp as a base ability, but with no effect (targets are set to none).
When the ability is cast a trigger will be triggered.

The map comes with three versions of the trigger.
Stomp Easy:
Try to understand how this trigger works. It creates a dummy unit for every target that is supposed to be stunned.
Stomp Normal:
Same as Stomp Easy, but without Leaks (Things That Leak).
Also used variables to reduce the amount of function calls.
Stomp Advanced:
This trigger only creates one dummy per cast. It is therefore more efficient, but also more complex.
 

Attachments

  • DummyStomp.w3x
    20.2 KB · Views: 24

VAC

VAC

Level 3
Joined
Feb 18, 2017
Messages
34
I will play around with this and see what I can understand. Thanks for the help.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Well instead of dummy you can make the caster damage with triggers. In Actions there is Damage Area, you can use that with a special effect on the unit and it seems like a stomp.
Damage Area is a generally bad function, because you cannot specify which units are damaged. In this case also the caster itself and buildings/air units would be damaged.

You still need a stun for stomp. For this you need a dummy.
In the map the damage dealt comes from the caster not from the dummy spell, so when the spell kills a target the right player gets credit for the kill.
The dummy unit is owned by neutral passive, so it will not interfere with the score screen.
 

VAC

VAC

Level 3
Joined
Feb 18, 2017
Messages
34
Sorry for this question is out of topic, but how do you quote other people?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
JASS:
[QUOTE]yourquote[/QUOTE]

You can select text and there should be a grey box where you can select quote.
This saves this quote and you can insert it later.
 

VAC

VAC

Level 3
Joined
Feb 18, 2017
Messages
34
Would that include the name of the quoted person? Like "X said blah blah"?
 
Level 9
Joined
Sep 20, 2015
Messages
385
In the map the damage dealt comes from the caster not from the dummy spell, so when the spell kills a target the right player gets credit for the kill.
The dummy unit is owned by neutral passive, so it will not interfere with the score screen.

You are right i forgot about the stun, btw how did you gave credit to the caster owner if the dummy is neutral passive?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
You are right i forgot about the stun, btw how did you gave credit to the caster owner if the dummy is neutral passive?
I create a dummy unit that casts stormbolt on every unit in within range and use the damage target function to make the caster deal damage the units. The stormbolt spell deals no damage and is only used for the stun.
If you would make the dummy owned by the casting player you would increase the units produced in the scorescreen, so you should choose a player that is not displayed in the scorescreen for your dummy unit.

  • Stomp Advanced
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to War Stomp (allies)
    • Actions
      • Set TempUnit[0] = (Triggering unit)
      • Set TempInteger[0] = (Level of War Stomp (allies) for TempUnit[0])
      • Set TempPoint[0] = (Position of TempUnit[0])
      • Unit - Create 1 Dummy for Neutral Passive at TempPoint[0] facing Default building facing degrees
      • Set TempUnit[1] = (Last created unit)
      • Unit - Add Stun to TempUnit[1]
      • Unit - Set level of Stun for TempUnit[1] to TempInteger[0]
      • Unit - Add a 1.00 second Generic expiration timer to TempUnit[1]
      • Set TempUnitGroup[0] = (Units within 400.00 of TempPoint[0])
      • Unit Group - Pick every unit in TempUnitGroup[0] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempUnit[0] Not equal to (Picked unit)
              • ((Picked unit) is A flying unit) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
              • ((Picked unit) is Magic Immune) Equal to False
              • ((Picked unit) is A structure) Equal to False
              • ((Triggering unit) is alive) Equal to True
            • Then - Actions
              • Custom script: call SetUnitX(udg_TempUnit[1], GetUnitX(GetEnumUnit()))
              • Custom script: call SetUnitY(udg_TempUnit[1], GetUnitY(GetEnumUnit()))
              • Unit - Order TempUnit[1] to Neutral - Hurl Boulder (Picked unit)
              • -------- damage must be triggered, because the damage should come from the caster not the dummy --------
              • Unit - Cause TempUnit[0] to damage (Picked unit), dealing (25.00 x (Real(TempInteger[0]))) damage of attack type Spells and damage type Magic
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempUnitGroup[0])
      • Custom script: call RemoveLocation(udg_TempPoint[0])
 

VAC

VAC

Level 3
Joined
Feb 18, 2017
Messages
34
Okay, I think I understand the Easy and Normal ones, but the Advanced will probably take a while. The triggers work great, thank you very much guys. I have more questions, but about different topics so I will post them in a new thread.
 
Status
Not open for further replies.
Top