HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help Please: New Problem

08-19-2008, 08:13 PM#1
pankake
I am trying to make a spell which takes all units withen an aoe of the caster and records how much damage they have taken, and when they have taken a certain amount, something happens.

What would be the best way to do this? If you help, can you show me with a short example please.
08-19-2008, 08:21 PM#2
Themerion
Collapse JASS:
call IssueTargetOrderById(c,ConstrictingSpores_SporeSpellId(),ou)

// You don't have to use "ById".
// If you do it by order string, it's easier.

constant function ConstrictingSpores_EntangleOrder takes nothing returns string
    return "entanglingroots"
endfunction


call IssueTargetOrder(c,ConstrictingSpores_EntangleOrder(),ou)

Also, why local gamecache gc = udg_AbilitiesCache . You're not using it.
08-19-2008, 08:29 PM#3
Here-b-Trollz
ById is fine, but you are using the wrong id. SpellId != OrderId. So, you need a new function ConstrictingSpores_OrderId:

Collapse JASS:
constant function ConstrictingSpores_OrderId takes nothing returns integer
    return OrderId("entanglingroots")
endfunction
08-19-2008, 09:04 PM#4
Rising_Dusk
Or just use 852171. :)
08-19-2008, 09:15 PM#5
Themerion
Quote:
Originally Posted by Here-be-Trollz
ById is fine, but you are using the wrong id. SpellId != OrderId. So, you need a new function ConstrictingSpores_OrderId:
Collapse JASS:
constant function ConstrictingSpores_OrderId takes nothing returns integer
    return OrderId("entanglingroots")
endfunction

Uh... but why complicate the code more than necessary? Using order strings will be shorter (and more effective I assume, since you let Warcraft's C++ made functions do the call to OrderId instead).

Shorter by: "OrderId(" + ")" + "ById" + "Id"

Quote:
Originally Posted by Rising_Dusk
Or just use 852171. :)

Or not.
08-19-2008, 09:30 PM#6
Here-b-Trollz
Quote:
Originally Posted by Rising_Dusk
Or just use 852171. :)

I assumed someone would have the time to use Blade's order converted thingy or just write BJDebugMsg(I2S(OrderId("entanglingroots"))) and then press ctrl+F9. Sadly I'm not able to do that at this time. So... thank you for being that someone.

...

OrderId's are faster than OrderStrings.
08-19-2008, 09:37 PM#7
Themerion
Quote:
Originally Posted by Here-be-trollz
OrderId's are faster than OrderStrings.

To use the actual id is faster, but much less convenient.

I doubt that UnitIssueOrderById(OrderId(STRING)) is faster than UnitIssueOrder(STRING).
08-19-2008, 09:45 PM#8
Here-b-Trollz
Collapse Why vJass Pwns:
globals
    private constant integer xOrderId = OrderId("entanglingroots")
endglobals
Expand ...or this:
08-21-2008, 03:07 AM#9
pankake
I have a new question now
08-21-2008, 06:50 AM#10
Pyrogasm
As for your new question, you're going to need a few dynamic triggers and stuff. Yeah, that's a bit complicated, but I suppose I could whip up an example for you within the next day....