HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Lightning Whip Spell messed up

01-27-2006, 07:51 PM#1
Zalvurek
I went to wc3sear.ch in search for models, spells, and whatever else to improve my map from "suckage" status (I gave it that status btw). When I was going through the spells I found Lightning Whip (Pudge's Meat Hook from DotA or at least a copy/original of the spell). I imported it to my map and gave it to one of my heroes but it doesn't work.

For some reason the whip is shooting out as crypt fiends not blue lightning balls like it's suppose to. I thought it may have been something I changed (which I thought was only the damage and # links) but I recopied and pasted it in and the links still look like crypt fiends. On top of that the crypt fiends don't even expand out in a straight line but kind of a zig-zag fashion and it doesn't look like it's the correct amount of links.

I find this very confusing because nothing has changed from my map and the map I'm importing it from. How do I fix this? If you need to figure it out then ask me and I'll post it.
01-28-2006, 06:55 AM#2
Naakaloh
Only knowing the symptoms doesn't help much for resolving the issue. Sorry if I sound rude, but nobody can help if they don't know what to look at and only know what to look for.
01-28-2006, 06:57 AM#3
Jacek
You mean crypt fiends are shooting? Did you change all rawcodes (that 'A001' thingies)? Have you tried following Daelin's Spell Importing Tutorial?
01-28-2006, 02:18 PM#4
Zalvurek
It is my understanding that all default rawcodes are constant from one map to another. And considering that the model file used is default that shouldn't cause a problem. If I'm wrong please let me know. I also don't know much about JASS. I can't discern the difference between what is the model file of the links and what is the filtering code for what it pulls back or whatever else it is doing. I will insert the JASS code here:
Code:
function Trig_Whip_Extend_Func001Func007001003001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction

function Trig_Whip_Extend_Func001Func007001003002001 takes nothing returns boolean
    return ( IsUnitDeadBJ(GetFilterUnit()) == false )
endfunction

function Trig_Whip_Extend_Func001Func007001003002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) != 'Ewar' )
endfunction

function Trig_Whip_Extend_Func001Func007001003002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) != 'U000' )
endfunction

function Trig_Whip_Extend_Func001Func007001003002002002002001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == false )
endfunction

function Trig_Whip_Extend_Func001Func007001003002002002002002 takes nothing returns boolean
    return ( 'Bmlt' == 'Bmlt' )
endfunction

function Trig_Whip_Extend_Func001Func007001003002002002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_Whip_Extend_Func001Func007001003002002002002001(), Trig_Whip_Extend_Func001Func007001003002002002002002() )
endfunction

function Trig_Whip_Extend_Func001Func007001003002002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_Whip_Extend_Func001Func007001003002002002001(), Trig_Whip_Extend_Func001Func007001003002002002002() )
endfunction

function Trig_Whip_Extend_Func001Func007001003002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_Whip_Extend_Func001Func007001003002002001(), Trig_Whip_Extend_Func001Func007001003002002002() )
endfunction

function Trig_Whip_Extend_Func001Func007001003002 takes nothing returns boolean
    return GetBooleanAnd( Trig_Whip_Extend_Func001Func007001003002001(), Trig_Whip_Extend_Func001Func007001003002002() )
endfunction

function Trig_Whip_Extend_Func001Func007001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_Whip_Extend_Func001Func007001003001(), Trig_Whip_Extend_Func001Func007001003002() )
endfunction

function Trig_Whip_Extend_Func001Func007Func001001 takes nothing returns boolean
    return ( udg_Link > 3 )
endfunction

