| 01-22-2009, 08:18 PM | #1 |
Hi guys, I was wondering, is it possible to code an auto-cast ability? I really don't get how it could ever be possible to code that "right-click" and "glow thing around the icon" with just using vJASS. If some one has ideas or suggestions they are welcome. |
| 01-22-2009, 08:24 PM | #2 |
Wait, what exactly are you trying to do? You want to detect when autocast has been enabled/disabled, or...? If it's an attack modifier autocast, you could use a damage detection system and use Poison Arrows/Cold Arrows (or some other autocast attack mod that applies a buff), then check for the buff on damage - if the buff is present, remove the buff (to avoid falsely triggering the effects from another hit) and do your actions accordingly |
| 01-22-2009, 08:26 PM | #3 | |
Quote:
|
| 01-22-2009, 08:34 PM | #4 |
JASS:function Meh takes nothing returns nothing if GetIssuedOrderId () == OrderId ("flamingarrows") then call BJDebugMsg ("Searing Arrows - autocast enabled") elseif GetIssuedOrderId () == OrderId ("unflamingarrows") then call BJDebugMsg ("Searing Arrows - autocast disabled") endif endfunction //=========================================================================== function MehAgain takes nothing returns nothing local trigger t = CreateTrigger () call TriggerRegisterAnyUnitEventBJ (t, EVENT_PLAYER_UNIT_ISSUED_ORDER) call TriggerAddAction (t, function Meh) endfunction ![]() Object Editor should have all the Turn On/Off order strings for autocast abilities, Searing Arrows is the only one I remember :) |
| 01-22-2009, 09:06 PM | #5 |
I will test this asap! Maybe, If I make a system with Table I can create my own auto-cast abilities. Thx for help! EDIT EDIT EDIT It works !!!! Now should I create a system for this? Like I have in mind: - When a unit is created, if it is a special unit with some kind of special ability, I add it to table, and some sort of boolean value (isAutoOn) equal to false - When the user changes that value, I change the boolean respective to the unit - When some one is attack (per example, like slow) if the boolean value for that unit in "true" I make it autocast the spell (I order it to cast it) else I do nothing Do you guys think this is a good idea ? |
| 01-22-2009, 09:12 PM | #6 | |
Quote:
me personally no.. i think we dont need a system for such a special case ...i would not use a system ...for maybe 2-3 triggered autocast abilities in a map ...where 2-3 of them would not even require such a thing... |
| 01-22-2009, 09:17 PM | #7 | |
Quote:
Yet, ignoring personal opinions, what do you think of my algorithm, would it be good? |
| 01-22-2009, 10:00 PM | #8 |
you dont need such an algorithm AT ALL can all be done with a timer which checks if there are conditions for cast (when autocast is enabled) |
| 01-23-2009, 02:30 AM | #9 |
If you are making your triggered effects functions of casting the spell (spellcast-->triggered effects), then you need not make a system. Because the units will cast the spells automatically if the spell is auto-casted and (recall spellcast-->triggered effects *SPELLCAST*) you only need to detect when the spell is casted to apply the triggered effects. edit: Further, the system you are conceiving functions to simulate auto-casting... but it operates on as a function of auto-casting events... so you are making a system that simulates auto-casting when auto-casting occurs... seems like a redundant iteration of 'auto-casting'. ..and the system has no motivation since its function is already accommodated naturally - and, in fact, like said above, the system relies on this. doesnt seem to be any sense in making a system. |
| 01-23-2009, 09:15 AM | #10 | |
Quote:
|
| 01-23-2009, 10:36 AM | #11 |
But the purpose for which you will do that detection is to simulate auto-casting: by triggered-casting the spells when auto-cast is enabled. - but this is already how auto-cast works... when it is enabled, it automatically-casts the spell... |
| 01-23-2009, 11:23 AM | #12 | |
Quote:
|
| 01-23-2009, 12:23 PM | #13 |
You're not controlling it, though, the unit will still cast the autocast spell automatically regardless of what your code does. |
| 01-23-2009, 12:40 PM | #14 | |
Quote:
|
| 01-23-2009, 12:54 PM | #15 | |
Quote:
|
