HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Another problem I have, this time with jumping...

02-19-2007, 05:58 AM#1
st33m
So, I took the GUI Jump triggers, and converted them... or sort of based something off of them that now targets a unit, and jumps to its position.

Trigger:
OoSPM
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to One of Sword Perpendicular Month
Collapse Actions
Set OoSPM_IntegerToMoveCastingUnit = (Target unit of ability being cast)
Set OoSPM_IntegerMoveToPoint2 = (Integer((Distance between (Position of OoSPM_Caster) and (Position of OoSPM_IntegerToMoveCastingUnit))))
Set OoSPM_Caster = (Casting unit)
Unit - Pause OoSPM_Caster
Unit - Turn collision for OoSPM_Caster Off
Animation - Change OoSPM_Caster's animation speed to 70.00% of its original speed
Animation - Play OoSPM_Caster's attack slam animation
Unit - Add Crow Form to OoSPM_Caster
Unit - Remove Crow Form from OoSPM_Caster
Animation - Change OoSPM_Caster flying height to 500.00 at 1000.00
Trigger - Turn on OoSPM Effect <gen>
Wait 0.30 seconds
Animation - Change (Casting unit) flying height to 0.00 at 1000.00
Wait 0.40 seconds
Unit - Turn collision for (Casting unit) On
Animation - Change (Casting unit)'s animation speed to 100.00% of its original speed
Trigger - Turn off OoSPM Effect <gen>
Unit - Unpause (Casting unit)
Special Effect - Create a special effect at TempPoint using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
Collapse Unit Group - Pick every unit in (Units within 300.00 of (Position of OoSPM_Caster) matching ((((Matching unit) belongs to an enemy of (Owner of OWF_Caster)) Equal to True) and (((Matching unit) is A structure) Equal to False))) and do (Actions)
Collapse Loop - Actions
Unit - Cause OoSPM_Caster to damage (Picked unit), dealing (((Real((Strength of OoSPM_Caster (Include bonuses)))) x 2.00) + ((In-game time of day) / 100.00)) damage of attack type Spells and damage type Normal
Floating Text - Create floating text that reads (String((((Integer((In-game time of day))) / 100) + ((Strength of OoSPM_Caster (Include bonuses)) x 2)))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds

Trigger:
OoSPM Effect
Collapse Events
Time - Every 0.02 seconds of game time
Conditions
Collapse Actions
Set OoSPM_TempPoint = ((Position of OoSPM_Caster) offset by ((Real(OoSPM_IntegerMoveToPoint2)) / 50.00) towards (Facing of OoSPM_Caster) degrees)
Unit - Move OoSPM_Caster instantly to OoSPM_TempPoint
Custom script: call RemoveLocation( udg_OoSPM_TempPoint )

I have two problems: 1) It deals damage and creates floating text on the hero, and 2) the FIRST and ONLY FIRST time the spell is cast, it moves the hero very rapidly 4 or 5 times further than it should, BUT, assuming the hero doesnt get stuck somewhere odd, the spell works (jump, not damage related) fine every other time.
02-19-2007, 06:09 AM#2
Pyrogasm
Should not this line:
Trigger:
Unit Group - Pick every unit in (Units within 300.00 of (Position of OoSPM_Caster) matching ((((Matching unit) belongs to an enemy of (Owner of OWF_Caster)) Equal to True) and (((Matching unit) is A structure) Equal to False))) and do (Actions)
Read "(Owner of OoSPM_Caster)"?

In this line:
Trigger:
Special Effect - Create a special effect at TempPoint using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdlp
The variable "TempPoint" is not declared. How is the effect created if the point isn't set?

Also, you're using "Casting Unit" after a wait. Use the unit varible you declared earlier instead of "Casting Unit". Aside from that, you're leaking tons of locations, though I don't see anything jarringly wrong with the code.

Start again from scratch?
02-19-2007, 07:13 AM#3
st33m
Maybe.

AND that still doesnt explain what is causing odd jumping. Nothing in that should move the unit to anywhere other than the specified point...
02-19-2007, 07:56 AM#4
Krysho
Can't help but notice that you decided to use the casting unit variable in a distance formula before it is set to the casting unit.

If I had to venture a guess, I'd say that, assuming the variable is undeclared like I think, the distance formula would then return the distance between maybe the center of the map and the targeted unit point, instead of using the caster unit point and targeted unit point... or something similar, it is late and I don't like thinking too much.

On another thought, there's also the possibility that if another unit were to cast the spell, it'd use the previous unit's distance instead of the current unit's distance.