• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Damage Detection When Dead?

Status
Not open for further replies.
Level 25
Joined
Jul 10, 2006
Messages
3,315
In a tower defence that I'm making, I've got a tower that attacks only when its last attack/missile has hit, so I'm using a system where it can only attack when it has mana, and I remove its mana when it attacks and give it its mana back when its missile hits the target.

The problem I have is when one of these towers attacks a unit, but before the missile hits, that unit dies. Now this tower has no way of getting its mana back, so I devised a rather cheapish way of fixing this, by simply resetting the mana at the start of the next round...

So my question is this: is there another way of fixing this? Or is there another way of making this attack system?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
Sounds like it could work, with an extra bit of used memory.
LOL
That is the funniest thing I heard in ages. An extra 1 KB at most??? that is if you got 100 odd of theses towers attacking all at once. . . . I got 1.5GB of ram spair when running WC3 and wc3 stops functioning BEFORE it reaches 1GB of free space due to leaks causing opperations to require more PROCESSING power. Leaks are only a problem due to WC3 looping throug all the variables when you make/damand one.
 
Level 2
Joined
Mar 3, 2007
Messages
12
Or you can just make his attack a spell... just have him attack instant and then make it so he casts his attack spell on the unit... =/ thats how id do it =/
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
LOL
That is the funniest thing I heard in ages. An extra 1 KB at most??? that is if you got 100 odd of theses towers attacking all at once. . . . I got 1.5GB of ram spair when running WC3 and wc3 stops functioning BEFORE it reaches 1GB of free space due to leaks causing opperations to require more PROCESSING power. Leaks are only a problem due to WC3 looping throug all the variables when you make/damand one.

I think that is a vast underestimation.

Anyway, I solved the problem by simply resetting the mana of all the towers whenever a creep dies. Yay.

And yes, ever little does count, especially as each of the towers in this map has at least one trigger to make it work, and most creeps also have a few triggers. And I am making the game for 11 players, and you can choose how many creeps you want at a time.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
The problem with that, ruler, is that it will reset the mana for towers who shouldn't get it reset ><

In other news; if you've ever played a map with several projectiles moving customly (eg. the bullets in elimination), they have to store 10 to 20x as much data, which is read 100x a second (maybe 50 or 33 if they optimized it a bit). Each. That means if 3-4 people fire a weapon that shoots several bullets (like the Shotgun) you'll get about 30 - 40 bullets moving at once. No lag generated. Since your map needs to read the data rarely and will probably be storing as much data as any two of those bullets, I think I can fairly say that you won't have any memory problems from storing 32-bit data values on even 1000 towers. (32*1000 = 32000 = just a bit less than 32 kilobytes. Computers have as much as 2 GB of ram nowadays... you could do that 1000 times and still not get close to using up .1 GB)
 
Status
Not open for further replies.
Top