• 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.

[Trigger] Moving AoE Static Shape Spell

Status
Not open for further replies.
Something nobody has ever attempted before... Unique o.o

So ya..... The problem is the angles, everything else works. The shape has to be a perfect circle, but it doesn't want to be it seems.

If anybody has any idea's I would greatly appreciate it if you shared some because me and my friend are fresh out.

[Trigger=]
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Plasma Wave
Actions
-------- Do not modify this part. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_CurrentIndex Equal to 0
Then - Actions
Trigger - Turn on PlasmaLoop <gen>
Else - Actions
Set PW_CurrentIndex = (PW_CurrentIndex + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_CurrentIndex Greater than PW_MaxIndex
Then - Actions
Set PW_Index[PW_CurrentIndex] = PW_CurrentIndex
Set PW_MaxIndex = PW_CurrentIndex
Else - Actions
Set TempInt = PW_Index[PW_CurrentIndex]
Custom script: if udg_PW_UGroup[udg_TempInt] == null then
Custom script: set udg_PW_UGroup[udg_TempInt] = CreateGroup()
Custom script: endif
Set PW_Angle[TempInt] = 0.00
Set PW_Caster[TempInt] = (Triggering unit)
Set PW_Stage2[TempInt] = False
Set PW_Size[TempInt] = 100.00
Set PW_MaxDistance[TempInt] = 0.00
-------- You can modify everything below. --------
-------- 1 to 36 This creates 36 units. Upon creating less or more units set the angle to 360/how many units it spawns --------
For each (Integer TempInt2) from 1 to 36, do (Actions)
Loop - Actions
Set PW_Angle[TempInt] = (PW_Angle[TempInt] + (360.00 / 36.00))
Set PW_Angle2[TempInt2] = PW_Angle[TempInt]
Set TempPoint = (Position of (Triggering unit))
Set TempPoint2 = (TempPoint offset by 15.00 towards PW_Angle[TempInt] degrees)
Set XCord = (X of TempPoint2)
Set YCord = (Y of TempPoint2)
Unit - Create 1 PlasmaDummy for (Owner of (Triggering unit)) at (Point(XCord, YCord)) facing PW_Angle[TempInt] degrees
Unit Group - Add (Last created unit) to PW_UGroup[TempInt]
Custom script: call RemoveLocation (udg_TempPoint)
Custom script: call RemoveLocation (udg_TempPoint2)

[/Trigger]

[Trigger=]
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer PW_Loop) from 1 to PW_CurrentIndex, do (Actions)
Loop - Actions
Set TempInt = PW_Index[PW_Loop]
Set PW_Size[TempInt] = (PW_Size[TempInt] + 0.01)
Set PW_Integer[TempInt] = 0
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_Stage2[TempInt] Equal to True
Then - Actions
Set PW_MaxDistance[TempInt] = (PW_MaxDistance[TempInt] - 15.00)
Else - Actions
Set PW_MaxDistance[TempInt] = (PW_MaxDistance[TempInt] + 15.00)
Unit Group - Pick every unit in PW_UGroup[TempInt] and do (Actions)
Loop - Actions
Set PW_Integer[TempInt] = (PW_Integer[TempInt] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_Stage2[TempInt] Equal to False
PW_MaxDistance[TempInt] Less than 795.00
Then - Actions
Set TempPoint = (Position of (Picked unit))
Set TempPoint2 = (Position of PW_Caster[TempInt])
Set PW_Angle[TempInt] = (Angle from TempPoint2 to TempPoint)
Set PW_Distance = (Distance between TempPoint and TempPoint2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_Distance Equal to PW_MaxDistance[TempInt]
Then - Actions
Set TempPoint3 = (TempPoint offset by 15.00 towards PW_Angle2[PW_Integer[TempInt]] degrees)
Set XCord = (X of TempPoint3)
Set YCord = (Y of TempPoint3)
Custom script: call RemoveLocation (udg_TempPoint3)
Unit - Move (Picked unit) instantly to (Point(XCord, YCord)), facing PW_Angle[TempInt] degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_Distance Greater than PW_MaxDistance[TempInt]
Then - Actions
Set PW_DistanceDifference = (PW_Distance - PW_MaxDistance[TempInt])
Set TempPoint3 = (TempPoint offset by (PW_DistanceDifference x -1.00) towards PW_Angle2[PW_Integer[TempInt]] degrees)
Set XCord = (X of TempPoint3)
Set YCord = (Y of TempPoint3)
Custom script: call RemoveLocation (udg_TempPoint3)
Unit - Move (Picked unit) instantly to (Point(XCord, YCord)), facing PW_Angle[TempInt] degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_Distance Less than PW_MaxDistance[TempInt]
Then - Actions
Set PW_DistanceDifference = (PW_MaxDistance[TempInt] - PW_Distance)
Set TempPoint3 = (TempPoint offset by PW_DistanceDifference towards PW_Angle2[PW_Integer[TempInt]] degrees)
Set XCord = (X of TempPoint3)
Set YCord = (Y of TempPoint3)
Custom script: call RemoveLocation (udg_TempPoint3)
Unit - Move (Picked unit) instantly to (Point(XCord, YCord)), facing PW_Angle[TempInt] degrees
Else - Actions
Animation - Change (Picked unit)'s size to (PW_Size[TempInt]%, PW_Size[TempInt]%, PW_Size[TempInt]%) of its original size
Custom script: call RemoveLocation (udg_TempPoint)
Custom script: call RemoveLocation (udg_TempPoint2)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_MaxDistance[TempInt] Greater than or equal to 795.00
Then - Actions
Set PW_Stage2[TempInt] = True
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_Stage2[TempInt] Equal to True
Then - Actions
Set TempPoint = (Position of (Picked unit))
Set TempPoint2 = (Position of PW_Caster[TempInt])
Set PW_Angle[TempInt] = (Angle from TempPoint to TempPoint2)
Set PW_Distance = (Distance between TempPoint and TempPoint2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_Distance Equal to PW_MaxDistance[TempInt]
Then - Actions
Set TempPoint3 = (TempPoint offset by -15.00 towards PW_Angle2[PW_Integer[TempInt]] degrees)
Set XCord = (X of TempPoint3)
Set YCord = (Y of TempPoint3)
Custom script: call RemoveLocation (udg_TempPoint3)
Unit - Move (Picked unit) instantly to (Point(XCord, YCord)), facing PW_Angle[TempInt] degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
PW_Distance Greater than PW_MaxDistance[TempInt]
PW_Distance Less than PW_MaxDistance[TempInt]
Then - Actions
Set PW_DistanceDifference = (PW_MaxDistance[TempInt] - PW_Distance)
Set TempPoint3 = (TempPoint offset by PW_DistanceDifference towards PW_Angle2[PW_Integer[TempInt]] degrees)
Set XCord = (X of TempPoint3)
Set YCord = (Y of TempPoint3)
Custom script: call RemoveLocation (udg_TempPoint3)
Unit - Move (Picked unit) instantly to (Point(XCord, YCord)), facing PW_Angle[TempInt] degrees
Else - Actions
Animation - Change (Picked unit)'s size to (PW_Size[TempInt]%, PW_Size[TempInt]%, PW_Size[TempInt]%) of its original size
Custom script: call RemoveLocation (udg_TempPoint)
Custom script: call RemoveLocation (udg_TempPoint2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_MaxDistance[TempInt] Less than or equal to 30.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in PW_UGroup[TempInt]) Equal to 0
Then - Actions
Custom script: call DestroyGroup(udg_PW_UGroup[udg_TempInt])
Set PW_Index[PW_Loop] = PW_Index[PW_CurrentIndex]
Set PW_Index[PW_CurrentIndex] = TempInt
Set PW_CurrentIndex = (PW_CurrentIndex - 1)
Set PW_Loop = (PW_Loop - 1)
Else - Actions
Unit - Remove (Picked unit) from the game
Unit Group - Remove (Picked unit) from PW_UGroup[TempInt]
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PW_CurrentIndex Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Skip remaining actions
Else - Actions

[/Trigger]


Example of what it should look like
Duration of video/example = 0.32 - 0.40
Before that is when not moving and that was the easy part.
 

Attachments

  • Plasma Wave~11.w3x
    23.4 KB · Views: 57
Last edited:
Level 22
Joined
Sep 24, 2005
Messages
4,821
Did you add locust to the dummy units used as effects? It would be easier if a modeller made a model that looks like that, you just need to keep setting its position periodically, no more maths, more fps.
 
Yes locust was added to them.
Even with a model that looked like that..... Did you even read what you typed?

"It would be easier if a modeller made a model that looks like that, you just need to keep setting its position periodically, no more maths, more fps."

What would be the difference if a model looked like that? Don't you need the "maths" to keep setting its position periodically and do more stuff such as damage...? What a funny post lol.

I suppose I need to re-clarify what I need help with... so here it goes.

I need some way to be able to move all the dummy units like a nova then a backwards nova while *following* the caster.

EDIT: I think I will even throw in the demo map for anybody who can't understand the triggers due to how messy they are.
 
You should provide a test map so we can see exactly how it fails to work. I mean, as long as you are updating the x/y source in accordance to the unit's position, it should work fine (if the math is right and if the variables are being loaded properly).

Probably the best thing to do is to display the angles as game messages and make sure that they are staying the same and done properly.

Although, I have a feeling this could be a optimized a bit. The angles are static, so the only thing you really need to check is the distance and apply whether the distance is positive offset or negative offset. Or you could handle it with a nice parabolic equation (vary with time, and peak at the max distance). It is a bit difficult to explain, but maybe I'll make a sample map on monday. :)
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Did you even read what you typed?
I did. I was referring to a single nova model with animations. You were talking about multiple effects in circular formation whilst I was talking about a model that played a nova animation.

What would be the difference if a model looked like that? Don't you need the "maths" to keep setting its position periodically and do more stuff such as damage...? What a funny post lol.
No, you just need to set the X and Y coordinates of the dummy to that of the caster.

You know, I wasn't acting like an ass, so sorry if you thought I were.
 
Oh... Well a model that played a nova animation would still be horrible in this case unless I wanted it to be like thunderclap/warstomp.
You should check the video and the demo map to see what I am trying to do so we don't get more misunderstandings... Sorry, it's just there is no information on something like this while everything I am doing fails to work even though it should. So I do apologize.
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
  • Set PW_Angle2[PW_Integer[TempInt]] = (Facing of (Picked unit))
in the first stage, make this
and in the second:
  • Set PW_Angle2[PW_Integer[TempInt]] = ((Facing of (Picked unit)) + 180.00)

This will solve the main issue, but note that the stage 2 will make weird things... test it and see


EDIT: if you want, i can make the whole spell over... it will be coded in JASS, and can be configurated in GUI
 
my changes made the balls go right on the opening, but another problem made the balls change angle or something at the closing

i tested it myself so i know what happened

Yes exactly... We know what happens too. Do you know how to fix the "something" at the closing? If not then your not suggesting anything new. Thanks though.
 
Status
Not open for further replies.
Top