Spell Warp Field

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
Warp Field
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Warps space time arround the caster, creating a barrier through which enemies cannot pass, but friendly units can.
All enemy units within the barrier when this spell is cast are forced out. While the Warp Field is active you have vision of it.
Also damage enemies.​

  • MUI: Yes
  • GUI/JASS: GUI
  • Leakless: Yes (I think)
  • Lagless: I think it has lags but not too much

A spell I saw at theHive (Warp Field by Cromatycha) but Cromatycha's triggering is not good, and the effect is rather fun and cool, so I decide to remake it and also, someone request me to do it :)

  • Screenshot:
    attachment.php
  • Code
    Trigger:
    • WarpField Init
      • Events
        • Map initialization
      • Conditions
      • Actions
        • -------- set the number of dummies --------
        • -------- recommended 18 --------
        • Set WarpField_NumberDummies = 18
        • -------- push speed, because we use 0.025s timer, the PushSpeed must be only equal to 0.025 x of actual speed --------
        • Set WarpField_PushSpeed = 15.00


    Trigger:
    • WarpField Cast
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Warp Field
      • Actions
        • Set TempUnit = (Triggering unit)
        • Set WarpField_InsCount = (WarpField_InsCount + 1)
        • Set WarpField_Caster[WarpField_InsCount] = TempUnit
        • Set WarpField_Pos[WarpField_InsCount] = (Position of TempUnit)
        • -------- 10 seconds duration + 1 duration of fade in/out => 11 seconds total --------
        • -------- 11 seconds / 0.025s timer = 440 ticks --------
        • Set WarpField_Tick[WarpField_InsCount] = 440
        • Set WarpField_TotalTick[WarpField_InsCount] = 440
        • -------- damage per second --------
        • Set WarpField_Damage[WarpField_InsCount] = (50.00 + (50.00 x (Real((Level of Warp Field for TempUnit)))))
        • -------- set damage to zero to disable damaging --------
        • -------- damage per 0.025s --------
        • Set WarpField_Damage[WarpField_InsCount] = (WarpField_Damage[WarpField_InsCount] / 40.00)
        • Custom script: set udg_WarpField_Dummies[udg_WarpField_InsCount] = CreateGroup()
        • For each (Integer TempInt) from 1 to WarpField_NumberDummies, do (Actions)
          • Loop - Actions
            • Unit - Create 1 Dummy - Warp Field for (Owner of TempUnit) at WarpField_Pos[WarpField_InsCount] facing ((Real(TempInt)) x (360.00 / (Real(WarpField_NumberDummies)))) degrees
            • Set TempUnit2 = (Last created unit)
            • Unit Group - Add TempUnit2 to WarpField_Dummies[WarpField_InsCount]
            • Unit - Add Crow Form to TempUnit2
            • Unit - Remove Crow Form from TempUnit2
            • Animation - Change TempUnit2 flying height to 65.00 at 0.00
            • Animation - Play TempUnit2's Birth animation
            • Animation - Queue TempUnit2's Stand animation
            • Animation - Change TempUnit2's animation speed to 180.00% of its original speed
        • -------- we have to use Custom Script (JASS) for MUI sound --------
        • Custom script: set udg_WarpField_Sound[udg_WarpField_InsCount] = CreateSound( "Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFogLoop1.wav", true, true, false, 100, 100, "SpellsEAX" )
        • Sound - Play WarpField_Sound[WarpField_InsCount] at 100.00% volume, located at WarpField_Pos[WarpField_InsCount] with Z offset 0.00


    Trigger:
    • WarpField Act
      • Events
        • Time - Every (1.00 / 40.00) seconds of game time
      • Conditions
      • Actions
        • For each (Integer WarpField_Looper) from 1 to WarpField_InsCount, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • WarpField_Tick[WarpField_Looper] Greater than 0
              • Then - Actions
                • -------- animating --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • WarpField_Tick[WarpField_Looper] Equal to (WarpField_TotalTick[WarpField_Looper] - 20)
                  • Then - Actions
                    • Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
                      • Loop - Actions
                        • Set TempUnit = (Picked unit)
                        • Animation - Change TempUnit's animation speed to 100.00% of its original speed
                        • Animation - Play TempUnit's Stand animation
                    • Destructible - Pick every destructible within 500.00 of WarpField_Pos[WarpField_Looper] and do (Actions)
                      • Loop - Actions
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Max life of (Picked destructible)) Equal to 50.00
                          • Then - Actions
                            • Destructible - Kill (Picked destructible)
                          • Else - Actions
                  • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • WarpField_Tick[WarpField_Looper] Equal to 20
                  • Then - Actions
                    • Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
                      • Loop - Actions
                        • Set TempUnit = (Picked unit)
                        • Animation - Change TempUnit's animation speed to 350.00% of its original speed
                        • Animation - Play TempUnit's Death animation
                  • Else - Actions
                • -------- Fade In --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • WarpField_Tick[WarpField_Looper] Greater than or equal to (WarpField_TotalTick[WarpField_Looper] - 20)
                  • Then - Actions
                    • Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
                      • Loop - Actions
                        • Set TempUnit = (Picked unit)
                        • Animation - Change TempUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with (5.00 x (Real((20 - (WarpField_TotalTick[WarpField_Looper] - WarpField_Tick[WarpField_Looper])))))% transparency
                  • Else - Actions
                • -------- Warping --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • WarpField_Tick[WarpField_Looper] Less than (WarpField_TotalTick[WarpField_Looper] - 20)
                    • WarpField_Tick[WarpField_Looper] Greater than 20
                  • Then - Actions
                    • Set TempGroup = (Units within 435.00 of WarpField_Pos[WarpField_Looper] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of WarpField_Caster[WarpField_Looper])) Equ
                    • Unit Group - Pick every unit in TempGroup and do (Actions)
                      • Loop - Actions
                        • Set TempUnit = (Picked unit)
                        • Set TempLoc = (Position of TempUnit)
                        • Set TempLoc2 = (TempLoc offset by WarpField_PushSpeed towards (Angle from WarpField_Pos[WarpField_Looper] to TempLoc) degrees)
                        • -------- check pathing --------
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Terrain pathing at TempLoc2 of type Walkability is off) Equal to True
                          • Then - Actions
                            • -------- cannot move --------
                            • -------- this move unit action will interrupt unit's order --------
                            • Unit - Move TempUnit instantly to TempLoc2
                          • Else - Actions
                            • -------- can move --------
                            • -------- these two don't interrupt unit's order --------
                            • Custom script: call SetUnitX( udg_TempUnit, GetLocationX(udg_TempLoc2 ) )
                            • Custom script: call SetUnitY( udg_TempUnit, GetLocationY(udg_TempLoc2 ) )
                        • -------- --- --------
                        • Special Effect - Create a special effect at TempLoc2 using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
                        • Special Effect - Destroy (Last created special effect)
                        • Custom script: call RemoveLocation( udg_TempLoc )
                        • Custom script: call RemoveLocation( udg_TempLoc2 )
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • WarpField_Damage[WarpField_Looper] Greater than 0.00
                          • Then - Actions
                            • Unit - Cause WarpField_Caster[WarpField_Looper] to damage TempUnit, dealing WarpField_Damage[WarpField_Looper] damage of attack type Spells and damage type Magic
                          • Else - Actions
                    • Custom script: call DestroyGroup( udg_TempGroup )
                  • Else - Actions
                • -------- Fade Out --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • WarpField_Tick[WarpField_Looper] Less than or equal to 20
                  • Then - Actions
                    • Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
                      • Loop - Actions
                        • Set TempUnit = (Picked unit)
                        • Animation - Change TempUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with (5.00 x (Real(WarpField_Tick[WarpField_Looper])))% transparency
                  • Else - Actions
                • -------- --- --------
                • Set WarpField_Tick[WarpField_Looper] = (WarpField_Tick[WarpField_Looper] - 1)
              • Else - Actions
                • Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
                  • Loop - Actions
                    • Unit - Remove (Picked unit) from the game
                • Custom script: call RemoveLocation( udg_WarpField_Pos[udg_WarpField_Looper] )
                • Custom script: call DestroyGroup( udg_WarpField_Dummies[udg_WarpField_Looper] )
                • Sound - Stop WarpField_Sound[WarpField_Looper] After fading
                • Sound - Destroy WarpField_Sound[WarpField_Looper]
                • Set WarpField_Caster[WarpField_Looper] = WarpField_Caster[WarpField_InsCount]
                • Set WarpField_Dummies[WarpField_Looper] = WarpField_Dummies[WarpField_InsCount]
                • Set WarpField_Sound[WarpField_Looper] = WarpField_Sound[WarpField_InsCount]
                • Set WarpField_Pos[WarpField_Looper] = WarpField_Pos[WarpField_InsCount]
                • Set WarpField_Tick[WarpField_Looper] = WarpField_Tick[WarpField_InsCount]
                • Set WarpField_TotalTick[WarpField_Looper] = WarpField_TotalTick[WarpField_InsCount]
                • Set WarpField_InsCount = (WarpField_InsCount - 1)
                • -------- -- --------
                • Set WarpField_Looper = (WarpField_Looper - 1)
  • Readme
    How to import:
    - Copy ability: Warp Field (A000)
    - Copy triggers: WarpField Init, WarpField Cast, WarpField Act.
    Remember to check: File \ Preferences \ General \ Automatically create unknown variables while pasting trigger data

    Modification:
    - Change WarpField_Tick for the duration of the spell
    - Change WarpField_Damage for the damage of the spell
    - Change WarpField_PushSpeed for the pushing speed of the spell
    - Change WarpField_NumberDummies for the number of dummy units

    Note:
    - You can set 'Initial Value' for "WarpField_NumberDummies" and "WarpField_PushSpeed" so you wont need trigger WarpField Init

    Credit:
    - Thank Cromatycha for the idea.
