HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Pushback nova?

01-23-2006, 10:10 AM#1
PlasticAngel
Is it possible to do a nova spell that pushes all the units affected away from the target? And GUI please. (yes I am starting to make spells so fear).
01-23-2006, 10:14 AM#2
Naakaloh
Yes, but I don't think you can do it entirely GUI (at least I wouldn't want to). I think Blade.dk may have done a stomp spell in one of the demo maps around the forum that does something to what you're talking about.
01-23-2006, 11:21 AM#3
Whitehorn
Anything is possible, but easier, and more efficient in JASS.
01-23-2006, 01:37 PM#4
PlasticAngel
Well know that I know that it can be done, can someone help me on how?
01-23-2006, 01:50 PM#5
Vexorian
I once made one of them, hated that spell it lagged too much no matter how I optimized it
01-23-2006, 01:56 PM#6
Blade.dk
There is such a spell at wc3s, I will find the link.
01-23-2006, 01:56 PM#7
qwertyui
well...
the general algorithm can look like this (requires Trigonometry Knowledge lvl3):

Global - NovaPushPower - how fast it pushes units away
Global - NovaDistance - maximum distance from nova focus point the unit can stay and still be affected
Global - NovaDuration - how long does the pushback effect last

Event/Condition
Unit casts pushback nova
Actions:
1) Pick all units within nova range and save them to group
2) pick every unit
i) Calculate the difference between x coordinates of locations of target unit and caster
ii) Calculate the difference between y coordinates of locations of target unit and caster
iii) Calculate distance between caster and target (square root from (x^2+y^2))
iv) calculate sinus and cosinus of angle between x axis and line, passing through locations of target and caster (x/distance for cosinus, y/distance for sinus)
v) optional - determine strenght of nova impact, by dividing (1-distance between targets) by maximum nova radius and multiplying it by nova power. If don't want push to lose strenght depending on distance to target, just use nova power variable as nova power in further calculations.
vi) calculate target movement along x axis (nova power * cosinus)
vii) calculate target movment along y axis (nova power * sinus)
viii) change the target coordinates by calculated target movement every 0.1 second until NovaDuration runs out.

That's how the general algorithm can look.
Not sure its doable in GUI :/ I already see at least one case for ExecuteFunc() to be used, which is Jass only.
Could be wrong though ^^
01-23-2006, 02:08 PM#8
Blade.dk
http://www.wc3sear.ch/index.php?p=Spells&ID=528&sid=

If you wanted an already done pushback nova GUI spell, here it is.
01-23-2006, 02:56 PM#9
Jacek
The only problem in this spell would be making non-leaking PolarProjectionBJ.
01-23-2006, 03:11 PM#10
Chuckle_Brother
Well that spell sucks.
1) It leaks
2) It uses a time increment that is WAY TOO DAMNED HIGH
3) It's very badly done GUI, GUI doesn't need to suck so hard if it's done with more than a half-assed attempt

Heres the triggers for one I made, it has no special effects since this is about method, not pretty crap.

Trigger:
Thunder Clap Init
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Thunder Clap
Collapse Actions
Set Thunder_Point = (Position of (Triggering unit))
Wait 0.10 seconds
Set Thunder_Group = (Units within 350.00 of Thunder_Point matching (((Matching unit) has buff Thunder Clap) Equal to True))
Collapse Unit Group - Pick every unit in Thunder_Group and do (Actions)
Collapse Loop - Actions
Unit - Pause (Picked unit)
Set TempPoint[0] = (Position of (Picked unit))
Unit - Turn collision for (Picked unit) Off
-------- Save Their movespeed so we can properly reinstate it later --------
Unit - Set the custom value of (Picked unit) to 5
-------- Current Speed They will Slide With --------
-------- This speed will decrease as we decelerate the unit so the slide looks real --------
Set Thunder_Speed = 25.00
Custom script: call RemoveLocation(udg_TempPoint[0])
Trigger - Turn on Thunder Clap Movement <gen>
Wait until (Thunder_Speed Less than or equal to 5.00), checking every 0.10 seconds
Trigger - Turn off Thunder Clap Movement <gen>
Collapse Unit Group - Pick every unit in Thunder_Group and do (Actions)
Collapse Loop - Actions
Unit - Unpause (Picked unit)
Unit - Set the custom value of (Picked unit) to 0
Custom script: call RemoveLocation(udg_Thunder_Point)
Unit Group - Remove all units from Thunder_Group
Custom script: call DestroyGroup(udg_Thunder_Group)

Trigger:
Thunder Clap Movement
Collapse Events
Time - Every 0.04 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Thunder_Group and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Picked unit)) Not equal to 0
Collapse Then - Actions
-------- Save the points so we can remove them --------
Set TempPoint[0] = (Position of (Picked unit))
Set TempPoint[1] = (TempPoint[0] offset by Thunder_Speed towards (Angle from Thunder_Point to TempPoint[0]) degrees)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Terrain pathing at TempPoint[1] of type Walkability is off) Equal to True
(Current movement speed of (Picked unit)) Less than or equal to 0.00
Collapse Then - Actions
-------- ZOMG!! They can't slide, so stop them cold --------
-------- ie. Unpause them and remove them from the group --------
Unit - Unpause (Picked unit)
Unit - Set the custom value of (Picked unit) to 0
Custom script: call RemoveLocation(udg_TempPoint[0])
Custom script: call RemoveLocation(udg_TempPoint[1])
Collapse Else - Actions
Unit - Move (Picked unit) instantly to TempPoint[1]
Custom script: call RemoveLocation(udg_TempPoint[0])
Custom script: call RemoveLocation(udg_TempPoint[1])
Else - Actions
Set Thunder_Speed = (Thunder_Speed - 1.70)
01-23-2006, 03:20 PM#11
Tim.
Quote:
Originally Posted by Whitehorn
Anything is possible, but easier, and more efficient in JASS.
You said it.
01-23-2006, 06:15 PM#12
Chuckle_Brother
Sadly he requested it to be only GUI, I was hoping for a chance to test out my newfound skills at using JASS