just another JASS spell problem

xenaris

New Member
Reaction score
2
hi guys,
I recently learned JASS but im not really good at it yet. :eek:
Tried to make a ShockNova spell but it doesn't work :( (btw i can make it in GUI)

JASS:
function Trig_NewTrigger_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Trig_NewTrigger_Actions takes nothing returns nothing
    local real circle
    loop
        set circle = circle + 36
        call CreateNUnitsAtLoc( 1, 'h000', Player(0), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
        call IssuePointOrderLocBJ( GetLastCreatedUnit(), "shockwave", PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()), 256, circle) )
        call TriggerSleepAction (0.10)
        exitwhen circle == 360
    endloop
endfunction

function InitTrig_NewTrigger takes nothing returns nothing
    local trigger gg_trg_NewTrigger
    set gg_trg_NewTrigger = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_NewTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(gg_trg_NewTrigger, Condition(function Trig_NewTrigger_Conditions))
    call TriggerAddAction(gg_trg_NewTrigger, function Trig_NewTrigger_Actions)
endfunction


Anyone knows what's wrong?
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Oh no, pseudo-locals.
JASS:

function InitTrig_NewTrigger takes nothing returns nothing
    local trigger gg_trg_NewTrigger
    set gg_trg_NewTrigger = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_NewTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(gg_trg_NewTrigger, Condition(function Trig_NewTrigger_Conditions))
    call TriggerAddAction(gg_trg_NewTrigger, function Trig_NewTrigger_Actions)
endfunction

JASS:

function InitTrig_NewTrigger takes nothing returns nothing
    local trigger NewTrigger = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( NewTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(NewTrigger, Condition(function Trig_NewTrigger_Conditions))
    call TriggerAddAction(NewTrigger, function Trig_NewTrigger_Actions)
endfunction
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
Also, I would suggest putting a decimal point, '.', after the real values.
Otherwise they are takes as I2R I believe. Which can get dodgy if your doing math functions.
 

Flare

Stops copies me!
Reaction score
662
Also, I would suggest putting a decimal point, '.', after the real values.
Otherwise they are takes as I2R I believe. Which can get dodgy if your doing math functions.

He's only doing addition, so it doesn't matter. And they wouldn't be taken as I2R, but R2I (since I2R would imply that the value was a real, whereas R2I would imply that it was an integer which would cause problems with real division)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top