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

Ability/GUI Trouble

Status
Not open for further replies.
Level 4
Joined
Jun 5, 2007
Messages
65
I'm having a bit of a problem with an ability I'm trying to make. It's called Blade Shield and what I want it to do is when used, create 3 blades (model: huntress missile) that circle around the hero. Whenever one of these blades collides with an enemy unit, it dissapears and does damage to the unit. Problem is, I have pretty much absolutely no clue about how to do this. Any help would be so greatly appreciated you don't even know. Thanks a million!
-Z
 
Level 4
Joined
Jun 5, 2007
Messages
65
Unfortunately, no. The closest thing would be lightning shield and that does damage to all surrounding units for a set amount of time- not quite what I'm looking for. However I've seen this type of thing done before so I know its possible.
 
Level 7
Joined
Jun 10, 2007
Messages
225
Ive done spells like this before. The basic idea behind mine was 4 arrays-
1 unit array for the rotating units
1 real array for the distance (in this case it stays the same, so you dont need this)
1 real array for the angle
1 point array for unleaking.

Basically, from each integer 1 thtough however many objects you have, you will (on your trigger #1, initilization) give it a preset angle. Lets say your using 2 projectiles. 1 has a preset angle real of 180 and another of 0.
In the second trigger, the main one, every .04 seconds it does this:
Sets a variable to the axis
Uses a loop to set each angle real to the angle real + 2 or so. (so they can rotate)
Uses a loop to set each point in your array to (Axis Center) offset by (Distance from axis) with angle (angle array[Integer A])
For the damage, you will just set a unit group variable to units in range, and if a random unit in that group is a unit, damage and destroy the projectile. Or else, do nothing so the projectile continues.

If you need anything explained in more detail, just ask. I can post the triggers I used if you need that, also.



Edit: Heres the triggers:

Heres the triggers, by Zoraykos's request.
Note - I deleted the parts of these triggers which cause the projectiles to face the correct way and damage things, because they are confusing as hell (even to me and I wrote this)

The first trigger basically sets all of your variables and creates your dummy units.

  • ActivatePwnage Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Pwnage
    • Actions
      • Set PwnagePoint[0] = (Position of (Triggering unit))
      • Set PwnageUnit[0] = (Triggering unit)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set PwnageReal[(Integer A)] = (36.00 x (Real((Integer A))))
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set PwnagePoint[(Integer A)] = (PwnagePoint[0] offset by 200.00 towards PwnageReal[(Integer A)] degrees)
          • Unit - Create 1 BlueBallDummy for (Owner of PwnageUnit[0]) at PwnagePoint[(Integer A)] facing Default building facing degrees
          • Set PwnageUnit[(Integer A)] = (Last created unit)
      • For each (Integer A) from 0 to 10, do (Actions)
        • Loop - Actions
          • Custom script: call RemoveLocation(udg_PwnagePoint[GetForLoopIndexA()])
      • Trigger - Turn on Main Pwnage Copy <gen>
The second trigger is the bulk of it. Basically, this moves the units to a point will polar offset with the angle of your corresponding real array. Once it does that, it increases each variable in the array by a small amount so they rotate. Finally, it cleans up the variables and prepares to occur all over again.

  • Main Pwnage Copy
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set PwnagePoint[0] = (Position of PwnageUnit[0])
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set PwnagePoint[(Integer A)] = (PwnagePoint[0] offset by 200.00 towards PwnageReal[(Integer A)] degrees)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set PwnageReal[(Integer A)] = (PwnageReal[(Integer A)] + 8.00)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set PwnagePoint[(Integer A)] = (PwnagePoint[0] offset by (PwnageReal[((Integer A) + 10)] + 0.00) towards PwnageReal[(Integer A)] degrees)
          • Unit - Move PwnageUnit[(Integer A)] instantly to PwnagePoint[(Integer A)], facing (0.00 + (Angle from PwnagePoint[((Integer A) + 10)] to PwnagePoint[(Integer A)])) degrees
      • For each (Integer A) from 0 to 10, do (Actions)
        • Loop - Actions
          • Custom script: call RemoveLocation(udg_PwnagePoint[GetForLoopIndexA()])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PwnageReal[1] Greater than or equal to 600.00
        • Then - Actions
          • For each (Integer A) from 1 to 10, do (Actions)
            • Loop - Actions
              • Unit - Kill PwnageUnit[(Integer A)]
          • For each (Integer A) from 0 to 20, do (Actions)
            • Loop - Actions
              • Set PwnageReal[(Integer A)] = 0.00
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
Level 4
Joined
Jun 5, 2007
Messages
65
T_T that doesn't work either because they move outwards while rotating (like a big spiral) and then dissapear at a certain point.
 
Level 7
Joined
Jun 10, 2007
Messages
225
Whoops- my fault.
In the third loop there is a line
  • Set PwnagePoint[(Integer A)] = (PwnagePoint[0] offset by (PwnageReal[((Integer A) + 10)] + 0.00) towards PwnageReal[(Integer A)] degrees)
change this to
  • Set PwnagePoint[(Integer A)] = (PwnagePoint[0] offset by 200 towards PwnageReal[(Integer A)] degrees)
 
Status
Not open for further replies.
Top