How can this be fixed?

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

darkxion
Member
Posts: 57
Joined: April 26th, 2007, 7:53 pm

How can this be fixed?

Post by darkxion »

I'm having a couple ability problems. I thought perhaps a simple situation to both of these problems *might* be to remove control of the hero somehow, make it unable to be ordered to be moved, until the ability finishes, but I'm not sure how to do that.

This ability causes the unit to pretty much warp forward to the target, and stop.
But if as you activate the ability, right before the unit moves, you right-click move to a different location, the unit just keeps moving and doesn't stop for awhile, when it does, it tends to get stuck in bad places.
Spoiler:
function test1 takes nothing returns boolean
if(not(GetSpellAbilityId() =='A09R') )then
return false
endif
return true
endfunction
function test_abil1 takes nothing returns nothing
if(test1())then
call TriggerSleepAction(0.20)
set udg_location02=GetUnitLoc(GetSpellAbilityUnit())
set udg_location25=PolarProjectionBJ(GetUnitLoc(GetSpellTargetUnit()),5.00,0)
set udg_unit73=GetSpellAbilityUnit()
call PauseUnitBJ(true,udg_unit73)
call SetUnitPathing(udg_unit73,false)
call RemoveLocation(udg_location02)
call SetUnitAnimation(udg_unit73,"attack")
call TriggerSleepAction((DistanceBetweenPoints(GetUnitLoc(udg_unit73),udg_location25)/1500.00))
call PauseUnitBJ(false,udg_unit73)
call SetUnitPathing(udg_unit73,true)
set udg_unit73=null
call RemoveLocation(udg_location25)

This one creates a fake unit, and moves the actual unit using the ability right in front of the target unit, but if you right-click move right as you use the ability, the casting unit warps right to the middle of the map instead of in front of the target unit.
Spoiler:
function test2 takes nothing returns boolean
if(not(GetSpellAbilityId()=='A024'))then
return false
endif
return true
endfunction
function test_abil2 takes nothing returns nothing
if(test2())then
call TriggerSleepAction(0.10)
set udg_unit21=GetSpellAbilityUnit()
set udg_location01=GetUnitLoc(udg_unit21)
set bj_forLoopBIndex=1
set bj_forLoopBIndexEnd=GetUnitAbilityLevelSwapped('A024',udg_unit21)
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call UnitAddItemByIdSwapped('I00H',GetSpellAbilityUnit())
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
call RemoveLocation(udg_location01)
set udg_location01=PolarProjectionBJ(GetUnitLoc(GetSpellTargetUnit()),50.00,GetUnitFacing(GetSpellTargetUnit()))
call SetUnitFacingToFaceUnitTimed(udg_unit21,GetSpellTargetUnit(),0.01)
call SetUnitPositionLocFacingLocBJ(udg_unit21,udg_location01,udg_location01)
call AddSpecialEffectLocBJ(udg_location01,"Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl")
call DestroyEffectBJ(GetLastCreatedEffectBJ())
call RemoveLocation(udg_location01)
Last edited by darkxion on November 12th, 2007, 7:13 pm, edited 2 times in total.
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: How can this be fixed?

Post by weirdone2 »

To completely stop a unit just pause it. ;)
darkxion
Member
Posts: 57
Joined: April 26th, 2007, 7:53 pm

Re: How can this be fixed?

Post by darkxion »

Somehow I don't think that'll work, I don't wanna make the unit paused, I just want to make it unable to be ordered to move AFTER the ability has been activated. When the user clicks the ability, targets the enemy unit, and moves into casting range, that second right before the ability activates, if the unit makes a right-click move order, it screws it all up. =(
GhettoChild
Old Wrinkly Member
Posts: 272
Joined: January 27th, 2007, 4:46 pm
Title: OxyContin
Location: Denver, Colorado

Re: How can this be fixed?

Post by GhettoChild »

I don't know if I quite understand the ability, but maybe unselect it and add locust to it?
You know why the Yankees always win, Frank?
'Cause they have Mickey Mantle?
No, it's 'cause the other teams can't stop staring at those damn pinstripes.