Compile Script Errors

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
Righto, first off i know nothing about Jass.

I imported a spell, "powerbash", having already implemented Vex's spell thingamajigger doovelacky whagemacallit. (castersystem)

Now, all of Vex's spells work just fine, but the imported spell doesn't.

I get 125 compile errors.

Line (x): expected a name
expected a valid argument list
expected a variable name
expected a code statement
expected a function name

Thats basically the type of errors, only they recur, throughout the map, even for parts of the map that originally were working fine, including parts of vex's raging charge spell, and some of my own triggers. ???

Something has gone terribly wrong here, from putting in the new ability, with its triggering.

I could post the script up, but I got about 7000 lines to browse through. I simple explanation or theory could help narrow this problem down.

Or I could post up the affected lines.

Any knowledgable answers?
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
Make sure the rawcodes in the script match the rawcode of the imported spell(s).

If you have, then copy and paste the aforementioned trigger here.
 

MooMooMan

New Member
Reaction score
3
maybe something is wrong with the pathing?.... it might be causing this problem, or the spell that you imported is incomplete/nonfunctional
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
OK...

This is the Spells trigger. (sorry for the length)

Code:
constant function Powerbash_SpellId takes nothing returns integer
    return 'A02X' // Powerbash rawcode
endfunction

constant function Powerbash_Initialdamage takes real level returns real
    return 0 + level * 50 // Initial damage a unit suffers when bashed
endfunction

constant function Powerbash_Movement takes real level returns real
    return 1 + level * 1 // The distance per 0.01 seconds the target unit moves when bashed
endfunction

constant function Powerbash_Time takes real level returns real
    return 2 + level * 0 // How long a unit is bashed and moving
endfunction

constant function Powerbash_Braketime takes real level returns real
    return 1 + level * 0 // How long a unit is getting slower until total stop
endfunction

constant function Powerbash_Brakedegree takes real level returns real
    return 0.98 // This is the value with that the movement gets multiplied 100 times a second to get
endfunction     // a smooth-brake effect. If you use bigger Brake Times, you should also set this
                // higher, like 9.85 or 9.955

constant function Powerbash_Movementdamage takes real level returns real
    return 0 + level * 0 // The damage a target suffers each move, not used yet
endfunction

constant function Powerbash_Treedamage takes real level returns real
    return 5 + level * 5 // The damage a target suffers when crashing through a tree
endfunction
//===============================================================================
function Trig_Powerbash_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == Powerbash_SpellId() ) ) then
        return false
    endif
    return true
endfunction

function Powerbash_GetUnit takes timer t returns unit
    return GetHandleHandle(t,"target")
endfunction

function Powerbash_GetUnit2 takes timer t returns unit
    return GetHandleHandle(t,"caster")
endfunction

function Powerbash_GetAngle takes timer t returns real
    return GetHandleReal(t,"angle")
endfunction

function TreeCheck takes nothing returns boolean
    return ( IsDestructableAliveBJ(GetEnumDestructable()) == true )
endfunction

function CountDestructablesInRect_Enum takes nothing returns nothing
    if ( TreeCheck() ) then
        set bj_randomSubGroupWant = bj_randomSubGroupWant + 1
    else
        call DoNothing( )
    endif
endfunction

function CountDestructablesInCircle takes location where, real radius returns integer
    local integer old = bj_randomSubGroupWant
    local integer new
    set bj_randomSubGroupWant = 0
    call EnumDestructablesInCircleBJ(radius, where, function CountDestructablesInRect_Enum)
    set new = bj_randomSubGroupWant
    set bj_randomSubGroupWant = old
    return new
endfunction

function Tree_Killer takes nothing returns nothing
    call KillDestructable( GetEnumDestructable() )
endfunction

function Move_Speed takes unit handletarget returns real
    return GetHandleReal(handletarget, "movement")
endfunction

function GetGroup takes location targetloc returns group
    return GetUnitsInRangeOfLocAll(200, targetloc) 
endfunction

function GetPin takes timer t2 returns unit
    return GetHandleHandle(t2,"pin")
endfunction

