ZiggyMcjoney
Data editor?! AAAHHHHH!
- Reaction score
- 95
Dragging Units in to a Point [solved]
So I had a bit of fun with trying to make a spell that would drag all units in an area in towards a point. The basic framework of things turned out to be alot easier than I expected, which is good. However there is one problem with the code.
Basically all the units are picked up, they get dragged towards the centre, however some of them will reach it and others will be stuck running into the units, unable to reach the centre, and therefor never firing off the stun, and never being released from the grip of the spell, until the other units get the stun removed and can walk off to let those ones in to get stunned.
It just looks silly.
Anyway here are the two triggers, let me know how I can work around this!
The If condition in there was my attempt to stop this from happening, but it doesn't always work, and even if it does, the units never end up being in a clustered group - instead they're in some sort of squiggly, uneven arch, or a squiggly uneven circle.
Thanks in advance for any help!
So I had a bit of fun with trying to make a spell that would drag all units in an area in towards a point. The basic framework of things turned out to be alot easier than I expected, which is good. However there is one problem with the code.
Basically all the units are picked up, they get dragged towards the centre, however some of them will reach it and others will be stuck running into the units, unable to reach the centre, and therefor never firing off the stun, and never being released from the grip of the spell, until the other units get the stun removed and can walk off to let those ones in to get stunned.
It just looks silly.
Anyway here are the two triggers, let me know how I can work around this!
Trigger:
- Ultimate
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Grip of the Tides
- Actions
- Custom script: call RemoveLocation(udg_TidalUltiPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
- Custom script: call DestroyGroup(udg_TidalUltiGroup[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
- Set TidalUltiPoint[(Player number of (Owner of (Triggering unit)))] = (Target point of ability being cast)
- Set TidalUltiGroup[(Player number of (Owner of (Triggering unit)))] = (Units within (600.00 x 1.00) of TidalUltiPoint[(Player number of (Owner of (Triggering unit)))] matching ((((Matching unit) is alive) Equal to True) and ((((Triggering unit) is A structure) Equal to False) and ((Owner of (Matching unit)) Equal to Player 7 (G
- For each (Integer A) from 1 to 32, do (Actions)
- Loop - Actions
- Set Temp_Point_2 = (TidalUltiPoint[(Player number of (Owner of (Triggering unit)))] offset by 500.00 towards ((Real((Integer A))) x 11.25) degrees)
- Special Effect - Create a special effect at Temp_Point_2 using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation (udg_Temp_Point_2)
- Loop - Actions
- Unit Group - Pick every unit in TidalUltiGroup[(Integer A)] and do (Actions)
- Loop - Actions
- Unit - Pause (Picked unit)
- Unit - Turn collision for (Picked unit) Off
- Loop - Actions
- Events
Trigger:
- Ultimate 2
- Events
- Time - Every 0.03 seconds of game time
- Conditions
- Actions
- For each (Integer A) from 1 to 6, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Player((Integer A))) slot status) Equal to Is playing
- ((Player((Integer A))) controller) Equal to User
- (Unit-type of Hero[(Integer A)]) Equal to |cff48D1CCTidal Decimator|r
- Then - Actions
- Unit Group - Pick every unit in TidalUltiGroup[(Integer A)] and do (Actions)
- Loop - Actions
- Set Temp_Point = (Position of (Picked unit))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between Temp_Point and TidalUltiPoint[(Integer A)]) Greater than or equal to (90.00 + (10.00 x (Real((Number of units in TidalUltiGroup[(Integer A)])))))
- Then - Actions
- Set Temp_Point_2 = (Temp_Point offset by 7.50 towards (Angle from Temp_Point to TidalUltiPoint[(Integer A)]) degrees)
- Unit - Move (Picked unit) instantly to Temp_Point_2
- Custom script: call RemoveLocation(udg_Temp_Point_2)
- Else - Actions
- Unit - Create 1 Dummy Unit (General) for (Player((Integer A))) at Temp_Point facing Default building facing degrees
- Unit - Add 5 sec stun water effect to (Last created unit)
- Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
- Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
- Unit Group - Remove (Picked unit) from TidalUltiGroup[(Integer A)]
- Unit - Unpause (Picked unit)
- Unit - Turn collision for (Picked unit) On
- If - Conditions
- Custom script: call RemoveLocation(udg_Temp_Point)
- Loop - Actions
- Unit Group - Pick every unit in TidalUltiGroup[(Integer A)] and do (Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer A) from 1 to 6, do (Actions)
- Events
The If condition in there was my attempt to stop this from happening, but it doesn't always work, and even if it does, the units never end up being in a clustered group - instead they're in some sort of squiggly, uneven arch, or a squiggly uneven circle.
Thanks in advance for any help!