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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top