I don't want AIDS to index my dummy units =/

SineCosine

I'm still looking for my Tangent
Reaction score
77
Yeap, I've been tweaking my TD a bit and I played with my friends one day..
We hadn't gone far when AIDS started saying:

Error using AIDS: Trying to get the unit of unassigned index.

So..
That's when I decided to do a little test.
It turns out that my Dummy units are too numerous.

I got 40towers (All with abilities) to attack an invulnerable creep.
Meh, needless to say, the error came.

It was, like, 40dummies being created every second.
I don't wanna' increase AIDS's recycle rate by reducing the period.
I want it to not index the dummies at all =)

Is that possible?
The only reason I have AIDS is because I'm using Damage xD

Also, I think this indexing thingy is lagging the game because I'm telling it to index and recycle 40+ dummies a second or something :nuts:

[EDIT]
In a game of 4people (Max players allowed), that's about 160+ dummies being created ._.
 

Executor

I see you
Reaction score
57
JASS:
    private function UnitIndexingFilter takes unit u returns boolean
        return GetUnitId(u) != YOUR_DUMMY_UNIT_ID
endfunction


This function can be found in the AIDS script beneath the comment block.
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Holy Shi--
I never thought of that ._.

I did see it, I tried to make it false, but then it broke Damage, so I made it true again xD
Thanks a lot, man.
 

Jesus4Lyf

Good Idea™
Reaction score
397
That's all well and good. But a few things.

It was, like, 40dummies being created every second.
I don't wanna' increase AIDS's recycle rate by reducing the period.
Sounds like you're using an old version of AIDS. Consider upgrading. (Just a thought.)

Why do you have dynamic dummies? I assume they are for casting spells. Have you considered DummyCaster or just simply Status? Between Status and Damage, you should be able to mimic any WC3 spell without much pain... (ie. no dummy units.)

Anyway, the suggested fix will work. These are just some other ideas to decrease lag and ease coding. :thup:
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Wait--
Status will enable me to not need most spells? o.0