function Trig_Whip_Extend_Func001Func007Func002C takes nothing returns boolean
    if ( not ( IsUnitAlly(udg_HandUnit[2], GetOwningPlayer(udg_HandUnit[1])) == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Whip_Extend_Func001Func007Func003C takes nothing returns boolean
    if ( not ( udg_HandUnit[2] == null ) ) then
        return false
    endif
    return true
endfunction

function Trig_Whip_Extend_Func001Func007A takes nothing returns nothing
    if ( Trig_Whip_Extend_Func001Func007Func001001() ) then
        set udg_HandUnit[2] = GetEnumUnit()
    else
        call DoNothing(  )
    endif
    if ( Trig_Whip_Extend_Func001Func007Func002C() ) then
        call UnitDamageTargetBJ( udg_HandUnit[1], udg_HandUnit[2], ( I2R(udg_Level) * 100.00 ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_ENHANCED )
    else
    endif
    if ( Trig_Whip_Extend_Func001Func007Func003C() ) then
        call DoNothing(  )
    else
        call DisableTrigger( GetTriggeringTrigger() )
        call EnableTrigger( gg_trg_WhipRe )
    endif
endfunction

function Trig_Whip_Extend_Func001C takes nothing returns boolean
    if ( not ( udg_Link < ( 5 + ( 6 * udg_Level ) ) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Whip_Extend_Actions takes nothing returns nothing
    if ( Trig_Whip_Extend_Func001C() ) then
        set udg_Link = ( udg_Link + 1 )
        call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(udg_HandUnit[1]), PolarProjectionBJ(GetUnitLoc(udg_HandUnit[1]), ( I2R(udg_Link) * 40.00 ), GetUnitFacing(udg_HandUnit[1])), GetUnitFacing(udg_HandUnit[1]) )
        set udg_LinkA[udg_Link] = GetLastCreatedUnit()
        call ForGroupBJ( GetUnitsInRangeOfLocMatching(115.00, GetUnitLoc(GetLastCreatedUnit()), Condition(function Trig_Whip_Extend_Func001Func007001003)), function Trig_Whip_Extend_Func001Func007A )
    else
        call DisableTrigger( GetTriggeringTrigger() )
        call EnableTrigger( gg_trg_WhipRe )
    endif
endfunction

//===========================================================================
function InitTrig_Whip_Extend takes nothing returns nothing
    set gg_trg_Whip_Extend = CreateTrigger(  )
    call DisableTrigger( gg_trg_Whip_Extend )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Whip_Extend, 0.03 )
    call TriggerAddAction( gg_trg_Whip_Extend, function Trig_Whip_Extend_Actions )
endfunction

If I had to guess I would say that the "Bmlt" part is the model file but I have no idea how to find model rawcodes (I do for ability/unit/item's).

Sorry If I wasn't clear with the DotA reference, I know that a lot of people havn't played that map before. What the spell is suppose to do is kind of like a whip effect. It extends outwards from the casting unit using links. These links attach to each other in a straight line until it either A: reaches a unit (excluding ancients and structures) or B: it has reached it's maximum amount of links. If it hits a unit then it drags the unit back towards the casting unit to the origination point of the links dealing it damage as well.

I hope all of this information helps and clears it up enough.
01-28-2006, 04:36 PM#5
Naakaloh
Whoa, kinda weird trying to figure that out without useful function names (it's the convention used by Blizzard's GUI, so it's obvious these were converted from GUI), but anyway...

Code:
function Trig_Whip_Extend_Func001Func007001003002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) != 'U000' )
endfunction

// This next one was much further down

function Trig_Whip_Extend_Actions takes nothing returns nothing
    if ( Trig_Whip_Extend_Func001C() ) then
        set udg_Link = ( udg_Link + 1 )
        call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(udg_HandUnit[1]), PolarProjectionBJ(GetUnitLoc(udg_HandUnit[1]), ( I2R(udg_Link) * 40.00 ), GetUnitFacing(udg_HandUnit[1])), GetUnitFacing(udg_HandUnit[1]) )
        set udg_LinkA[udg_Link] = GetLastCreatedUnit()
        call ForGroupBJ( GetUnitsInRangeOfLocMatching(115.00, GetUnitLoc(GetLastCreatedUnit()), Condition(function Trig_Whip_Extend_Func001Func007001003)), function Trig_Whip_Extend_Func001Func007A )
    else
        call DisableTrigger( GetTriggeringTrigger() )
        call EnableTrigger( gg_trg_WhipRe )
    endif
endfunction

That refers to a custom Undead unit. Actually the first custom Undead unit you've made in the map, which I'm guessing has the art of a crypt fiend.

What I think you need to do is create a new unit, and give it the lighting model. Then show rawcodes for the units (Ctrl+D should do it) and use the rawcode of the unit you created. Basically replace the 'U000' in the script with the code that's associated with the unit that has the lightning art.

Edit: Are there supposed to be scroll bars for the code box? Some of the function calls seem to be causing it to stretch the browser window.
01-28-2006, 06:11 PM#6
Zalvurek
Thank you Naakaloh, you were right :). After you said that I figured that the map I imported it from MUST have had a unit already set up for it. And there was, I didn't import it because i thought that since it was the only custom unit that it was the hero in the map and the hero in the map was just an altered default hero. So thank you.
01-28-2006, 06:19 PM#7
Jacek
I told you it is wrong rawcodes issue.