View Single Post
Old 08-09-2005, 10:52 AM   #1 (permalink)
Dibelius
Senior Member
 
Join Date: Jun 2003
Location: Germany
Posts: 363
Send a message via ICQ to Dibelius
Default Damn Energy bug with object replacing!

this problem destroys all my plans I have...

I want to make a defense tower like the GDI had. The player shall build a base tower from which he can upgrade TWO possible upgrades. These upgrades shall replace the default base tower with the "real" tower object. So far no problem... but now the energy bug seems to destroy this plan totally.

The problem with "ReplaceObjectUpgrade" is:
Since I've upgraded the base tower to a "real" one he shall consume 1kW energy. The base tower doesn't consume energy (or later maybe yes... must be tested first). When I sell the upgraded tower the 1kW of energy won't be given back to me........ it's forever away the whole game
In tower defense mod you often must sell your buildings to get money for better towers, so it's really really important that this works correctly.

I already tried it with the "death and respawn logic via OCL" as described in this TOPIC

But it doesn't work in my case... the first reason is that I need an upgrade which cost money when you buy it (the build time, too). The other reason is that I need TWO of these upgrades for one tower. The player shall have 2 upgrade possibilities but only 1 of these shall be possible (like the Overlord upgrades).

So I tried to modify the code of the other topic a little bit... with "StatusBitsUpgrade" -> DESTROYED ---> then the replaced tower should be spawned. it doesn't work... same with negative "MaxHealthUpgrade" where I wanted to decrease the tower's health to zero... but I think the tower doesn't know that he's dead when his health is zero... I dunno.
I fear if you really can help me and the upgrade is really executable without any more bugs, the next problem would be the second alternative turret upgrade.... :/

My question now: is there a way to destroy the tower after an upgrade is done? Or maybe other ways to get it running?

I'm thankful for every tip...
Dibelius is offline   Reply With Quote