wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 01-28-2010, 09:45 PM   #46
Kueken
User
 
Join Date: Mar 2009
Posts: 149

Kueken will become famous soon enough (41)Kueken will become famous soon enough (41)

Default

Quote:
Originally Posted by Anitarf
I use xedamage to achieve this effect.
Well, how exactly do you use xedamage in this case? I want to be able to differentiate spell and attack damage, thats why I tried to use IDDS.

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 01:17 AM.
Kueken is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 01-29-2010, 03:31 PM   #47
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,085

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

There is the xedamage.isInUse() static method, read the xedamage documentation.
__________________
Anitarf is offline   Reply With Quote
Old 02-01-2010, 01:29 PM   #48
Kueken
User
 
Join Date: Mar 2009
Posts: 149

Kueken will become famous soon enough (41)Kueken will become famous soon enough (41)

Default

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.
Kueken is offline   Reply With Quote
Old 02-06-2010, 01:49 PM   #49
Sinnergy
User
 
Sinnergy's Avatar
 
Join Date: Apr 2009
Posts: 173

Sinnergy has little to show at this moment (8)

Send a message via Yahoo to Sinnergy
Default

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.
__________________
Current Project:
Rise of Sinnergy v1.00
Sinnergy is offline   Reply With Quote
Old 02-07-2010, 01:48 PM   #50
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,085

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by Sinnergy
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 buff is placed on the unit before the damage event occurs.
__________________
Anitarf is offline   Reply With Quote
Old 02-16-2010, 07:04 AM   #51
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

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.
Collapse 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
__________________
Deaod is offline   Reply With Quote
Old 02-16-2010, 02:18 PM   #52
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,085

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

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.
__________________
Anitarf is offline   Reply With Quote
Old 02-18-2010, 05:12 PM   #53
Kueken
User
 
Join Date: Mar 2009
Posts: 149

Kueken will become famous soon enough (41)Kueken will become famous soon enough (41)

Default

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.
Kueken is offline   Reply With Quote
Old 03-24-2010, 02:57 PM   #54
gamma_T
User
 
gamma_T's Avatar
 
Join Date: Mar 2010
Posts: 5

gamma_T has little to show at this moment (0)

Default

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 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.
Attached Files
File Type: w3x stress.w3x (16.0 KB, 5 views)

Last edited by gamma_T : 03-24-2010 at 04:43 PM.
gamma_T is offline   Reply With Quote
Old 03-25-2010, 12:12 AM   #55
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (457)Ammorth is a glorious beacon of light (457)Ammorth is a glorious beacon of light (457)Ammorth is a glorious beacon of light (457)

Default

Quote:
Originally Posted by gamma_T
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.

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.
__________________
Ammorth is offline   Reply With Quote
Old 03-25-2010, 01:19 PM   #56
gamma_T
User
 
gamma_T's Avatar
 
Join Date: Mar 2010
Posts: 5

gamma_T has little to show at this moment (0)

Default

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.
gamma_T is offline   Reply With Quote
Old 03-25-2010, 05:43 PM   #57
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,153

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by gamma_T
I clearly understand how this system works.
And im Bill Clinton, and i had no sex with my secretary.

Quote:
Originally Posted by gamma_T
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.

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 05:44 PM.
akolyt0r is offline   Reply With Quote
Old 03-25-2010, 11:04 PM   #58
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,085

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by gamma_T
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.
Note that response functions run whenever any unit takes damage. As such, one response function is enough, you do not need to register a new one for every unit.

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 11:06 PM.
Anitarf is offline   Reply With Quote
Old 04-11-2010, 03:49 PM   #59
MasterofSickness
User
 
MasterofSickness's Avatar
 
Join Date: Feb 2006
Posts: 212

MasterofSickness is on a distinguished road (23)

Question

In your system 1.5 under "Samples" / "PriestInnerFire"...
Ah wait, I will post this trigger first.

Collapse 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:
Collapse 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:
Collapse 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:

Collapse 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:
Click image for larger version

Name:	Unbenannt.JPG
Views:	11
Size:	105.8 KB
ID:	48660

EDIT2
Ah, you wrote:
Quote:
At the time of this release, the JassHelper version included with the latest
NewGen pack is outdated and does not have all the features required to
process this version of ABuff, you may need to get the latest version of
JassHelper here:

http://www.wc3c.net/showthread.php?t=88142

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:
Click image for larger version

Name:	Unbenannt2.JPG
Views:	6
Size:	110.4 KB
ID:	48661

Now I'm clueless...

Last edited by MasterofSickness : 04-11-2010 at 05:00 PM.
MasterofSickness is offline   Reply With Quote
Old 04-11-2010, 05:22 PM   #60
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (457)Ammorth is a glorious beacon of light (457)Ammorth is a glorious beacon of light (457)Ammorth is a glorious beacon of light (457)

Default

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.
__________________
Ammorth is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:07 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services