• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to set specific/random areas around targetted point of a spell?

Status
Not open for further replies.
Level 8
Joined
Jan 17, 2019
Messages
163
I'm interested in learning how to make my spells cooler. Let's take Flame Strike for example, how would one go about making it so there is additional explosions to the left or right of that initial target? Or what if I wanted two more strikes placed randomly around the target?
 
Level 13
Joined
Feb 5, 2018
Messages
567
  • Flame Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flame Strike
    • Actions
      • -------- Original location --------
      • Set VariableSet FlameStrike_Loc[1] = (Target point of ability being cast)
      • -------- Extra locations --------
      • Set VariableSet FlameStrike_Loc[2] = (FlameStrike_Loc[1] offset by 256.00 towards 90.00 degrees.)
      • Set VariableSet FlameStrike_Loc[3] = (FlameStrike_Loc[1] offset by 256.00 towards 180.00 degrees.)
      • -------- Actions here --------
      • Unit - Create 1 Peasant for (Owner of (Triggering unit)) at FlameStrike_Loc[1] facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Flame Strike (Neutral Hostile 2) to (Last created unit)
      • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike FlameStrike_Loc[2]
      • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike FlameStrike_Loc[3]
      • -------- clean up --------
      • Custom script: call RemoveLocation (udg_FlameStrike_Loc[1])
      • Custom script: call RemoveLocation (udg_FlameStrike_Loc[2])
      • Custom script: call RemoveLocation (udg_FlameStrike_Loc[3])
      • -------- --------
      • -------- We could also loop the locations and add degree to make it go all directions --------
      • For each (Integer FlameStrikeLoop) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set VariableSet FlameStrike_Loc[FlameStrikeLoop] = (FlameStrike_Loc[1] offset by 256.00 towards (0.00 + 90.00) degrees.)
          • -------- actions here --------
          • -------- clean up --------
          • Custom script: call RemoveLocation (udg_FlameStrike_Loc[udg_FlameStrikeLoop])
      • -------- So we can either make the locations one by one or loop the locations --------
      • -------- and then do whatever we want :) --------
Here I made an example for you, either of these methods can be used.

FlameStrike_Loc is a variable with array.
FlameStrike_Loop is an integer variable used for the loop.

This is a quick draft just to show how to store locations, you probably want to get the triggering unit and owning player with variables as well.

Hope this helps you to get started.

If you don't know how to make dummy units there is posts made by Uncle here that will explain that.

Note that every time you create a new location it must be removed with custom script, since warcraft 3 does not clean them up.
 
Level 8
Joined
Jan 17, 2019
Messages
163
Can you tell what I'm doing wrong here? I feel like I was pretty close to what you put up but the additional flamestrikes are clumped to the right (and sometimes they don't go off at all).

  • Door To Hell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Door to Hell Level 1
        • Then - Actions
          • Set VariableSet DoorToHellLoc[1] = (Target point of ability being cast)
          • Set VariableSet DoorToHellLoc[2] = (DoorToHellLoc[1] offset by (256.00, 90.00))
          • Set VariableSet DoorToHellLoc[3] = (DoorToHellLoc[1] offset by (256.00, 180.00))
          • Unit - Create 1 Dummy Base for (Owner of (Triggering unit)) at DoorToHellLoc[1] facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Door to Hell Level 1 (Dummy) to (Last created unit)
          • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike DoorToHellLoc[2]
          • Unit - Create 1 Dummy Base for (Owner of (Triggering unit)) at DoorToHellLoc[1] facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Door to Hell Level 1 (Dummy) to (Last created unit)
          • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike DoorToHellLoc[3]
          • Custom script: call RemoveLocation (udg_DoorToHellLoc[1])
          • Custom script: call RemoveLocation (udg_DoorToHellLoc[2])
          • Custom script: call RemoveLocation (udg_DoorToHellLoc[3])
        • Else - Actions
 

Attachments

  • DoortoHellBroken.png
    DoortoHellBroken.png
    888.9 KB · Views: 19
Level 13
Joined
Feb 5, 2018
Messages
567
Well the offset is the range how far it is from the original point and the degrees are the angle where you want it to go.

So it is basically just mathematic, if you want it to be close to the original location, lower the offset. Also you can try different angles or even save the angle from the location to location 2.

Also the dummy might need to live longer to be able to finish the cast time of flame strike.

EDIT: Make sure to use point with polar offset when setting the extra locations.
 
Last edited:
Level 13
Joined
Feb 5, 2018
Messages
567
I made a testmap for you so you can see how the angles work and check how I made the dummy ability. :)
 

Attachments

  • WC3ScrnShot_050421_184151_001.png
    WC3ScrnShot_050421_184151_001.png
    3.5 MB · Views: 17
  • DoorToHellExample.w3m
    18.5 KB · Views: 8
Level 8
Joined
Jan 17, 2019
Messages
163
So it was def the polar offset thing that was messing me up but I'm still getting casts where the dummies don't do anything? This spell is meant to be an ultimate that is used only once per round so if it did only 1/3 of the effect that would annoy people for sure :\

This was pic was from a direct copy/paste of your trigger
 

Attachments

  • door2hellrandom.png
    door2hellrandom.png
    1.1 MB · Views: 20
Level 13
Joined
Feb 5, 2018
Messages
567
:( Well I don't know, I just casted it 25 times in a row with lower cd than cast time and didn't bug out. Did you have "automatically create unknown variables" ticked when you copied the trigger.

Also try not to have dummy unit with cast animation set to 0.000
 
Level 8
Joined
Jan 17, 2019
Messages
163
I even copied your dummy and original spell! Works fine on your map but not mine? The spell fails roughly 1 in 3 times for me. Maybe you can take a look in my map for me and see if you can find the problem? I even tried a small wait between the cast of the dummies to no avail. The trigger is the first thing under Spell Triggers and there are red illidan demons that cast each it on the map. Really dampening my morale I can't get such a simple spell to function correctly.
 

Attachments

  • DoorStillrandom.png
    DoorStillrandom.png
    1.5 MB · Views: 12
  • LAIR LORDS 0.14.w3x
    27 MB · Views: 10

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,010
Edit: I downloaded a dummy from one of Devalut's spells and now it's magically working. Guess I'll be using this dummy for everything from now on!
It's not magic, you need to know what are the changed fields necessary for it to work.
Abilities - Normal: Locust (Veroxian uses Ghost (visible) by default, but I'd highly recommend Locust, so the unit doesn't die from anything)
Art - Animation - Blend Time: 0.000
Art - Animation - Cast Backswing: 0.000
Art - Icon - Game Interface: (an icon easy for you to identify the dummy, obvious)
Art - Model File: .mdl (use the Veroxian model if you can)
Movement - Speed Base: 0
Movement - Turn Rate: 0
Movement - Movemente Type: None
Pathing - Collision Size: 0.000
Stats - Food Cost - 0
Stats - Hide Minimap Display: True (If you have locust then this is unncessary)
Stats - Sight Radius (Day): 0
Stats - Sight Radius (Night): 0
Stats - Unit Classification: None
Techtree - Structures Built: None
Techtree - Upgrades Used: None
Text - Name: (not even going to say anything here)
 
Status
Not open for further replies.
Top