• 🏆 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!

[Solved] Crystal Wall Ability Help

Status
Not open for further replies.
Level 5
Joined
Aug 7, 2016
Messages
55
Well, I've been searching tutorials in the internet on how to create walls on a horizontal line, but none of what I found helped me. Anyway here is my trigger.


  • Crystal Wall Spell
    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
      • (Ability being cast) equal to Crystal Wall
    • Actions
      • Set Caster = (Triggering unit)
      • Set PointLoc[1] = (Position of Caster)
      • Set PointLoc[2] = (Target point of ability being cast)
      • For each (Integer A) from 1 to 2, do Actions
        • Loop - Actions
          • Set Offset[1] = (PointLoc[2] offset by 70 towards ((Angle from PointLoc[1] to PointLoc[2]) + ((Real(Integer A)) x 129.50)) degrees)
          • Unit - Create 1 Crystal Wall dummy for (Owner of Caster) at Offset[1] facing Default building facing degrees
          • Unit - Add Crystal Wall Slow to (Last created unit)
          • Unit - Set level of Crystal Wall Slow for (Last created unit) to (Level of Crystal Wall for Caster)
          • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_Offset[1]
      • For each (Integer B) from 1 to 2, do Actions
        • Loop - Actions
          • Set Offset[2] = (PointLoc[2] offset by 170 towards ((Angle from PointLoc[1] to PointLoc[2]) + ((Real(Integer B)) x 129.50)) degrees)
          • Unit - Create 1 Crystal Wall dummy for (Owner of Caster) at Offset[2] facing Default building facing degrees
          • Unit - Add Crystal Wall Slow to (Last created unit)
          • Unit - Set level of Crystal Wall Slow for (Last created unit) to (Level of Crystal Wall for Caster)
          • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_Offset[2]
      • Custom script: call RemoveLocation(udg_PointLoc[1])
      • Custom script: call RemoveLocation(udg_PointLoc[2])
The wall bends a little, it almost shapes like a crescent moon.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Okay you need a 3rd initial point.

It needs to be PointLoc[3] = PointLoc[2] offset by 70 Toward Angle from PointLoc[1] to PointLoc[2] (Not sure you need the 70 though, that will just make it so that it is 70 units forward from where the unit cast it, but no big deal.)

Offset[1] then needs to be PointLoc[3] offset by X (how far the wall pieces should be apart) toward 180 degrees/0 degrees (left and right).


This is what I used to double check, but yeah I think I got the desired effect.

