Hey, im making a map with virtual life and i was going to make it so that if they have some shields left, the unit im using for the life will be hallucinated to look like the shield is being hit. the problem is that the player could be walking around the map and the hallucination would run out of energy and die.
- how could i make it last forever unless its killed?
- also, do hallucinated units count for deaths?
I'm pretty sure the second is impossable. Not sure about the first.
Yea i have never seen those done before. Sounds like a crazy idea if you get it down. hum..Yea i can't really recall seeing it anywhere.. I'm sure someone will have some way around it

Hallucinations may not register for a lot of things, but they DO take up space. If you have a hallucinated unit in the centre of a location, additional units will spawn as they would if there was a real unit at the centre of the location. So, in theory, if you have two grids, one which is on the same level (air or ground) as the hallucinated unit, and one, larger by one unit, that is on the other level, you could use the second grid to see whether or not the first grid is in "displaced" or "non-displaced" position. I have never tried this whole system, but I have tested the displacement effect, and it works.
As for keeping the shield alive, you could either slow down the rate at which it checks for a missing HP unit to allow you to replace the shield in between checks, or you could simply incorporate the "problem" into gameplay, i.e. shields run out of energy after a while and need to be recharged.
well, the map that im using this for is halo and im making it exactly like the game. i guess ill do some testing if nobody can help me out.
Well you could look at how long it takes for a hallu to die, then remove it just before it dies and respawn it... but that would reset their health...
I think I've got it!
My idea depends on the following answers:
How many are there?
What unit are they supposed to be?
You could have a trigger that centers on a hallucination at anywhere, replaces it with the hero version of it, but still in hallucination form. Keep going until player 'blah' has no more regular hallucinations of unit 'blah'. Then do it the same but back to regualr units. Just give them the same stats.
Have a location centered around the player's unit (Master Chief, presumably) as large as the screen (or larger so that if the unit takes damage it wont heal, but this trigger could be used for shield regeneration.) and have a condition if player 'blah' (enemy) brings at most zero 'blah' (Hallucinated unit) to location 'blah' (Center on Master CHief), so that the cycle wont replace a unit that you're fighting.
If there are too many, though, then there wont be enough time in between fights to replace them all and some would be killed. I suggest, if you think you'll have the space for the triggers, do "if 'player MC' brings one men to location 'blah', create one unit 'here', one unit 'here', and so on, so that the units wont be created until the player steps on the trigger that creates them. Placing these locations is easy. It's how they do it in the real game, anyhow.
And if they're a unit that has no hero double, well then you just wasted you time reading this far...
I think for THAT, somebody should find me a darn slice of pie!
its a zergling and there are two of them constantly being put under masterchief. couldnt i just replace it with a regular zergling instead of a hero?
Shapechanger: how exactly do you plan to work out the stats of the original hallucination before you replace it?
One solution may be to use a 'virtual shield' system - where you make the hallucination have quite low hp, and you count down on a 'shield counter' whenever it dies. You periodically replace the shield, regardless of whether it has died or not, as long as the 'shield counter' is positive.
You still get big problems with detecting a hallucination death and even detecting whether a unit is a hallucination or not.
You could switch to something other than a hallucination... (say use another unit with 0 attack dmg)
By virtual HP, you're talking about using splash damage to hit burrowed units, right?
If their HP is above a certain value, make sure there is a hallucinated unit under there too. Then when they get hit, the hallucinated unit dies and you get the death animation.
none of the units that would be attacking the burrowed zerglings would do splash. you did give me an idea of creating and killing a hallucinated zergling or scourge at the location and killing it. should i do that?