HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creep Revive Without Unit Indexing?

01-21-2009, 01:22 AM#1
Joker
I can't seem to think of a way. :/
01-21-2009, 01:53 AM#2
Zerzax
Hmm... You can GUI it pretty easily using Polled Waits or regular waits. GetTriggerUnit() still works after a wait.
01-21-2009, 02:56 AM#3
TriggerHappy
If you mean in the place they started, then i doubt it else you could just use

Collapse JASS:
call CreateUnit(PLAYER_NEUTRAL_AGGRESSIVE, GetUnitTypeId(GetDyingUnit()), GetUnitX(GetDyingUnit()), GetUnitY(GetDyingUnit()), 0.00)
01-21-2009, 03:00 AM#4
Tide-Arc Ephemera
As far as I know, that would work if you used GetTriggerUnit() instead.
01-21-2009, 03:20 AM#5
Joker
In a fixed position, I forgot the mention that.
01-21-2009, 03:29 AM#6
TriggerHappy
I doubt it, whats wrong with indexing them?

Don't want to use unituserdata?

or don't want to have to loop through the instances without unit userdata?

or don't want to use gamecache?

Actually i can see why you wouldn't want to index them..
01-21-2009, 10:34 PM#7
Joker
I'm using it for something else.

Anyway, I figured PUI's textmacros allow more data, so I'm fine now.
01-21-2009, 11:59 PM#8
fX_
local variables...

Collapse JASS:
function aaasda_Actions takes nothing returns nothing
local unit U = GetTriggerUnit
local integer INT_UnitId = GetUnitTypeId(U)
local player P = GetOwningPlayer(U)
local real R_X = GetUnitX(U)
local real R_Y = GetUnitY(U)
local real R_Facing = GetUnitFacing(U)

call PolledWait(yourDelayDuration) or call TriggerSleepAction(yourDelayDuration)

call CreateUnit(P, INT_UnitId, R_X, R_Y, R_Facing)

set P = null
set U = null
endfunction
01-22-2009, 12:13 AM#9
DioD
He wants creeps on initial positions, without indexing...

Use gamecache.
01-22-2009, 05:43 AM#10
fX_
O I thought "where they die" not "initial positions".

well if you do not want a system you can

1) make a trigger that is prompted when such creeps enter the map.
2) (below)
Collapse JASS:
function respawn takes player p, integer id, real x, real y, real facing returns nothing
call triggersleepaction(howLongBeforeACreepRevives)
call CreateUnit(p, id,...)
endfunction
function a ada_actions takes nothing returns nothing
local unit u = u
local boolean bool = false
local real x = getunitx
local real y = getunity
local rela facing = getunitfacing
loop
exitwhen bool
if istheunitdead (getunitstatelife/getwidgetlife) then
call respawn.execute(getowningplayer(u,...), getuntiypeid(u),x,y,facing)
set bool = true
endif
call triggersleepaciton(1.00)
endloop
set u = null
endfunction

the trigger detects when a creep enters the map (u can filter) and runs the function.
the function records the unit's initial stuff, waits for the unit to die, then runs
a respawn function with the recorded initial stuff as parameters.

just 1 trigger no system or indexing or gamecache or whatever complication; but ull be looping a lot.
01-22-2009, 06:26 AM#11
Rising_Dusk
Quote:
Originally Posted by DioD
Use gamecache.
This.

Although let's face it, if you're using user data for anything other than unit indexing, you're coding your map improperly.
01-22-2009, 08:02 AM#12
holyadvocate
Blizzard has done this (or something similar)

Look at Funny Bunnies Egg Hunt
01-22-2009, 09:40 PM#13
Joker
Quote:
Originally Posted by Rising_Dusk
This.

Although let's face it, if you're using user data for anything other than unit indexing, you're coding your map improperly.
I was using it with your IDDS.

Anyway, I remembered about PUI's new textmacro usage, so I'm fine like I stated like yesterday.
01-22-2009, 09:53 PM#14
Rising_Dusk
Quote:
Originally Posted by Joker
I was using it with your IDDS.
Why? Nothing in the IDDS requires UserData.
01-23-2009, 01:02 AM#15
Joker
So that I could store some independent info on which effects does what to each unit.