Also in case you do not want only horizontal , but vertical too all you would need to do is check what the angle between the points is and readjust from 0/180 to 90/270 if the angle is between some range you deem as facing n/s or e/w.

  • Untitled Trigger 005
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempPoint = (Position of TempUnit)
      • Set TempPoint2 = (Target point of ability being cast)
      • Set TempPoint3 = (TempPoint2 offset by 250.00 towards (Angle from TempPoint to TempPoint2) degrees)
      • For each (Integer TempInteger) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set TempPoint4 = (TempPoint3 offset by (100.00 x (Real(TempInteger))) towards 0.00 degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at TempPoint4 facing (Facing of TempUnit) degrees
          • Custom script: call RemoveLocation(udg_TempPoint4)
      • For each (Integer TempInteger) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set TempPoint4 = (TempPoint3 offset by (100.00 x (Real(TempInteger))) towards 180.00 degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at TempPoint4 facing (Facing of TempUnit) degrees
          • Custom script: call RemoveLocation(udg_TempPoint4)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint3)
 
Last edited:
Level 5
Joined
Aug 7, 2016
Messages
55
p0ke said:
It needs to be PointLoc[3] = PointLoc[2] offset by 70 Toward Angle from PointLoc[1] to PointLoc[2] (Not sure you need the 70 though, that will just make it so that it is 70 units forward from where the unit cast it, but no big deal.)

"offset by 70" is the distance from one wall to the other.

Offset[1] then needs to be PointLoc[3] offset by X (how far the wall pieces should be apart) toward 180 degrees/0 degrees (left and right).
PointLoc 3? Should I create one? If so, where should I put it?

Also in case you do not want only horizontal , but vertical too all you would need to do is check what the angle between the points is and readjust from 0/180 to 90/270 if the angle is between some range you deem as facing n/s or e/w.
Actually what I mean about horizontal wall is that the wall is in horizontal angle facing the caster. So basically, the wall can appear diagonally if the caster is facing diagonally. Most tutorials I've read is just making a wall in a line from the caster to the designated location away from the caster, much like in DOTA2's Fissure ability of Earthshaker.


I just got a little bit of problem. It makes the wall look like a crescent moon. In short, it looks like a curved wall.
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Oh, okay I was mistaken about how you wanted the wall. It ought to be quite a simple trigger then.

  • Untitled Trigger 005
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempPoint = (Position of TempUnit)
      • Set TempPoint2 = (Target point of ability being cast)
      • Set TempReal = (Angle from TempPoint to TempPoint2)
      • For each (Integer TempInteger) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set TempPoint3 = (TempPoint offset by (70. x (Real(TempInteger))) towards TempReal degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at TempPoint3 facing TempReal degrees
          • // Add expiration
          • Custom script: call RemoveLocation(udg_TempPoint3)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
 
Level 5
Joined
Aug 7, 2016
Messages
55
Yes, I somehow made it in a line-ish, until that Integer B. It is the reason why it curves. Is there some way you can provide an easier method in making horizontal wall lines?
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
You really just need to copy my updated trigger exactly.

You don't need 2 loops, 1 will work.
The problem with yours is that you are changing the angle rather than the offset.
Compare mine to yours:
I set my Offset (TempPoint3) = Position of the Caster + (70 * TempInt (length of the wall)) towards the Angle from Position of the Caster to Target Point of Cast.
You instead set your offset = Target Point of Cast + 70 (but you don't change it so it's always 70) towards Angle from Position of the Caster to the Target Point of Cast + (129.5 degrees * IntegerA (length of the wall)

Basically the reason yours may look like its "working" is because the units are being created on top of each other because the offset is not changing. The units are bumping into each other and creating a line-ish thing.

For further clarity: Mine it creates a wall at 70 away, 140, 210, etc distance on the same angle. In Integer A loop you are creating them all 70 away and changing the angle. You simply are mixing up the number that needs to change.
 
Level 5
Joined
Aug 7, 2016
Messages
55
Woah, that's it? Well, I'm super bad at calculating distances and offset, etc. Basically the math stuff.



Thanks for the help. Now I can finally perfect the wall for my hero.



Edit: I tested what you got in game and it creates a wall in a straight line. Well it helped me but I want the wall to be horizontal adjacent to the facing of caster.
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Yikes. Perhaps I'm confused, I saw fissure and assumed you just wanted a straight line after you didn't like what I initially posted which was basically similar to a Dark Seer Wall of Repilica

Could you draw me picture of what you are trying to accomplish? (Paint/or with symbols lol)


______________________ Caster
_______________________ |
_______________________ V

____________________Target Point

_____________WWWWWW AAAAAA LLLLLLL LLLLLLLLL ?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
  • Untitled Trigger 005
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempPoint = (Position of TempUnit)
      • Set TempPoint2 = (Target point of ability being cast)
      • Set TempPoint3 = (TempPoint2 offset by 250.00 towards (Angle from TempPoint to TempPoint2) degrees) // This offset probably should be 0 if you want the wall created on the point you cast it on.
      • For each (Integer TempInteger) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set TempPoint4 = (TempPoint3 offset by (100.00 x (Real(TempInteger))) towards 0.00 degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at TempPoint4 facing (Facing of TempUnit) degrees
          • Custom script: call RemoveLocation(udg_TempPoint4)
      • For each (Integer TempInteger) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set TempPoint4 = (TempPoint3 offset by (100.00 x (Real(TempInteger))) towards 180.00 degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at TempPoint4 facing (Facing of TempUnit) degrees
          • Custom script: call RemoveLocation(udg_TempPoint4)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint3)

Take a look at what I made earlier then, because Wall is nearly exactly that, except it is only oriented horizontal never vertical.
 
Level 5
Joined
Aug 7, 2016
Messages
55
Lemme test that, btw this is what I wanted to happen

Edt: I tested your trigger and it didn't work. When I cast it on the E/W of my character, it is oriented vertically towards the facing of caster. Simply put that it is oriented like Earthshaker's fissure when casting it towards the E/W direction, but is oriented like Dark Seer's Wall of Replica when casting it towards N/S direction.

The facing of the wall is fixed to the default facing degrees of units/buildings(facing to south)

full
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Can't see the pic, but I think after all this confusion I finally got it lol.

  • Untitled Trigger 005
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempPoint = (Position of TempUnit)
      • Set TempPoint2 = (Target point of ability being cast)
      • Set TempReal = (Angle from TempPoint to TempPoint2)
      • For each (Integer TempInteger) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set TempPoint3 = (TempPoint2 offset by (70.00 x (Real(TempInteger))) towards ((Facing of TempUnit) + 90.00) degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at TempPoint3 facing (Facing of TempUnit) degrees
          • Custom script: call RemoveLocation(udg_TempPoint3)
      • For each (Integer TempInteger) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set TempPoint3 = (TempPoint2 offset by (70.00 x (Real(TempInteger))) towards ((Facing of TempUnit) - 90.00) degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at TempPoint3 facing (Facing of TempUnit) degrees
          • Custom script: call RemoveLocation(udg_TempPoint3)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
 
Status
Not open for further replies.
Top