Need help with expected errors


New Member
JassCraft says the syntax is fine but when trying to enable it in WE Trigger file i made called main it gives me expected errors up and down.

    unit udg_Kisame=null
    location udg_point=null
    group udg_group=null
    effect udg_Effect=null
    soundtype udg_Effect2=null
    unit udg_Target=null
    unit udg_Kakashi=null
    trigger gg_trg_Main=null
    trigger gg_trg_Untitled_Trigger_001 = null
    location tp1=null
    location tp2=null
    location tp3=null
    trigger udg_trigger_raikiri=null
    unit udg_unit01=null
    group tg=null
    real dx=0
function InitGlobals takes nothing returns nothing
    local integer i = 0
    set udg_group = CreateGroup()
    function Trig_Main_Actions takes nothing returns nothing
        call DisplayTextToForce( GetPlayersAll(), "NAruto Test Map" )
function Trig_raikiri_Conditions takes nothing returns boolean // the condition, that spell cast=raikiri
    return (GetSpellAbilityId()=='A001')
function trigenemy takes nothing returns boolean //a condition to determine which types of units are targeted, invoked later in trigger
    return IsUnitAliveBJ(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())) //chooses only living enemies as targets, can be expanded to disallow buildings or heroes, etc.
function raikiri_dam takes nothing returns nothing // damage section of spell
    call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),dx,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC) // target damage use triggerunit to do damage, the chaos type tends to make it "pure" aka not affected by armor type
    set tp2=GetUnitLoc(GetEnumUnit()) //get location of unit, has to be defined beforehand to avoid causing leaks
    call AddSpecialEffectLocBJ(tp2,"Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl") //makes the effect at location of unit
    call DestroyEffect(GetLastCreatedEffectBJ()) //stop effect
    call RemoveLocation (tp2) //cleans up the location once not needed anymore
function Trig_raikiri_Actions takes nothing returns nothing
    local unit u=GetTriggerUnit() //trigger unit, because "u" is easier to type later on then "GetTriggerUnit()"
    set udg_unit01=GetSpellTargetUnit() // unit that is targeted by spell
    set tp1=GetUnitLoc(udg_unit01) //get location
    set tp3=PolarProjectionBJ(tp1,80.00,GetUnitFacing(u)) //actually this defines the spot to which the unit will be moved, to be about arm's length from enemy
    call SetUnitPositionLocFacingLocBJ(GetTriggerUnit(),tp3,tp1) // move to tp3, a spot next to enemy and face tp1 - the spot enemy is standing
    call RemoveLocation (tp3) //remove location since not needed anymore
    set dx=I2R((GetHeroStatBJ(bj_HEROSTAT_AGI,u,true)+50)*(GetUnitAbilityLevel(u,'A001'))) // formula for dmg, I define it here to avoid having to calculate when damaging every enemy in range
    set tg=GetUnitsInRangeOfLocMatching(300,tp1,Condition(function trigenemy)) //creates unit group to be his, based on range 300 from spot cast (tp1) and matching the condition trigenemy (written higher up in trigger)
    call ForGroupBJ(tg,function raikiri_dam) // execute dmg
    call DestroyGroup (tg) //gets rid of the group once not needed, trigger would function even without this line but as the leak builds up it would eventually contribute to lag
    call RemoveLocation (tp1) // location not needed anymore
function InitTrig_Main takes nothing returns nothing
    set gg_trg_Main = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Main, function Trig_Main_Actions )
General chit-chat
Help Users
  • No one is chatting at the moment.
  • tom_mai78101 tom_mai78101:
    Make sure you keep checking out my news..
  • Jesus4Lyf Jesus4Lyf:
    Man, I made this account 15 years ago? Wild. :)
  • Ghan Ghan:
    Seeing J4L is definitely a blast from the past.
  • Jesus4Lyf Jesus4Lyf:
    Oh hey Ghan! Long time. :)
  • jonas jonas:
    J4L! What has happened in your life
  • Jesus4Lyf Jesus4Lyf:
    Hmm, how to summarize... Moved to the USA and got married. Became a professional software engineer and solution lead. Learning Godot for game dev. :)
  • jonas jonas:
    So you are pursuing game dev as a hobby? What industry is your dayjob in?
  • jonas jonas:
  • Jesus4Lyf Jesus4Lyf:
    Not quite FAANG, less pay for a less hours/stress. Yeah, game dev as a hobby.
  • jonas jonas:
    makes sense. Do we have a hobby game dev subforum to showcase some work?
  • Blackveiled Blackveiled:
    Happy Thursday
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
  • The Helper The Helper:
    hey tom_mai please do not archive anymore news
  • Ghan Ghan:
    AMD Ryzen 7000 next week :D
  • The Helper The Helper:
  • tom_mai78101 tom_mai78101:
    "hey tom_mai please do not archive anymore news" ----> Got it. What should we do with the "News Archive" subforum?
  • The Helper The Helper:
    I think leave it for real old news that cannot be sorted the reason we had it in the first place was a server issue that we do not have anymore. I don't want to get rid of the archive just not put anything in it for now until we figure it out more
  • The Helper The Helper:
    The side chat has nothing on the discord. it is not possible but the biggest thing on my wish list right now is a sidechat channel on the disord that hooks up to this...
  • Ghan Ghan:
    I've been selected for the Diablo IV beta.
  • Ghan Ghan:
  • The Helper The Helper:
    that is so cool
    Eh just noticed the new discord section on the side. Looks great!
  • Blackveiled Blackveiled:
    :( feels bad I can't ever get selected for any beta I sign up for. It's annoying as heck.

    The Helper Discord

    Members online

    No members online now.


    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.