![]() |
#16 |
Procrastination Incarnate
Development Director
|
![]() Updated. The script now doesn't create a location on widget targetting spell casts.
__________________I haven't quite decided on the user syntax yet, the current script includes two versions, GetAbilityId() and GetSpell.AbilityId(), another possibility would be SpellEvent.AbilityId. I'd like to decide on one of them and delete the rest before this gets approved. Opinions? |
![]() |
![]() |
Sponsored Links - Login to hide this ad! |
|
![]() |
#17 |
requires vJass
Code Moderator
|
![]() Last one.
|
![]() |
![]() |
![]() |
#19 | |||
Procrastination Incarnate
Development Director
|
![]() Quote:
Quote:
Quote:
So, I've decided to make the UI work either like this: local unit c = SpellEvent.CastingUnit or like this: public function interface Response takes integer abilityId, unit castingUnit, unit targetUnit, destructable targetDest, item targetItem, real targetX, real targetY returns nothing I don't think anyone will like the latter, so I'll just write the former. |
|||
![]() |
![]() |
![]() |
#21 | ||
Procrastination Incarnate
Development Director
|
![]() Quote:
Well, based on my testing there is no way for a unit to start casting a new spell without first stopping the casting of the previous spell, so the safety check in the EndCast function is not needed and will be removed in the next version. Edit: Quote:
Edit 2: Well, I just realised I can't make static method operators so I guess I'll need to come up with a different UI. Last edited by Anitarf : 05-11-2009 at 02:44 PM. |
||
![]() |
![]() |
![]() |
#22 |
Procrastination Incarnate
Development Director
|
![]() Updated, I managed to get the syntax I wanted although it required some tweaking to maintain proper encapsulation. The user could in theory still call .destroy on the struct since I can't make that method private but the system can survive that, the user would eventually get an error message about trying to destroy a null struct.
__________________I realize now I forgot to add the method operator for TargetLoc, gotta run now so I'll fix that later. |
![]() |
![]() |
![]() |
#23 | |
Procrastination Incarnate
Development Director
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#24 |
User
Join Date: Feb 2009
Posts: 185
![]() |
![]() > SpellEvent.CastingUnit
Is there any way this could become TriggerUnit? I think most people don't usually use GetCastingUnit() and it's going to be a bit hard with all those switches between names. |
![]() |
![]() |
![]() |
#25 |
Procrastination Incarnate
Development Director
|
![]() Casting unit is more descriptive, though. And what switches between names, all event responses are copies of natives with "GetSpell" replaced with "SpellEvent." (minus those responses that are new), so there's only one switch.
__________________ |
![]() |
![]() |
![]() |
#26 |
User
Join Date: Jan 2007
Posts: 195
![]() ![]() ![]() |
![]() I use pretty much the same concept for registering for events for abilities. Just want to quickly add that you also have access to the OrderID of the casting unit at some stages (not all) which is very handy in some circumstances.
__________________I dunno, it allows me to say when a unit casts a spell and some conditions exist, create a dummy unit, add the ability to the dummy unit, set the level of the ability to that of the casting unit, and order the dummy unit to (orderid) the target again, or the x/y coords again, or the item again, or "immediately", or at a random unit within 300 of target, etc, etc, etc. Ability Level may also be useful, as the level when casted may not be the level 1 second later. Also, any reason the EVENT_PLAYER_UNIT_SPELL_CHANNEL event is unsupported? Thirdly, why set a global variable to the current spell event when you can pass the spell event to the Response function? |
![]() |
![]() |
![]() |
#27 |
Procrastination Incarnate
Development Director
|
![]() Spell level and orderid are useful information, I'll look into including them in the event responses. The level itself might not be as useful since if it's a channeling spell (which is the only case I can think of where you could increase the level before the spell finishes) you will likely create a struct when the channeling starts anyway and you can store the level there, but since it's the kind of event response function that will likely get called anyway there's no loss of performance if it's included.
__________________In my experience, EVENT_PLAYER_UNIT_SPELL_CHANNEL doesn't do anything special, it just seems to run after the cast event for all spells. If there is some significant difference, I might include it. I use a global variable instead of passing it as a parameter because it simplifies the function interface somewhat ("takes nothing returns nothing" is easier to remember) and you don't have to pass the struct to any functions you call. |
![]() |
![]() |
![]() |
#28 | |
Free Software Terrorist
Technical Director
|
![]() channel IS useless. Effect is better there.
__________________Quote:
but well, it has been in the submit forum for enough time approved... |
|
![]() |
![]() |
![]() |
#29 |
Procrastination Incarnate
Development Director
|
![]() Alright, I fixed a minor bug that could cause a unit-target spell to keep the TargetDestructable value from a previously cast destructable-target spell.
__________________Also, I did a small tweak to facilitate spell transmutation, check out the second usage example for more information. |
![]() |
![]() |
![]() |
#30 |
User
Join Date: Feb 2009
Posts: 203
![]() ![]() |
![]() Doesnt _CHANNEL trigger before casting time? I have used it to change units casting animation in some cases.
__________________( Dont know if _CAST does the same thing, but I was under impression that _CHANNEL triggers before _CAST ) |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
|