| 08-19-2008, 08:13 PM | #1 |
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 |
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 |
ById is fine, but you are using the wrong id. SpellId != OrderId. So, you need a new function ConstrictingSpores_OrderId: JASS:constant function ConstrictingSpores_OrderId takes nothing returns integer return OrderId("entanglingroots") endfunction |
| 08-19-2008, 09:04 PM | #4 |
Or just use 852171. :) |
| 08-19-2008, 09:15 PM | #5 | ||
Quote:
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:
Or not. |
| 08-19-2008, 09:30 PM | #6 | |
Quote:
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 | |
Quote:
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 |
Why vJass Pwns:globals private constant integer xOrderId = OrderId("entanglingroots") endglobals ...or this:globals private constant string xOrderString = "entanglingroots" //End User Config Section private integer xOrderId endglobals set xOrderId=OrderId(xOrderString) |
| 08-21-2008, 03:07 AM | #9 |
I have a new question now |
| 08-21-2008, 06:50 AM | #10 |
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.... |