I am so looking into this now, thanks, J4L!
(I just finished watching Avatar for the 3rd time and you've made my day better =x)

[EDIT]
Yea, I did try your DummyCaster, I must have been doing something seriously wrong.
It didn't really cast for all the towers, only some.

I made it such that when a tower attacked, it would give an ability to 'dumy', set it to a certain level (depending on the tower's tier), order it to cast, then remove it.
Seemed to break something xD

[EDIT=2]
Holy Shi--
I just saw 'Status', damn..
That's a lot of lines of code ._.
How do you even understand what you're typing?
It's, like, a lot to think about..

My computer lags just by scrolling through it -___-
And I now have 6systems by you in my map and 1 group made for everything thanks to your tutorial on leakless groups.
(And yes, mine was an old version of AIDS =/)

[EDIT=3]
Please tell me there's a TESH file created for status and that I won't have to do it myself =/
And where's faerie fire? o.0
Or do I have to use modArmorBonus?
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
You don't have to remove it.
Set XY.
Give ability.
Set Level.
Order it to cast spell.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Status will enable me to not need most spells? o.0
Yes, because between Status, Damage and [LJASS]AddSpecialEffectTarget[/LJASS], you should be able to create anything a spell has. (Use status to stun/modify attributes, etc.)
Yea, I did try your DummyCaster, I must have been doing something seriously wrong.
In theory, if you use Status on top of DummyCaster, you shouldn't need to write your own DummyCaster spells, or really ever have to use DummyCaster manually. :p
Please tell me there's a TESH file created for status and that I won't have to do it myself =/
There isn't, because it uses methods... :(
But I could try investigating. All the method names should be fairly intuitive, however.
And where's faerie fire? o.0
Or do I have to use modArmorBonus?
Yep, modArmorBonus will do you well. :)

So here's an example using BuffStruct to apply an armor down buff. You can script the armor down amount to be anything, or even random, unlike if you used a WC3 spell. :)
JASS:
//! runtextmacro BuffType("ArmorDown")
    //! runtextmacro SetBuffName("Armor Down")
    //! runtextmacro SetBuffAlignment("NEGATIVE")
    //! runtextmacro SetBuffTooltip("This unit has reduced armor; it takes extra damage from attacks.")
    //! runtextmacro SetBuffIcon("ReplaceableTextures\\CommandButtons\\BTNDaggerOfEscape.blp")
//! runtextmacro BuffStruct()
    integer armorReduction
    //effect e // consider adding an effect to add and remove, also.
    method onApply takes nothing returns nothing
        call Status[this.unit].modArmorBonus(-armorReduction)
        //set this.e=AddSpecialEffectTarget...
    endmethod
    method onRemove takes nothing returns nothing
        call Status[this.unit].modArmorBonus(armorReduction)
        //call DestroyEffect(e)...
    endmethod
    static method apply takes unit target, integer amount, real duration returns nothing
        local thistype this=thistype.create(null)
        set this.armorReduction=amount
        call this.setUnit(target)
        call this.destroyTimed(duration)
    endmethod
//! runtextmacro EndBuff()

scope ApplyArmorDown initializer OnInit
    private function OnDamage takes nothing returns boolean
        if Damage_IsAttack() then
            if GetUnitTypeId(GetEventDamageSource())=='u000'/*change this to the unit type of the armor down tower or something*/ then
                call ArmorDown.apply(GetTriggerUnit(),2,0.5)
            endif
        endif
        return false
    endfunction
    private function OnInit takes nothing returns nothing
        local trigger t=CreateTrigger()
        call Damage_RegisterEvent(t)
        call TriggerAddCondition(t,Filter(function OnDamage))
    endfunction
endscope

That's free-hand though, excuse syntax errors. :)

PS. You don't need to write a single spell if you use the above code, your object editor days for buffs are over. :p
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Hahaha,
Yea, you did make a mistake xD

It's supposed to be:
JASS:
call this.destroyTimed(duration)


Is it not? o.0
 

SanKakU

Member
Reaction score
21
Yes, because between Status, Damage and [LJASS]AddSpecialEffectTarget[/LJASS], you should be able to create anything a spell has. (Use status to stun/modify attributes, etc.)

In theory, if you use Status on top of DummyCaster, you shouldn't need to write your own DummyCaster spells, or really ever have to use DummyCaster manually. :p

There isn't, because it uses methods... :(
But I could try investigating. All the method names should be fairly intuitive, however.

Yep, modArmorBonus will do you well. :)

So here's an example using BuffStruct to apply an armor down buff. You can script the armor down amount to be anything, or even random, unlike if you used a WC3 spell. :)
JASS:
//! runtextmacro BuffType("ArmorDown")
    //! runtextmacro SetBuffName("Armor Down")
    //! runtextmacro SetBuffAlignment("NEGATIVE")
    //! runtextmacro SetBuffTooltip("This unit has reduced armor; it takes extra damage from attacks.")
    //! runtextmacro SetBuffIcon("ReplaceableTextures\\CommandButtons\\BTNDaggerOfEscape.blp")
//! runtextmacro BuffStruct()
    integer armorReduction
    //effect e // consider adding an effect to add and remove, also.
    method onApply takes nothing returns nothing
        call Status[this.unit].modArmorBonus(-armorReduction)
        //set this.e=AddSpecialEffectTarget...
    endmethod
    method onRemove takes nothing returns nothing
        call Status[this.unit].modArmorBonus(armorReduction)
        //call DestroyEffect(e)...
    endmethod
    static method apply takes unit target, integer amount, real duration returns nothing
        local thistype this=thistype.create(null)
        set this.armorReduction=amount
        call this.setUnit(target)
        call this.destroyTimed(duration)
    endmethod
//! runtextmacro EndBuff()

