HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Noob question =)

07-27-2009, 12:41 AM#1
T3RMINUS
Collapse JASS:
Hey, I was wondering what is wrong with this spell:
function Trig_Firey_Disciples_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A001'
endfunction

function Trig_Firey_Disciples_Actions takes nothing returns nothing
 local unit sf = gg_unit_n000_0013
 local unit f
 local group fd = GetUnitsInRectAll(gg_rct_fieryDisciples)
 local real x = GetUnitX(gg_unit_n000_0013)
 local real y = GetUnitY(gg_unit_n000_0013)
    call KillDestructable( gg_dest_DTg3_0628 )
    loop
        set f = FirstOfGroup(fd)
        exitwhen f == null
        call IssueTargetOrderById(f, 'A002', sf)
        call GroupRemoveUnit(fd, f)
    endloop
endfunction

//===========================================================================
function InitTrig_Firey_Disciples takes nothing returns nothing
    set gg_trg_Firey_Disciples = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Firey_Disciples, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Firey_Disciples, Condition( function Trig_Firey_Disciples_Conditions ) )
    call TriggerAddAction( gg_trg_Firey_Disciples, function Trig_Firey_Disciples_Actions )
endfunction
The gate dies, so i know its running, i just cant figure out why it won't tell the disciples to heal. I have the correct code and the spell is on the disciples.
07-27-2009, 12:54 AM#2
Deaod
Wrong OrderId. If possible, dont use the ById version. Instead, use the orderstring in the Object Editor.
07-27-2009, 01:09 AM#3
T3RMINUS
Uh, I believe its the correct one. Unless im putting the wrong thing there entirely.

Edit: I changed it to use orderstrings, and that doesnt work either.
07-27-2009, 02:08 AM#4
Mr_Saturn
He means you don't use an ability id there, an order id is something completely different. Use
Collapse JASS:
constant native OrderId takes string orderIdString returns integer

to find out what the order id is.
07-27-2009, 02:13 AM#5
T3RMINUS
I changed it to this:
call IssueTargetOrder(f, "heal", sf)
and it still doesn't work.
07-27-2009, 02:18 AM#6
Anitarf
I think you need to switch f and sf.
07-27-2009, 02:59 AM#7
Mr_Saturn
Collapse JASS:
function Trig_Firey_Disciples_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A001'
endfunction

function Trig_Firey_Disciples_Actions takes nothing returns nothing
 local unit sf = gg_unit_n000_0013
 local unit f
 local group fd = GetUnitsInRectAll(gg_rct_fieryDisciples)
 local real x = GetUnitX(gg_unit_n000_0013)
 local real y = GetUnitY(gg_unit_n000_0013)
    call KillDestructable( gg_dest_DTg3_0628 )
    call BJDebugMsg(GetUnitName(sf)+" cast whatever.")
    loop
        set f = FirstOfGroup(fd)
        exitwhen f == null
        if IssueTargetOrderById(f, 852063, sf) then
            call BJDebugMsg(GetUnitName(f)+" successfully ordered.")
        else
            call BJDebugMsg(GetUnitName(f)+" failed.")
        endif
        call GroupRemoveUnit(fd, f)
    endloop
endfunction

//===========================================================================
function InitTrig_Firey_Disciples takes nothing returns nothing
    set gg_trg_Firey_Disciples = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Firey_Disciples, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Firey_Disciples, Condition( function Trig_Firey_Disciples_Conditions ) )
    call TriggerAddAction( gg_trg_Firey_Disciples, function Trig_Firey_Disciples_Actions )
endfunction
I threw a few messages in there, look at what they print out. Make sure that group actually has units in it and that those units have the heal-based ability and sufficient mana to cast it. Make sure the caster is a valid target for that ability.

If your script isn't doing what it's supposed to then throw debug messages at the problem until you know exactly what it is doing, then you can figure out why it's doing it.
07-27-2009, 03:28 AM#8
T3RMINUS
switching f and sf worked to fix one problem, but it doesn't seem to pick up the units in the region. i have the region in the right place, and its covering all 4 units.

I'm guessing it's something wrong with this:
local group fd = GetUnitsInRectAll(gg_rct_fieryDisciples)
07-27-2009, 03:31 AM#9
Mr_Saturn
Do those units have Locust?
07-27-2009, 03:54 AM#10
T3RMINUS
nope.

Edit: Tested a few more times, and found out it IS putting it into the group. For some reason it wont tell them to heal. I suppose i will give you a copy of my map and you can check it.
CotE.w3x
Attached Files
File type: w3xCotE.w3x (110.7 KB)
07-27-2009, 06:04 AM#11
Pyrogasm
Did you try it with IssueTargetOrder(f, "heal", sf)?
07-27-2009, 09:01 AM#12
Mr_Saturn
Quote:
Originally Posted by Yo
sufficient mana to cast it
Your original script was fine. The mana cost of your heal ability is 5, but those units have a maximum mana of 0.
07-28-2009, 03:41 AM#13
T3RMINUS
Lol. Knew it would be something simple. Thank you, and it is odd that they dont have mana because I based them off of a priest .
Edit: It STILL fails. I made the spell cost 0 mana.
Edit 2: Pyro was right, had to switch f and sf back. Thats all i need, thanks guys!
07-28-2009, 06:46 AM#14
Pyrogasm
That was actually Anitarf who said that. But meh.