HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dummy Recycling?

08-21-2008, 12:03 PM#1
Vestras
How to? I checked xe, couldn't figure out from there, then I tried myself, but with no luck.
08-21-2008, 12:29 PM#2
Themerion
Do you only need instant dummys, or do you need them to last over time?

For instant effects, just create 1 dummy unit and access it with a global variable...
08-21-2008, 12:39 PM#3
Vestras
I need them instantly, normally I remove them with after ~2 seconds.
Would that count at instantly or over time?

And should that global be an array?
08-21-2008, 12:45 PM#4
Themerion
Quote:
Originally Posted by RoD
I need them instantly, normally I remove them with after ~2 seconds.

Uh... By instantly, I mean that you can just go ahead and use it again DIRECTLY. Instead of creating and destroying units, can't you just use the same one?
08-21-2008, 12:48 PM#5
Vestras
Quote:
Originally Posted by Themerion
Uh... By instantly, I mean that you can just go ahead and use it again DIRECTLY. Instead of creating and destroying units, can't you just use the same one?

No, that would reduce speed. Greatly.
08-21-2008, 01:00 PM#6
Themerion
What!? Using only 1 unit is even faster than using many...
Collapse JASS:
globals
    unit DUMMY_CASTER
endglobals

function InitDummy takes nothing returns nothing
    set DUMMY_CASTER=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'e000',0,0,0)
endfunction

function DoStuff takes nothing returns nothing
    call SetUnitOwner(DUMMY_CASTER,GetOwningPlayer(GetSpellAbilityUnit()))
    call UnitIssueTargetOrder(DUMMY_CASTER,"slow",GetSpellTargetUnit())
    call UnitIssueTargetOrder(DUMMY_CASTER,"innerfire",GetSpellAbilityUnit())
endfunction
08-21-2008, 01:20 PM#7
Vestras
The abilities it uses is slow.
08-21-2008, 01:27 PM#8
the-thingy
Set the dummy's Animation - Backswing Point and Animation - Cast Point to 0, and the cast will be instant
08-21-2008, 01:31 PM#9
Themerion
I find it hard to know what you mean. Did you mean that in your map, the dummy caster will only use slow? Or did you set up a testing environment for the script?

If you set up an environment to test that code, check so you didn't forget...
  • The abilities, slow and inner fire, must have 0 cooldown.
  • They must have 999999 range.
  • The dummy caster must have
    * Art - Cast point = 0
    * Art - Cast backswing = 0
  • The abilities must cost no mana.
  • The dummy caster must have the abilities.
  • The dummy caster might need vision in order to throw at an unseen object.
08-21-2008, 01:40 PM#10
Anitarf
You could just use xe?
08-21-2008, 01:50 PM#11
Vestras
It's for my Condition System, it already uses enough systems, and I'm just gonna use one dummy, it works perfectly.
Dummy Recycling? - Wc3C.net