View Full Version : Question - Suicide on any combat? (or air intercept)


Sarkyn
Jul 16, 2009, 07:26 AM
Bonjour!

I've been thinking about expanding the non-human combat elements of the game, to include some military devices that are very common and currently absent. I won't bother going into full detail, but it includes things like:

- naval mines
- land mines
- missiles that shoot down other missiles
- missiles that shoot down planes

What I'd like to know is - is it at all possible to *ensure* that a unit self-destructs after a single combat?

While this is possible ON ATTACK via the <bSuicide>1</bSuicide> tag, this tag does not work for some of the elements I've got in mind.

In particular - I've created a missile which has only one purpose. You put them in cities and they intercept enemy aircraft. But regardless of whether they win or lose the intercept, I want them destroyed after one intercept. They're supposed to be cheap, low maintenance, stackable, and most importantly consumed.

Possible?

If so, a pointer in the direction I should be researching?





If this works, I've a mind to make modern and post-modern naval combat rework, make long range missile combat between ships the norm, as it is in the real world, rather than using the "Shoot Guns" model all the way up to Alpha Centauri :p

Thanks in advance for any assistance.

PS @Mods, if this is the wrong forum, please feel free to move it and tell where it should be :p

Admiral Armada
Jul 18, 2009, 05:04 PM
Im not a modder, so take this with a grain of salt, but it seems like you might be able to look at whatever code runs missionaries and corp execs, because they are one shot units, just in a different way. You will probably have to whip something up in python, i dont think this functionality exists in the XML.
On a slightly related note, if you ar looking at cheap expendable units i would look at using the multiple unit production mod ive seen around here somewhere so more then one can be built at a time.

cybrxkhan
Jul 18, 2009, 05:30 PM
This is the wrong forum, I think, you should have put this question in the main Creation and Customization Forum, unless if I'm mistaken. :)

Anyhow, to answer your question, I just recently discovered that in the XML for the promotions, there is one tag <iKamikazePercent>, I think.

Basically, what it does is the unit gets a certain percentage increase in strength; however, after it wins a battle, it is destroyed afterwards.

Let me give an example.

Let's say I make a promotion, "Kamikaze", that has <iKamikazePercent>100</iKamikazePercent>. I give this "Kamikaze" promotion to my Modern Armor, which has 40 strength. If, say, my modern armor attacks another unit, it's strength now becomes 40*100%, or 80; however, afterwards, the modern armor is destroyed.

Hope that makes sense! I think this way is probably not very efficient (having to bother to make a new promotion just for a couple of units), but it works.