Skills returning hero to mid of map, help please =(

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

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

Skills returning hero to mid of map, help please =(

Post by darkxion »

Two skills used in this map are causing the heroes to warp to the middle of the map, if they order-move just as the spell pops off. I've tried to fix this before but unfortunately my knowledge of JASS is too poor to do the job. Any help would be a miracle, thanks a bunch in advance.

I'm aware as someone has told me before, these triggers appear to be just GUI that was converted to JASS, and is thus really messy. Sorry.

The first problem is ability A024.

Code: Select all

//===========================================================================
// Trigger: Aizen
//===========================================================================
function Trig_Aizen_Func002C takes nothing returns boolean
if(not(GetSpellAbilityId()=='A024'))then
return false
endif
return true
endfunction

function Trig_Aizen_Actions takes nothing returns nothing
if(Trig_Aizen_Func002C())then
call TriggerSleepAction(0.10)
set udg_Aizen=GetSpellAbilityUnit()
set udg_Loc2=GetUnitLoc(udg_Aizen)
set bj_forLoopBIndex=1
set bj_forLoopBIndexEnd=GetUnitAbilityLevelSwapped('A024',udg_Aizen)
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call UnitAddItemByIdSwapped('I00H',GetSpellAbilityUnit())
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
call RemoveLocation(udg_Loc2)
set udg_Loc2=PolarProjectionBJ(GetUnitLoc(GetSpellTargetUnit()),50.00,GetUnitFacing(GetSpellTargetUnit()))
call SetUnitFacingToFaceUnitTimed(udg_Aizen,GetSpellTargetUnit(),0.01)
call SetUnitPositionLocFacingLocBJ(udg_Aizen,udg_Loc2,udg_Loc2)
call AddSpecialEffectLocBJ(udg_Loc2,"Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl")
call DestroyEffectBJ(GetLastCreatedEffectBJ())
call RemoveLocation(udg_Loc2)
else
endif

function InitTrig_Aizen takes nothing returns nothing
set gg_trg_Aizen=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Aizen,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(gg_trg_Aizen,function Trig_Aizen_Actions)
endfunction
Whereas the second problematic ability is A09R

Code: Select all

//===========================================================================
// Trigger: Cloud Chrono
//===========================================================================
function Trig_Cloud_Chrono_Func001C takes nothing returns boolean
if(not(GetSpellAbilityId()=='A09R'))then
return false
endif
return true
endfunction

function Trig_Cloud_Chrono_Actions takes nothing returns nothing
if(Trig_Cloud_Chrono_Func001C())then
call TriggerSleepAction(0.20)
set udg_Loc1=GetUnitLoc(GetSpellAbilityUnit())
set udg_CloudLOC=PolarProjectionBJ(GetUnitLoc(GetSpellTargetUnit()),5.00,0)
set udg_CloudClimm=GetSpellAbilityUnit()
call PauseUnitBJ(true,udg_CloudClimm)
call SetUnitPathing(udg_CloudClimm,false)
call RemoveLocation(udg_Loc1)
call SetUnitAnimation(udg_CloudClimm,"attack")
call TriggerSleepAction((DistanceBetweenPoints(GetUnitLoc(udg_CloudClimm),udg_CloudLOC)/1500.00))
call PauseUnitBJ(false,udg_CloudClimm)
call SetUnitPathing(udg_CloudClimm,true)
set udg_CloudClimm=null
call RemoveLocation(udg_CloudLOC)
else
endif

function InitTrig_Cloud_Chrono takes nothing returns nothing
set gg_trg_Cloud_Chrono=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Cloud_Chrono,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(gg_trg_Cloud_Chrono,function Trig_Cloud_Chrono_Actions)
endfunction
Last edited by darkxion on April 22nd, 2008, 11:08 am, edited 1 time in total.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Skills returning hero to mid of map, help please =(

Post by Aero »

How about you just give a description of the ability, what it does and any other relevant information and we'll make a brand new one.
I'm definitely not going to try reading through that.
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Skills returning hero to mid of map, help please =(

Post by Ozzapoo »

THis looks like it wasn't protected... If so then can't you just open it up in world editor -.-? Or give us the map?
Reading through all that is annoyingly.... annoying...
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
darkxion
Member
Posts: 57
Joined: April 26th, 2007, 7:53 pm

Re: Skills returning hero to mid of map, help please =(

Post by darkxion »

You're right that was too much to read, sorry. It seems I posted some of the other functions besides the one that was a problem, it was way too long, I cleaned it up.

Also, it WAS protected, it isn't protected now, but that won't help much, since it's now in one big chunk of JASS, I couldn't recover the GUI, if that's what you were wanting to see.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Skills returning hero to mid of map, help please =(

Post by Aero »

Aero wrote:How about you just give a description of the ability, what it does and any other relevant information and we'll make a brand new one.
I'm definitely not going to try reading through that.
darkxion
Member
Posts: 57
Joined: April 26th, 2007, 7:53 pm

Re: Skills returning hero to mid of map, help please =(

Post by darkxion »

Maybe there's a better way to tackle this, where I'll learn something new as well. If I wasn't a complete JASS noob it probably wouldn't have been such a problem from the start.

I heard that "TriggerSleepAction" clears some variables, and that I should use local variables before the TriggerSleepAction. This is because apparently certain natives no longer return the correct units after a TriggerSleepAction (or so I was told). How can I just use a local variable for the function instead?

I tried defining my locals at very start of the function, No errors in JassCraft, but it still doesn't stop the error when I use the skill. It's probably something simple in what's being set and called...=(

Code: Select all

function O91737 takes nothing returns nothing
        local unit localunit1 = null
        local location localloc1 = null
    if(O91551())then
		set localunit1=GetSpellAbilityUnit()
        set localloc1=GetUnitLoc(localunit1)
        call TriggerSleepAction(0.10)
        set bj_forLoopBIndex=1
        set bj_forLoopBIndexEnd=GetUnitAbilityLevelSwapped('A024',localunit1)
        loop
            exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
            call UnitAddItemByIdSwapped('I00H',GetSpellAbilityUnit())
            set bj_forLoopBIndex=bj_forLoopBIndex+1
        endloop
        call RemoveLocation(localloc1)
        set localloc1=PolarProjectionBJ(GetUnitLoc(GetSpellTargetUnit()),50.00,GetUnitFacing(GetSpellTargetUnit()))
        call SetUnitFacingToFaceUnitTimed(localunit1,GetSpellTargetUnit(),0.01)
        call SetUnitPositionLocFacingLocBJ(localunit1,localloc1,localloc1)
        call AddSpecialEffectLocBJ(localloc1,"Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl")
        call DestroyEffectBJ(GetLastCreatedEffectBJ())
        call RemoveLocation(localloc1)
    else
    endif
At first I was gonna try to uhm...define them by the "function parameter" which I guess is something like this except not wrong, but I wasn't sure how to do it really. JassCraft complained about undeclared locals and a symbol multiply error or something so I obviously did it wrong.

Code: Select all

function O91737 takes nothing returns nothing 
    local unit localunit1 = null
    local location localloc1 = null
endfunction
Last edited by darkxion on April 22nd, 2008, 3:06 pm, edited 10 times in total.
User avatar
Kryptonyte
Forum Staff
Posts: 1400
Joined: March 17th, 2008, 12:07 am

Re: Skills returning hero to mid of map, help please =(

Post by Kryptonyte »

Aero wrote:
Aero wrote:How about you just give a description of the ability, what it does and any other relevant information and we'll make a brand new one.
I'm definitely not going to try reading through that.
How about you listen to Aero?
He is uberful at JASS (See my sig? Yeah, that's him owning a Super-Mod with JASS)
So do what he says and all will be fine, k?
Image
Made by the late ILikeHacking

My quote from SKillER
Spoiler:
Chat wrote:(19:12:41) SKillER: newfags cant triforce
(19:20:30) SKillER: ▲
▲ ▲
(19:20:35) SKillER: aww
(19:20:37) FatherSpace: FAIL
(19:20:43) Kryptonyte: Wow stop failing.
(19:20:47) SKillER: ▲
▲ ▲
(19:21:41) Kryptonyte: .

. ▲
▲ ▲
(19:22:20) Kryptonyte: I guess you were right, newfags can't triforce.
(19:22:29) SKillER: . . ▲
▲ ▲
(19:23:04) SKillER: OMFG
(19:23:06) SKillER: ... THIS CHAT
(19:23:06) SKillER: !
(19:23:36) SKillER: ▲
▲ ▲
(19:23:46) SKillER: ▲
.▲ ▲
Apparently, SKillER is a newfag.
darkxion
Member
Posts: 57
Joined: April 26th, 2007, 7:53 pm

Re: Skills returning hero to mid of map, help please =(

Post by darkxion »

Let me put it in a simpler way. He may not wanna read that (and I don't blame him), but I don't know HOW to read it. I know basically what the skill does, what it's supposed to do, but some of it, as in ranges and such, I am unsure about.

So rather than try to read that all, half-ass explain how I want it to work based on what I read, and than him have to do a new one from scratch (not that I don't appreciate it, Aero's helped me before and he's cool as hell) I opted to instead ask for a little tip in learning how to fix it *as it is*. I need to learn local variables anyway, this map is nothing but globals, it's the messiest thing anyone's probably ever seen and I bet it's nasty on memory. Especially since the first skill isn't a real problem, because it's one trigger with one skill. But the 2nd one, although you can't see it all because I cut out the stuff that wasn't important, is actually a mixed trigger that combines many skills from 2 different heroes into one trigger. Chances are if one part has to be rewritten completely, it all does, because it's all mixed together. But who knows, I'm a n00b. And it's big. Really big.
Last edited by darkxion on April 22nd, 2008, 2:13 pm, edited 2 times in total.
User avatar
Kryptonyte
Forum Staff
Posts: 1400
Joined: March 17th, 2008, 12:07 am

Re: Skills returning hero to mid of map, help please =(

Post by Kryptonyte »

Hahha sorry.
Last edited by Kryptonyte on April 22nd, 2008, 2:03 pm, edited 1 time in total.
Image
Made by the late ILikeHacking

My quote from SKillER
Spoiler:
Chat wrote:(19:12:41) SKillER: newfags cant triforce
(19:20:30) SKillER: ▲
▲ ▲
(19:20:35) SKillER: aww
(19:20:37) FatherSpace: FAIL
(19:20:43) Kryptonyte: Wow stop failing.
(19:20:47) SKillER: ▲
▲ ▲
(19:21:41) Kryptonyte: .

. ▲
▲ ▲
(19:22:20) Kryptonyte: I guess you were right, newfags can't triforce.
(19:22:29) SKillER: . . ▲
▲ ▲
(19:23:04) SKillER: OMFG
(19:23:06) SKillER: ... THIS CHAT
(19:23:06) SKillER: !
(19:23:36) SKillER: ▲
▲ ▲
(19:23:46) SKillER: ▲
.▲ ▲
Apparently, SKillER is a newfag.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Skills returning hero to mid of map, help please =(

Post by Aero »

What base abilties are these two spells based on?