• 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.

[JASS] Need spell help

Status
Not open for further replies.
Level 1
Joined
Nov 20, 2010
Messages
5
So yeah, I'm new to JASS and tried making my own spell from the JASS tutorial by wyrmlord ( Beginning JASS Tutorial Series - wyrmlord). There's only one trigger and I think it's a very simple spell. Hope you can help and tell me whats wrong.

JASS:
function Burning_Soul_Conditions takes nothing returns boolean
 return GetSpellAbilityId == 'ABSS'
endfunction

function Burning_Soul_Actions takes nothing returns nothing
  local unit Caster
  local integer i_1
  local location Temp_Loc_1
  local location Temp_Loc_2
  local location Temp_Loc_3
  local unit Effect_1
  local unit Effect_2

  set Caster = GetSpellAbilityUnit()
  set Temp_Loc_1 = GetSpellTargetLoc()
  set Temp_Loc_2 = PolarProjectionBJ(Temp_Loc_1, 300.00, 0.00)
  set Temp_Loc_3 = PolarProjectionBJ(Temp_Loc_1, 300.00, 180.00)
  set Effect_1 = CreateUnitAtLoc(GetOwningPlayer(Caster), 'hBSS', Temp_Loc_2, 0.00)
  set Effect_2 = CreateUnitAtLoc(GetOwningPlayer(Caster), 'hBSS', Temp_Loc_3, 0.00)
  loop
   exitwhen i_1 == 36
    set Temp_Loc_2 = PolarProjectionBJ(Temp_Loc_1, 300.00, (0.00 - (10.00 * i_1)))
    set Temp_Loc_3 = PolarProjectionBJ(Temp_Loc_1, 300.00, (180.00 - (10.00 * i_1)))
    call SetUnitPositionLoc(Effect_1, Temp_Loc_2)
    call SetUnitPositionLoc(Effect_2, Temp_Loc_3)
    call RemoveLocation(Temp_Loc_2)
    call RemoveLocation(Temp_Loc_3)
    set i_1 = i_1 + 1
  endloop
  call KillUnit(Effect_1)
  call KillUnit(Effect_2)
  set Caster = null
  set Effect_1 = null
  set Effect_2 = null
endfunction

function Init_Trigger_Burning_Soul takes nothing returns nothing
  local trigger gg_trg_Burning_Soul
  local integer i
  set i = 0
  loop
   exitwhen i == 15
    call TriggerRegisterPlayerUnitEvent(gg_trg_Burning_Soul, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
    set i = i + 1
  endloop
  call TriggerAddCondition(gg_trg_Burning_Soul, Condition(function Burning_Soul_Conditions))
  call TriggerAddAction(gg_trg_Burning_Soul, function Burning_Soul_Actions
endfunction
//--'hBSS' is the dummy unit which has Immolate(Passive) and deals damage
//--'ABSS' is the spell based on standard wc3 shockwave
//-- What the spell does (or should do) is to create 2 flames (dummy units) and rotate them around the target point.

Please help :goblin_good_job:
 
Last edited:
Level 1
Joined
Nov 20, 2010
Messages
5
Ehrm, ok, but my problem is that the unit doesn't even cast the spell and I don't think this is caused by the TriggerSleepActions (thanks anyways :D). When I try to cast the spell it just does... nothing. I've tried it with that before and I'm gonna remove the TriggerSleepActions.

Edit: "I've tried it with that before" = " I've tried to do it without the TriggerSleepActions and wanted to see if they did anything."
 
Level 1
Joined
Nov 20, 2010
Messages
5
K thanks I'll try that and post again after that... about the GetOwningPlayer, seems like i forgot that in here, sry, will edit it now.

Edit: So, yeah, I editted the code above which was wrong and tried using the method with call BJDebugMsg("Debug") and put it to the beginning of the trigger. It did not do anything, and I checked the ID's of the ability and the dummy unit, it did not change anything. Could it be the base ability or could you give me an example of which ability to use as base ability?

Edit2: I also tried changing the event to one player, didn't change anything. Also, thanks for being so patient ;)
 
Last edited:
Level 14
Joined
Nov 18, 2007
Messages
1,084
You never create the trigger.
Do this:
JASS:
local trigger gg_trg_Burning_Soul = CreateTrigger()
You should note that gg_trg_Burning_Soul is a global variable though so it's kind of pointless to make it local.

In fact, it might be better for you to just make the trigger variable local.
JASS:
local trigger t = CreateTrigger() // Replace all instances of gg_trg_Burning_Soul with t

Some other things:

  • Use GetTriggerUnit instead of GetSpellAbilityUnit
  • You can set a local variable in the same line you declare them. Example:
    JASS:
    local unit Caster = GetTriggerUnit()
  • Use coordinates instead of locations. Ex: GetSpellTargetX/Y over GetSpellTargetLoc
 
Level 1
Joined
Nov 20, 2010
Messages
5
Could it be just the fact that all the actions are instant and cannot be seen because they happen too fast? I've seen that in another thread...

Edit: Anyways, +rep for the two of you.
 
Last edited:
Status
Not open for further replies.
Top