function bashothers takes nothing returns nothing
    local timer t2 = GetExpiredTimer()
    local real angle = GetHandleReal(t2,"angle")
    local unit pin = GetPin(t2)
    local location otherloc = GetUnitLoc(pin)
    local real movement = Powerbash_Movement(3)*1.5
    local location moveto = PolarProjectionBJ(otherloc, movement, angle)
    local integer runcounter = GetHandleInt(t2,"runcounter")
    call SetUnitPositionLoc(pin, moveto)
    call DestroyEffect(AddSpellEffectByIdLoc(Powerbash_SpellId(), EFFECT_TYPE_SPECIAL, moveto) )
    set pin = null
    call RemoveLocation(otherloc)
    set otherloc = null
    call RemoveLocation(moveto)
    set moveto = null
    set runcounter = runcounter + 1
    call SetHandleInt(t2,"runcounter",runcounter)
    if runcounter >= 15 then
        call DestroyTimer(t2)
    endif
    set t2 = null
endfunction    

function letsbowl_Actions takes nothing returns nothing
    local unit pin = GetTriggerUnit()
    local location targetloc2 = GetUnitLoc(pin)
    local location targetloc = GetUnitLoc(udg_multifuncunit)
    local real angle = AngleBetweenPoints(targetloc, targetloc2)
    local timer t2 = CreateTimer()

    local trigger letsbowlevenmore = CreateTrigger()
    call TriggerRegisterUnitInRangeSimple( letsbowlevenmore, 90, pin )
    call TriggerAddAction( letsbowlevenmore, function letsbowl_Actions )

    call SetHandleHandle(t2, "pin", pin)
    call SetHandleReal(t2, "angle", angle)
    call TimerStart(t2, 0.01, true, function bashothers)
    set pin = null
    call RemoveLocation(targetloc2)
    set targetloc2 = null

    call PolledWait(0.5)
    call TriggerClearActions(letsbowlevenmore)
    call DestroyTrigger(letsbowlevenmore)
    set letsbowlevenmore = null 
endfunction

function Powerbash_Move takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local unit target = Powerbash_GetUnit(t)
    local unit caster = Powerbash_GetUnit2(t)
    local unit handletarget = Powerbash_GetUnit(t)
    local real angle = Powerbash_GetAngle(t)
    local integer level = GetHandleInt(t,"level")
    local real movement = Move_Speed(handletarget)
    local location targetloc = GetUnitLoc(target)
    local location nextmove = PolarProjectionBJ(targetloc, movement, angle)
    local integer trees = 0
    local integer brake = GetHandleInt(t,"brake")
    if brake==1 then
        set movement = Move_Speed(handletarget)
        set movement = movement * Powerbash_Brakedegree(level)
        call SetHandleReal(handletarget,"movement",movement)
    endif
    set trees = CountDestructablesInCircle(targetloc, 150)
    call UnitDamageTargetBJ( caster, target, ( I2R(trees) * Powerbash_Treedamage(level) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNKNOWN )
    call EnumDestructablesInCircleBJ( 150.00, targetloc, function Tree_Killer )
    call UnitDamageTargetBJ( caster, target, Powerbash_Movementdamage(level), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNKNOWN )
    call DestroyEffect(AddSpellEffectByIdLoc(Powerbash_SpellId(), EFFECT_TYPE_SPECIAL, targetloc) )
    set nextmove = PolarProjectionBJ(targetloc, movement, angle)
    call SetUnitPositionLoc( target, nextmove )
    call RemoveLocation(targetloc)
    call RemoveLocation(nextmove)
    set t = null
    set target = null
    set targetloc = null
    set nextmove = null
    set caster = null
    set handletarget = null
    set trees = 0
endfunction

function Trig_Powerbash_Actions takes nothing returns nothing
    local unit target = GetSpellTargetUnit()
    local unit caster = GetTriggerUnit()
    local unit handletarget = GetSpellTargetUnit()
    local location a = GetUnitLoc(caster)
    local location b = GetUnitLoc(target)
    local real angle = AngleBetweenPoints(a, b)
    local timer t = CreateTimer()
    local integer level = GetUnitAbilityLevel(caster, GetSpellAbilityId() )
    local real movement = Powerbash_Movement(level)
    local integer brake = 0

    local trigger letsbowl = CreateTrigger()
    call TriggerRegisterUnitInRangeSimple( letsbowl, 90, target )
    call TriggerAddAction( letsbowl, function letsbowl_Actions )
    set udg_multifuncunit = target

    call RemoveLocation(b)
    call SetHandleHandle(t,"target",target)
    call SetHandleHandle(t,"caster",caster)
    call SetHandleReal(t,"angle", angle)
    call SetHandleInt(t,"level",level)
    call SetHandleReal(t,"movement",level)
    call SetHandleReal(handletarget,"movement",movement)
    call PauseUnitBJ( true, target )
    call SetUnitFacingTimed( target, angle, 1 )
    call UnitDamageTargetBJ( caster, target, Powerbash_Initialdamage(level), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNKNOWN )
    call TimerStart(t, 0.01, true, function Powerbash_Move)
    call PolledWait(Powerbash_Time(level))
    set brake = 1
    call SetHandleInt(t,"brake",brake)
    call PolledWait(Powerbash_Braketime(level))
    call PauseUnitBJ( false, target )
    call FlushHandleLocals(t)
    call FlushHandleLocals(handletarget)
    call DestroyTimer(t)
    call IssuePointOrderLoc( target, "patrol", a )    // This is good for creeps or AOS
    call RemoveLocation(a)                            // Spawnies. It makes "forgotten"
    set target = null                                 // Units behind trees impossible.
    set caster = null
    set a = null
    set b = null
    set t = null
    set handletarget = null

    call TriggerClearActions(letsbowl)
    call DestroyTrigger(letsbowl)
    set letsbowl = null

endfunction

//===========================================================================
function InitTrig_Powerbash takes nothing returns nothing
    set gg_trg_Powerbash = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Powerbash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Powerbash, Condition( function Trig_Powerbash_Conditions ) )
    call TriggerAddAction( gg_trg_Powerbash, function Trig_Powerbash_Actions )