Please comment :)

EDIT: first update: fix a leak and timer duration
 

Attachments

  • warp field.jpg
    warp field.jpg
    337.7 KB · Views: 1,958
  • [Spell] Warp Field.w3x
    51 KB · Views: 587

Nexor

...
Reaction score
74
- I said I use 0.025s timer while WarpField Act trigger use 0.03s timer, well, it's because of the "round up" in GUI, I don't know how to explain clearly, sorry

I don't understand this "round-up" thing.
You can use the arithmical function in GUI to create real values between 0.02 and 0.03.
To make a 0.025 value just use this: Real(1/40)
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
yeah, I don't know how to explain this, but:
Code:
Time - Every [B][COLOR="Red"]0.03[/COLOR][/B] seconds of game time
I typed in 0.025 but it still appears 0.03 :(
---
anyways, how is the spell ? is it fun ? :D
attack some melee creep, cast this spell and you will see :D
 

Crusher

You can change this now in User CP.
Reaction score
121
Nifty spell you re-created there Tom. It's awesome.

+rep.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Haven't tried the spell out, but the code looks nice (With one exception :p)

Found a leak, though...

Trigger:
  • Set TempGroup = (Units within 435.00 of WarpField_Pos[WarpField_Looper] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of WarpField_Caster[WarpField_Looper])) Equ


