• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Quick question about Jass.

Status
Not open for further replies.
Level 11
Joined
Oct 11, 2012
Messages
711
Hey guys, I want to make a war stomp type ability. When the hero cast warstomp, there will be dummies randomly casting warstomp within a certain range of the hero. I used the following Jass codes, but did not work and I don't know why. Please help, thanks a lot.

Is it something wrong with the dummies locations?

JASS:
function Trig_tianbengdl_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A233')
endfunction

function Trig_tianbengdl_Actions takes nothing returns nothing
  local integer tbdl=0
  set udg_LsJndian=GetUnitLoc(GetTriggerUnit())
  set udg_JSDian=PolarProjectionBJ(udg_LsJndian,400.,GetRandomReal(0,360))
  set tbdl=0
  loop
    exitwhen  (tbdl>8)
    call CreateNUnitsAtLoc(1,'n01J',GetOwningPlayer(GetTriggerUnit()),udg_JSDian,bj_UNIT_FACING)
    call IssueImmediateOrderById (bj_lastCreatedUnit,852127)
    call RemoveLocation(udg_JSDian)
    call RemoveLocation(udg_LsJndian)
    set tbdl=tbdl+1
  endloop
endfunction

function InitTrig_tianbengdl takes nothing returns nothing
  set gg_trg_tianbengdl=CreateTrigger()
  call DisableTrigger(gg_trg_tianbengdl)
  call TriggerRegisterPlayerUnitEventSimple(gg_trg_tianbengdl,gg_unit_ABCD_0247,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_tianbengdl,Condition(function Trig_tianbengdl_Conditions))
  call TriggerAddAction(gg_trg_tianbengdl,function Trig_tianbengdl_Actions)
endfunction
 
Level 11
Joined
Oct 11, 2012
Messages
711
Don't use locations in jass use x and y real values.
See all the red text those r BJs u need to inline them to get rid of them. There is an inlining tutorial on the hive u should look it up.

@gorillabull
That is a poor answer. Every had to learn at some point

Thank you for the advice. I have made some modification about my code, if you have time, would you please look over it again? I know its poorly coded, just want to know if there is any syntax error.
I am looking for a tutorial now. :)
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
JASS:
call DisableTrigger(gg_trg_tianbengdl)
If nothing is happening, this is most likely the culprit since you disabled the trigger.

There are also problems with the way you set the locations; you need to set udg_JSDian continuously in the loop. You should only remove udg_LsJndian after the loop.
Of course, you're better off using coordinates as
deathismyfriend mentioned, and it's not that hard to do.
 
Level 11
Joined
Oct 11, 2012
Messages
711
JASS:
call DisableTrigger(gg_trg_tianbengdl)
If nothing is happening, this is most likely the culprit since you disabled the trigger.

There are also problems with the way you set the locations; you need to set udg_JSDian continuously in the loop. You should only remove udg_LsJndian after the loop.
Of course, you're better off using coordinates as
deathismyfriend mentioned, and it's not that hard to do.

Thanks a lot.
+Rep
 
Status
Not open for further replies.
Top