|
|
#46 | |
|
User
Join Date: Mar 2009
Posts: 149
![]()
|
Quote:
So you use xedamage for every instance of spell damage just like IDDS uses its DamageTargetEx function? I tried the same, but I was not able to check, if the current damage instance was caused by xedamage or an attack in the onDamageTaken method. Last edited by Kueken : 01-29-2010 at 12:17 AM. |
|
|
|
|
| Sponsored Links - Login to hide this ad! |
|
|
|
|
#47 |
|
Procrastination Incarnate
Development Director
|
There is the xedamage.isInUse() static method, read the xedamage documentation.
__________________ |
|
|
|
|
|
#48 |
|
User
Join Date: Mar 2009
Posts: 149
![]()
|
I did read it and I did use the method and it did not work. However, I must have made a mistake, I tried it again and now it works properly.
|
|
|
|
|
|
#49 |
|
User
|
Just a question, which is faster when detecting damage from auto-cast arrow abilities (cold arrows, poison arrows etc.): damage detection or buff placement?
__________________The hardest spell for me is to create a triggered auto-cast arrow ability, because it requires damage detection, I'm just planning to achieve this effect by using this system, like all I need to do is detect if the damaged unit has the buff then do the effect and remove buff to avoid conflicts with other damage. |
|
|
|
|
|
#50 | |
|
Procrastination Incarnate
Development Director
|
Quote:
|
|
|
|
|
|
|
#51 |
|
User
|
Ive had some issues with xecasts dealing damage. AutoIndex complained that xe dummy units are not indexed.
__________________Replacing DamageModifier.Evaluate with this fixed the problem. JASS:static method Evaluate takes unit damaged, unit damager, real damage returns real // Loops through all the modifiers involved in a damage event and // returns the total amount by which the damage must be modified. // Positive values meaning a damage increase and negative a damage decrease. local real modifier=0.0 local DamageModifier this=0 local DamageModifier that=0 if IsUnitIndexed(damager) then set this=DamageModifier(DamageModifier.first[GetUnitId(damager)]) endif if IsUnitIndexed(damaged) then set that=DamageModifier(DamageModifier.first[GetUnitId(damaged)]) endif loop exitwhen this==0 and that==0 if this!=0 and (that==0 or this.priority>=that.priority) then set modifier=modifier+this.onDamageDealt(damaged, damage+modifier) set this=this.next elseif that !=0 then set modifier=modifier+that.onDamageTaken(damager, damage+modifier) set that=that.next endif endloop return modifier endmethod |
|
|
|
|
|
#52 |
|
Procrastination Incarnate
Development Director
|
Thanks for the report. I have added some other changes to the AutoIndex version of DamageModifiers that allow it to fully avoid problems with unindexed units. Note that for this reason, damage modifiers can no longer be added to such units and when such units are dealt damage (which shouldn't really happen) damage modifiers will not be evaluated.
__________________ |
|
|
|
|
|
#53 |
|
User
Join Date: Mar 2009
Posts: 149
![]()
|
When I use DamageModifiers I usually need access to the unit of the struct. Am I doing something wrong, or do I have no access to the unit from within an extended struct?
If this is the case, I suggest adding a readonly version of the unit (or maybe an operator) to the DamageModifier struct; right now I have to save the unit a 2nd time within the struct to have access to it. |
|
|
|
|
|
#54 |
|
User
Join Date: Mar 2010
Posts: 5
|
In maps with heavy unit spawn(ex. dota type) this system will eventually leak.
The problem is that you do not recycle Response array, even though Damage Event trigger is destroyed periodically. The 8190 instance limit will be reached approximatively after 1 hour 32 min. Last edited by gamma_T : 03-24-2010 at 03:43 PM. |
|
|
|
|
|
#55 | |
|
I blink, therefore I am.
Join Date: Sep 2006
Posts: 1,812
![]() ![]() ![]()
|
Quote:
I hate to break it to you, but you obviously don't know how to use this system. A unique unit does not need a unique response function... Each system that needs damage detection may use a response function, but even with 1000 systems that do damage shit (which is quite a bit), you arn't even close to 8190. |
|
|
|
|
|
|
#56 |
|
User
Join Date: Mar 2010
Posts: 5
|
I clearly understand how this system works. But you didn't get my point either. What I am talking about is that each time the Damage Event fired, this system will go through all response functions, including those which are not used anymore, since unit with an ability required that response is killed/removed/lost the ability.
Well, now imagine this: I spawn 6 creep waves with unique ability every 20sec of the game time. Such group consists of 3 unique unit types. So, basically I need to create 6 response functions every 20sec. So, its 18 functions per minute or 18*60=1080 response functions per 1 game hour. And, yeah, you won't probably notice a lag in a simple map like attached above, but in serious multi-player map I am sure you will. If this system would have recycling mechanism for response functions, then I could have only 20-40 responses constantly during the game, which makes this system absolutely prefect for Damage Detection. |
|
|
|
|
|
#57 | ||
|
In Flames
Join Date: Jan 2006
Posts: 1,153
|
Quote:
Quote:
You will need 1 response function per system or custom spell, NOT per unit. if you have 100 custom spells/orbs in your map which require damage detection THEN you might need 100 respons functions. And normally, you setup ALL response functions at the beginning of the game, you normally wont need to register responsefunctions during the game. Last edited by akolyt0r : 03-25-2010 at 04:44 PM. |
||
|
|
|
|
|
#58 | |
|
Procrastination Incarnate
Development Director
|
Quote:
If you want a unit-specific damage event response, try using Damage Modifiers, which you can easily destroy when a unit dies. Last edited by Anitarf : 03-25-2010 at 10:06 PM. |
|
|
|
|
|
|
#59 | |
|
User
Join Date: Feb 2006
Posts: 188
|
NOTE: You have been redirected in order for our attachments to be made available to you. This will only last two minutes; these measures where taken to avoid hotlinking and bandwidth theft. To avoid these restrictions Log in or Register In your system 1.5 under "Samples" / "PriestInnerFire"...
Ah wait, I will post this trigger first. JASS:// This is a simple piece of code that makes a unit-target buff spell, in // this case the Priest's Inner Fire, count as an aBuff. // You can simply copy this "trigger", rename the scope, edit the // calibration section with new values and you have it working for // another spell. // This ability uses the following libraries: // - library ABuff // - library SpellEvent // - library IsUnitSpellResistant scope PriestInnerFire initializer Init // CALIBRATION SECTION globals private constant integer BUFF = 'Binf' //the buff bestowed upon the unit by the spell private constant integer SPELL = 'Ainf' //the spell that applies the buff endglobals private constant function Duration takes integer level returns real return 60.0 //the duration of the buff endfunction private constant function HeroDuration takes integer level returns real return 60.0 //the duration of the buff for heroes endfunction // ================================================================ // BUFF DEFINITIONS globals public aBuffType buffType = 0 endglobals private function Cleanup takes aBuff eventBuff returns nothing call UnitRemoveAbility(eventBuff.target.u, BUFF) endfunction // SPELL CODE private function SpellCast takes nothing returns nothing local integer level =GetUnitAbilityLevel(SpellEvent.CastingUnit, SPELL) local real duration = Duration(level) if IsUnitSpellResistant(SpellEvent.TargetUnit) then set duration = HeroDuration(level) endif call ABuffApply(buffType, SpellEvent.TargetUnit, SpellEvent.CastingUnit, duration, level, 0) endfunction // SPELL INITIALIZATION private function Init takes nothing returns nothing call RegisterSpellEffectResponse(SPELL, SpellCast) set buffType = aBuffType.create() set buffType.eventCleanup = Cleanup endfunction endscope So, for beginning, one of my questions is: JASS:private constant function Duration takes integer level returns real return 60.0 //the duration of the buff endfunction 1) Is the function name "Duration" freely chosen? Because I can not find any function declaration with this name in any other trigger in the ABuff System... So you can also call it "Dur" and it still works if you change the function call under 'private function SpellCast' from 'Duration' to 'Dur' right? 2) The same function again: JASS:private constant function Duration takes integer level returns real return 60.0 //the duration of the buff endfunction If this is a new function, then why do you use a take-value? You take integer level, but the function doesn't recognize this value, it just returns 60. So, why not use: JASS:private constant function Duration takes nothing returns real return 60.0 //the duration of the buff endfunction I'm asking this, because I seriously want to use your system, but I don't understand this approach ![]() EDIT 3) I can't save your map!? (I use the latest "JassNewGenPackv5d") I get following error-message: EDIT2 Ah, you wrote: Quote:
I will check that... Well, I downloaded "0.A.2.B.jasshelper" and replaced the executables "clijasshelper.exe" and "jasshelper.exe" from "JassNewGenPackv5d\jasshelper\" with the new ones from Vexorian from "0.A.2.B.jasshelper\executable". (Vex mentioned the "JassNewGenPackv5d\bin"-folder, but there were no similiar files to replace, so I chosed the "JassNewGenPackv5d\jasshelper\"-folder.) This time when I want to save, another error comes up: Now I'm clueless... Last edited by MasterofSickness : 04-11-2010 at 04:00 PM. |
|
|
|
|
|
|
#60 |
|
I blink, therefore I am.
Join Date: Sep 2006
Posts: 1,812
![]() ![]() ![]()
|
Duration(level) is used in the spell cast function for the inner fire spell, as well as its brother, HeroDuration(level). The level is passed in case you want to make the duration different for each level. This example keeps the duration constant. But with level being passed, you can easily change it to anything you want (20+level*10).
__________________You should replace the entire JassHelper folder with the one you downloaded. Jasshelper parses the common.j and blizzard.j located in its folder. Since you are using old version of both (didn't update them), the new types added by blizzard for 1.24 are not being told to JassHelper. Therefore, just copy the entire folder over. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
|
Donate |