That's never destroyed...
 

Psiblade94122

In need of sleep
Reaction score
138
for the speed, to keep things simple you can do this

Timer .04 (.04 flat) this makes the trigger run 25 times per second, makes the math simple (as opposed to .03 which will run 33 times a second 34 for 1.2)

You can make the move speed based on normal wc3 speed instead of having to do the counculations first, when you actually use that speed however you have to divide it by 25 (if your using .04), because this runs a flat 25 times a second, the distance moved per second is accurate to the value you put in

The .03 your getting is because wc3 uses to the nearest hundreths for timers, so .025 will round up to .03. It is running every .03 seconds, not .025 seconds, which might make your spell slower then it really is

aside from that suggestion, cool spell +rep
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
Update !
----
@Komaqtion, I totally forgot about that, thanks :p

@Psiblade94122, I still want to use 0.025 and 1 / 40 works :D
 

Joker(Div)

Always Here..
Reaction score
86
for the speed, to keep things simple you can do this

Timer .04 (.04 flat) this makes the trigger run 25 times per second, makes the math simple (as opposed to .03 which will run 33 times a second 34 for 1.2)

You can make the move speed based on normal wc3 speed instead of having to do the counculations first, when you actually use that speed however you have to divide it by 25 (if your using .04), because this runs a flat 25 times a second, the distance moved per second is accurate to the value you put in

The .03 your getting is because wc3 uses to the nearest hundreths for timers, so .025 will round up to .03. It is running every .03 seconds, not .025 seconds, which might make your spell slower then it really is

aside from that suggestion, cool spell +rep
I believe you are wrong. GUI shows the rounded up numbers because of limited space, the the number itself doesn't change.

Btw, how did you turn the teleport model sideways?
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
>Btw, how did you turn the teleport model sideways?

a dummy with model Teleport and Art - Maximum Pitch Angle (degree): -90, use Shift + Enter (or Double Click) to enter negative values :)
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
yeah, I don't know how to explain this, but:
Code:
Time - Every [B][COLOR="Red"]0.03[/COLOR][/B] seconds of game time
I typed in 0.025 but it still appears 0.03 :(

Thats a GUI bug.

Reals in GUI can only appear with 2 decimals 1.55 when in Jass it can be 3 decimals 1.555.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Found a leak, though...

Trigger:
  • Set TempGroup = (Units within 435.00 of WarpField_Pos[WarpField_Looper] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of WarpField_Caster[WarpField_Looper])) Equ


That's never destroyed...

Update !
----
@Komaqtion, I totally forgot about that, thanks :p

Unless the code in the map is different from the posted code, the leak isn't yet fixed. I'm going to graveyard this until it is. Other than that, the spell looks great and is ready for approval. :)
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
I have confirmed this, the code in map and the posted code are the same :) the leak is fixed!

your post made me thought that I didn't edit the posted code :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top