endfunction

The following code is the custom script

Code:
function HandleToUnit takes handle h returns unit
    return h
endfunction

function HandleToInt takes handle h returns integer
    return h
    return 0
endfunction

function IntToHandle takes integer i returns handle
    return i
    return null
endfunction

//=============================================================================================
function LocalVars takes nothing returns gamecache
    return InitGameCache("jasslocalvars.w3v")
endfunction

function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(HandleToInt(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(HandleToInt(subject)), name, HandleToInt(value))
    endif
endfunction

function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(HandleToInt(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(HandleToInt(subject)), name, value)
    endif
endfunction

function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(HandleToInt(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(HandleToInt(subject)), name, value)
    endif
endfunction

function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(HandleToInt(subject)), name)
    return null
endfunction

function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(HandleToInt(subject)), name)
endfunction

function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(HandleToInt(subject)), name)
endfunction

function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(HandleToInt(subject)) )
endfunction

Is that what you require conan?
 

MooMooMan

New Member
Reaction score
3
holy.......

maybe you can get someone who knows JASS to translate that to non-gui form, then id be able to help u too.

betcha ANYTHING that theres an error in the script
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
Your using the Caster System no doubt, which uses the Attached variables, meaning you have a copy of the return bug.

In the second script, remove the IntTpHandle and HandleToInt functions.
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
Right......

Deleting Those functions from the custom script, multiplies the compile errors tenfold.

The darn author states in the original version.

Code:
//*********************************************************************************************
//*                                                                                           *
//*  Handle Variables                                                                         *
//*  (from Vexorians Copy Cat Map)                                                            *
//*                                                                                           *
//*********************************************************************************************

In case anyone decides to troubleshoot the same ability on their comp, I am using the "powerbash" ability from Wc3sear.ch.

Its just strange that it buggers other functions.

I think I get what ur saying conan... that perhaps it has doubled up?
(where's vex when he is needed? He may be able to provide some clues seeing as he is somewhat linked to all this.)
 

Rad

...
Reaction score
228
Well whats the ability do... Maybe I can give an alternate solution?
(within next hour or in 6+ hours)
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
Its basically a knockback ability, that also knocks aside units in the trajectory.

I searched a fair while for something like this, and short of making one (which I am dreading) or asking for one, its the only suitable one I could find.

I am afraid my talents dont lie in this area, and I am forced to rely on others
 

Rad

...
Reaction score
228
Knockback? Look at mems sliding tutorial... It should give you a general idea of how to accomplish this with GUI. Sure GUI isnt as good as JASS but JASS never works right :p

Just take the angle, set the unit in a group, turn on a .02 second trigger that pulls him a small amount (or percentage) towards a point... Yea should be easy.
 

Sargon

New Member
Reaction score
83
Rad said:
Knockback? Look at mems sliding tutorial... It should give you a general idea of how to accomplish this with GUI. Sure GUI isnt as good as JASS but JASS never works right :p

Only if you don't know what you're doing.
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
I did it not to long ago and I had no errors.

Check your PM box, I can help you further there.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top