| 08-17-2008, 01:15 AM | #1 |
So for my darkness category, I'm making a wave of death using crushing wave (carrion swarm) as a base dummy spell. The spell is cast 16 times to complete a nova-like circle, and so I create 16 dummy units, add the ability, and order them to cast the spell in circular increments. It works fine with a few units in the target radius, but when lots of large-collision units clog up the area, the dummies won't cast the spell in the direction of those units, just concentrate on a fraction of the circle that is not blocked. The wave ends up looking like a semicircle. Anyone know whats up? I'll post a screenie soon. here's the code: Code:
loop
exitwhen i==TOTAL_WAVES
set waves=CreateUnit(GetOwningPlayer(caster), DUMMY_ID, lx, ly, 0)
call UnitApplyTimedLife(waves, 'BTLF', 2.00)
call UnitAddAbility(waves, WAVE_ABILITY_ID)
call IssuePointOrder(waves, WAVE_ORDER, lx + RANGE_INCREMENT * Cos(pi/(TOTAL_WAVES/2.00) * i), ly + RANGE_INCREMENT * Sin(pi/(TOTAL_WAVES/2.00) * i))
set i=i+1
endloopTOTAL_WAVES equals 16 at the moment. When the target loc is not clogged, the waves work fine. P.S. It's not the same as Death Wave from TBR v1.33, the effects are just similar. The damaging system is entirely different as well as the targeting. |
| 08-17-2008, 07:25 AM | #2 |
JASS:loop exitwhen i==TOTAL_WAVES set waves=CreateUnit(GetOwningPlayer(caster), DUMMY_ID, lx, ly, 0) call SetUnitX(waves, lx) call SetUnitY(waves, ly) call UnitApplyTimedLife(waves, 'BTLF', 2.00) call UnitAddAbility(waves, WAVE_ABILITY_ID) call IssuePointOrder(waves, WAVE_ORDER, lx + RANGE_INCREMENT * Cos(pi/(TOTAL_WAVES/2.00) * i), ly + RANGE_INCREMENT * Sin(pi/(TOTAL_WAVES/2.00) * i)) set i=i+1 endloop If the point where the units are to be created has units there, the dummy units will be pushed to the nearest unoccupied spot. Using the SetUnitX/Y natives, it forces the units to move there, ignoring any pathing. |
| 08-17-2008, 02:58 PM | #3 |
I fixed it, it had to do with the configuration of the dummy units. Set X/Y helped too. Thanks again for the tip Ammorth. |
| 08-21-2008, 07:24 PM | #4 |
My wave spell works like this: After a fraction of the life of all enemy units in a 200 radius is processed, the damage is dealt out in an increasingly large circle to other enemy units, as well as the originals. Initially, I thought it would be better to just make it so that the wave could not hit a single unit multiple times. However, I realized to change that, all I had to do was associate an integer (the integer that keeps track of how big the wave is when a unit is hit) with that hurt unit. First solution? Gamecache, no biggie. I prefer not to use it though because it is apparently slow and I've gone out of my way to make a global struct array and timer, using no cache. My next solution? A struct that only has to keep track of that integer, but it seems like a waste, honestly 2 objects in a multi-instance struct? Maybe it's not terrible but it doesn't seem right to me. Finally, I thought that I could use a group array whose index could keep track of the wave count, but that means creating a group for every concenctric wave circle and that means 16 group handles plus the 3 I already use.. no, that's not good either. So I'm back to using native gamecache functions. Does anyone have any ideas on tracking this elusive integer? EDIT: Eh I'm using another struct, w/e. How do I post a WIP screenshot? |