scope ApplyArmorDown initializer OnInit
    private function OnDamage takes nothing returns boolean
        if Damage_IsAttack() then
            if GetUnitTypeId(GetEventDamageSource())=='u000'/*change this to the unit type of the armor down tower or something*/ then
                call ArmorDown.apply(GetTriggerUnit(),2,0.5)
            endif
        endif
        return false
    endfunction
    private function OnInit takes nothing returns nothing
        local trigger t=CreateTrigger()
        call Damage_RegisterEvent(t)
        call TriggerAddCondition(t,Filter(function OnDamage))
    endfunction
endscope

That's free-hand though, excuse syntax errors. :)

PS. You don't need to write a single spell if you use the above code, your object editor days for buffs are over. :p

addspecialeffecttarget, eh? what about if the spell uses a dummy model (for an effect rather than being an invisible model) that changes in size throughout the spell? did you ever think of that?
 

Jesus4Lyf

Good Idea™
Reaction score
397
addspecialeffecttarget, eh? what about if the spell uses a dummy model (for an effect rather than being an invisible model) that changes in size throughout the spell? did you ever think of that?
See, that's the thing. I don't have do think of it. Did you ever think of it?
JASS:
//! runtextmacro BuffType("ArmorDown")
    //! runtextmacro SetBuffName("Armor Down")
    //! runtextmacro SetBuffAlignment("NEGATIVE")
    //! runtextmacro SetBuffTooltip("This unit has reduced armor; it takes extra damage from attacks.")
    //! runtextmacro SetBuffIcon("ReplaceableTextures\\CommandButtons\\BTNDaggerOfEscape.blp")
//! runtextmacro BuffStruct()
    integer armorReduction
    unit dummy
    private method periodic takes nothing returns nothing
        // increase the dummy's size here.
        // this method will fire every T32_PERIOD seconds.
        // default being 32 times per second (0.03125 sec).
    endmethod
    implement T32x
    method onApply takes nothing returns nothing
        call Status[this.unit].modArmorBonus(-armorReduction)
        set this.dummy=CreateUnit... // your dummy type
        call this.startPeriodic()
    endmethod
    method onRemove takes nothing returns nothing
        call Status[this.unit].modArmorBonus(armorReduction)
        call RemoveUnit(this.dummy)
        call this.stopPeriodic()
    endmethod
    static method apply takes unit target, integer amount, real duration returns nothing
        local thistype this=thistype.create(null)
        set this.armorReduction=amount
        call this.setUnit(target)
        call this.destroyTimed(duration)
    endmethod
//! runtextmacro EndBuff()

The thing about BuffStruct is you can make it do whatever you want...
(The above, naturally, requires T32.)
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
The genius of it is pure win.
Words cannot express how awesome this is.

I can make stuff fly in circles with this, or knockback, maybe jump, or funny epileptic cinemtic fade filters and all kinds of jokes ._.
 

SanKakU

Member
Reaction score
21
See, that's the thing. I don't have do think of it. Did you ever think of it?
JASS:
//! runtextmacro BuffType("ArmorDown")
    //! runtextmacro SetBuffName("Armor Down")
    //! runtextmacro SetBuffAlignment("NEGATIVE")
    //! runtextmacro SetBuffTooltip("This unit has reduced armor; it takes extra damage from attacks.")
    //! runtextmacro SetBuffIcon("ReplaceableTextures\\CommandButtons\\BTNDaggerOfEscape.blp")
//! runtextmacro BuffStruct()
    integer armorReduction
    unit dummy
    private method periodic takes nothing returns nothing
        // increase the dummy's size here.
        // this method will fire every T32_PERIOD seconds.
        // default being 32 times per second (0.03125 sec).
    endmethod
    implement T32x
    method onApply takes nothing returns nothing
        call Status[this.unit].modArmorBonus(-armorReduction)
        set this.dummy=CreateUnit... // your dummy type
        call this.startPeriodic()
    endmethod
    method onRemove takes nothing returns nothing
        call Status[this.unit].modArmorBonus(armorReduction)
        call RemoveUnit(this.dummy)
        call this.stopPeriodic()
    endmethod
    static method apply takes unit target, integer amount, real duration returns nothing
        local thistype this=thistype.create(null)
        set this.armorReduction=amount
        call this.setUnit(target)
        call this.destroyTimed(duration)
    endmethod
//! runtextmacro EndBuff()

The thing about BuffStruct is you can make it do whatever you want...
(The above, naturally, requires T32.)

uhmm...why would editing the armor of a unit have anything to do with changing the model size of a dummy unit?
(oh i see, you're just using an example, i see the comments inserted now)
uhhhhhhhmm...i find it incredibly humourous that you said to use AddSpecialEffectTarget and those systems and you can do anything. thing is...if the dummy unit is the effect then there's no point in using AddSpecialEffectTarget for that instance, is there? AH, nevermind...i think i can see where it would be useful. hmm. i just haven't used AddSpecialEffectTarget much yet. I'll have to check around for examples of it's use, but i'm pretty sure it's like what you'll want for the target of a spell or the caster's effect which will not be getting larger or smaller in size.


The genius of it is pure win.
Words cannot express how awesome this is.

I can make stuff fly in circles with this, or knockback, maybe jump, or funny epileptic cinemtic fade filters and all kinds of jokes ._.
do you mean to say that you can make it so there are 3 different spells or more for example which can inflict a status on an enemy of oh say confusion which will cause an enemy hero to run around in circles as if it were a blood mage sphere?

in other words...custom buffs? like stun is a buff and silence is a buff, we could make confusion (running around in a circle) be a custom buff, and this system is for that? that being the case, why hasn't Jesus4Lyf given us some good examples of it? when i first saw the thread title i thought that's what it was, and you seem to be saying that's what it is. but after reading through it i saw no examples of such a thing so i was like...hmm...i don't get it. but now after looking at what you and Jesus4Lyf have written lately, maybe this theory is correct.

edit: ah what? i thought this was the status thread...that's what we're talking about, right? oh man, i'm confused.
 

Jesus4Lyf

Good Idea™
Reaction score
397
oh man, i'm confused.
You sure are.

We're actually using BuffStruct there, in the example. BuffStruct allows you to create custom buffs. Status allows you to apply WC3 buffs, such as stun, silence, doom, etc. Inside of BuffStruct, we can do anything because it is JASS code, like make a unit run in circles (sure, why not). Status comes in when you want that unit to be stunned, or walk backwards for some reason, or have extra armor - things that are native to the WC3 engine, but usually would require you to write custom abilities and have them dummy casted, or something.

So between the two of them, you have very rapid spell development. There is another system, also, which is SpellStruct. That is more focused around making spells have fancy effects, though. I haven't been mentioning that one, yet. :thup:
 

tooltiperror

Super Moderator
Reaction score
231
So between the two of them, you have very rapid spell development. There is another system, also, which is SpellStruct. That is more focused around making spells have fancy effects, though. I haven't been mentioning that one, yet. :thup:

You should probably mention SpellStruct also optimizes code a ton, doesn't it, when it comes to it's event management?
 

SanKakU

Member
Reaction score
21
ahh...was there something wrong with your sentence structure? otherwise you're telling me that having a unit walk backwards is native to the warcraft 3 engine. how do you even make a unit walk backwards? ^ ^
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
I love grammar for it's the only thing I am good at.
But I do not recall anything wrong with J4L's grammar.
(And I am lazy to go back a page to re-read through all that)
 

Jesus4Lyf

Good Idea™
Reaction score
397
ahh...was there something wrong with your sentence structure? otherwise you're telling me that having a unit walk backwards is native to the warcraft 3 engine. how do you even make a unit walk backwards? ^ ^
Well, you can do it with Status, but I guess that's technically not native to the game engine. ;)
Excuse me. Heh. :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top