How to give champions permadeath?

By on April 18, 2013 11:07:40 AM from Elemental Forums Elemental Forums

abob101

Join Date 11/2010
+49

Hi folks,

(This is for 0.8 LH btw)....

Wondering if anyone has any bright ideas on this one.... I am trying to create some units that are basically the equivalent of a Sion, but can cast spells.

Now, the problem is... if you copy the Sion unit, then give it an ability that unlocks spells, such as Fire1 or whatever... they can't cast them.  When you go into tactical combat, the Spells button is deactivated. 

It seems that to cast Spells (rather than activate Skills via Skills button) you have to set <IsChampion>1</IsChampion>.  That's fine... except as far as I can tell this tag does 3 things:

1) Allows the unit to cast spells (if they have appropriate abilities)

2) Allows them to empty goodie huts and equip special items

3) Makes them not die, i.e. they get given an injury and return to city instead of permadeath.

I would like to have a unit (kinda like a Sion) that has 1) and 2) but NOT 3).

I have tried this approach:

http://forums.elementalgame.com/428191/page/1/#3191297

However when I tested it, I found that even though the unit was given "permadeath" trait with a -300000 hit point modifier.... it still survives.  Seems that the hit points get rounded up to 1, and the unit lives on to fight another day.

 

Anyone got any ideas on how it might be possible to achieve this?

 

Thanks.

Locked Post 30 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 11:15:51 AM from Elemental Forums Elemental Forums


The spell "InfernalCovenant" has this:

<GameModifier>

     <ModType>Unit</ModType>

     <Attribute>PermanentDeath</Attribute>

</GameModifier>

Have not tried myself but looks like it could work.

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 11:37:44 AM from Elemental Forums Elemental Forums

Great suggestion, hadn't seen that one before.    Tested it in the content of an Injury ability though and it didn't seem to work.... maybe it only works in a spell game modifier.  

 

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 11:50:44 AM from Elemental Forums Elemental Forums

That's one of the things that I dislike most about modding this game. Elements (commands, tags, keywords) don't behave the same everywhere. Makes modding a lot more difficult

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 12:02:35 PM from Elemental Forums Elemental Forums

Look at the Death Lash spell for inspiration.

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 12:13:31 PM from Elemental Forums Elemental Forums

You could also just make it that if a champion gets injured they are permanently disabled within a city with a hp reduction to 1 such that they are effectively useless in city defense.  Although this would then make it that they are "retired" and the city gains their bonus but they are inaccessible.  To do this you would adjust the incapacity timer in elemental defs I think. 

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 12:22:15 PM from Elemental Forums Elemental Forums


Another idea. What you want is to make the unit able to cast spells. Perhaps you can equip the unit with an item that unlocks the spell. Like the "BottledFire" item.

<GameModifier>

     <ModType>Unit</ModType>

     <Attribute>UseSpell</Attribute>

     <StrVal>BottledFire</StrVal>

     <Provides>Remove the cork to do 16 fire damage to the target</Provides>

</GameModifier>

You can try placing it in an item usable by non-champions and if it works you avoid the non-diying problem.

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 5:40:09 PM from Elemental Forums Elemental Forums


I know the solution!!!!!!!!!

Make the injury autocast a battle spell, and give the permadeath through that spell. That way if the unit dares to go to another battle, it will be the last

 

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 5:53:26 PM from Elemental Forums Elemental Forums

Quoting OliverFA_306,


I know the solution!!!!!!!!!

Make the injury autocast a battle spell, and give the permadeath through that spell. That way if the unit dares to go to another battle, it will be the last

 

You just beat me to answering here... but here is the mod that I've been pondering on getting working fully. Issue with the autoresolve but other than that it functions.

http://forums.elementalgame.com/443290/page/1/

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 6:01:01 PM from Elemental Forums Elemental Forums


Great minds think alike Parrottmath

Is great to find a solution to something we want to do for a change

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 8:14:29 PM from Elemental Forums Elemental Forums

Yeah I thought about the Autocast option, that would make the unit die at the start of the battle though right?

That works fine for the player because they will understand... but it kinda adds another handicap on the AI because it own't understand that the unit might as well be left in the city or retired.  The AI will likely have the unit wander around costing maintenance or whatever then eventually though it into battle leading some stack only to die before it does anything. 

Not knocking the solution, it's about the only option it seems... but that would be the drawback to it right?

 

Edit...

Wait, maybe sticking this tag into the autocast spell would let them fight the one last battle and then die...

<ApplyAtBattleEnd>1</ApplyAtBattleEnd>

?

Will have a play with it later.

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 8:30:13 PM from Elemental Forums Elemental Forums

Quoting abob101,
Yeah I thought about the Autocast option, that would make the unit die at the start of the battle though right?

No... only if they actually die in battle.

Quoting abob101,
That works fine for the player because they will understand... but it kinda adds another handicap on the AI because it own't understand that the unit might as well be left in the city or retired. The AI will likely have the unit wander around costing maintenance or whatever then eventually though it into battle leading some stack only to die before it does anything. Not knocking the solution, it's about the only option it seems... but that would be the drawback to it right

In actual practice the AI only does autoresolving and since I cannot fix that issue with autoresolve feature, there is no handicap or pain to the AI. It gets to play with the rules that its henchmen will only get injured.

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 8:31:07 PM from Elemental Forums Elemental Forums

Oh, I see! Instead of having a useless unit have a fully functional unit but that only will be able to fight one last time. Perhaps is an interesting way of addressing things.

Alternatively I don't know if the AI is Smart enough to disband a unit that has only 1 HP and is marked as having a very low combat rating.

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 8:50:31 PM from Elemental Forums Elemental Forums

Quoting OliverFA_306,
Alternatively I don't know if the AI is Smart enough to disband a unit that has only 1 HP and is marked as having a very low combat rating.

I thought about the 1 hp thing, and didn't actually do that. It's just 1 last hurrah for that champion. In fact, one could implement this system for champions in general. Add it as one of the injuries... if they get it you really want to heal it.

Reason for Karma (Optional)
Successfully updated karma reason!
April 18, 2013 9:45:10 PM from Elemental Forums Elemental Forums

This is actually another way a strategic autocast would be useful.

Reason for Karma (Optional)
Successfully updated karma reason!
April 19, 2013 2:23:42 AM from Elemental Forums Elemental Forums

Quoting halmal242,

This is actually another way a strategic autocast would be useful.

+1

Reason for Karma (Optional)
Successfully updated karma reason!
April 19, 2013 2:25:54 AM from Elemental Forums Elemental Forums

Quoting parrottmath,

Quoting OliverFA_306, reply 12Alternatively I don't know if the AI is Smart enough to disband a unit that has only 1 HP and is marked as having a very low combat rating.

I thought about the 1 hp thing, and didn't actually do that. It's just 1 last hurrah for that champion. In fact, one could implement this system for champions in general. Add it as one of the injuries... if they get it you really want to heal it.

Sounds good! Actually is a cool way to overcome a limitation  Instead of calling the injury "Permanent Death" it could be called "Fatal wound".

Reason for Karma (Optional)
Successfully updated karma reason!
April 25, 2013 4:39:21 PM from Elemental Forums Elemental Forums


I found a much much easier method to give champions permanent death without having to resort to complicated game mechanics.

Just create a spell that adds the Permanent Death tag to the champion, and autocast the spell at the start of every combat. If the Champion survives, nothing happens. If the champion dies, dies forever.

Reason for Karma (Optional)
Successfully updated karma reason!
April 25, 2013 4:57:37 PM from Elemental Forums Elemental Forums

This may sound...you know...horrible but I'd love to see a spell that took a champion's overall level of experience and distributed it equally to all remaining champiosn in exchange for....you know, its permanent death? Sort of a retiring. Is that too ghoulish?

Reason for Karma (Optional)
Successfully updated karma reason!
April 25, 2013 5:00:48 PM from Elemental Forums Elemental Forums

I am liking this idea, though it doe sound rather ghoulish and might be a Death Magic spell only or maybe black quagmire ish.

Reason for Karma (Optional)
Successfully updated karma reason!
April 25, 2013 5:13:58 PM from Elemental Forums Elemental Forums

Quoting Frogboy,

This may sound...you know...horrible but I'd love to see a spell that took a champion's overall level of experience and distributed it equally to all remaining champiosn in exchange for....you know, its permanent death? Sort of a retiring. Is that too ghoulish?

That's a really cool idea, but... How can you target the remaining champions?

To my knowledge, this spell would need to do the following things:

- Calculate the total champion XP (achieved levels plus XP gained towards the next level). That can be done

- Calculate how many champions are in the kingdom/empire other tan the sacrified champion. I would do that with an A_ADDITIVE_NumChampions resource

- Calculate the Split by dividing the sacrified champion's XP between the reamining champions. We can do that as we have both numbers.

BUT...

To my knowledge there is no way to target the other champions. They can be anywhere in the map, and there is no command in the XML that allows to target them. At most maybe we could target the remaining champions in the same tile.

I hope I am proved wrong, because that would open lots of possibilities, not only for this spell but for many others.

Reason for Karma (Optional)
Successfully updated karma reason!
April 25, 2013 5:16:04 PM from Elemental Forums Elemental Forums

You wouldn't target other Champions.

You'd cast it on the champ you want to die.

And then its XP gets distributed.

Reason for Karma (Optional)
Successfully updated karma reason!
April 25, 2013 5:41:38 PM from Elemental Forums Elemental Forums


Yes, but in order to distribute its XP, you need to modify the "destination" champions' stats. That's what I don't know how to do. The spell is targeted at the sacrified champion, but the receiving champions need to be targeted by the spell (not the player) to distribute the XP among them.

Perhaps those XP could be left in some kind of pool and the destination champions would be receiving them via an autocast battle spell, but this would be a very strange mechanic.

Reason for Karma (Optional)
Successfully updated karma reason!
April 25, 2013 5:47:52 PM from Elemental Forums Elemental Forums

Couldn't an "All Champions" target work the same way an "All Cities" or "All Armies" effect/target already work in some sense?

Reason for Karma (Optional)
Successfully updated karma reason!
April 25, 2013 6:41:49 PM from Elemental Forums Elemental Forums

Quoting OliverFA_306,


I found a much much easier method to give champions permanent death without having to resort to complicated game mechanics.

Just create a spell that adds the Permanent Death tag to the champion, and autocast the spell at the start of every combat. If the Champion survives, nothing happens. If the champion dies, dies forever.

That is exactly the technique that I employed by the way. Just needed to add a trait to the champion is all.

Reason for Karma (Optional)
Successfully updated karma reason!
April 25, 2013 8:48:41 PM from Elemental Forums Elemental Forums

An attempt at this spell that Frogboy suggests has lead me to the following conclusion. He must be laughing because I've killed my sovereign I don't know how many times trying to get a semblance of this spell to work. In strategic mode, just in case anyone is curious, <ApplyToRadiusCenterOnly> seems to work only for certain spells types.

The only other things that I can think of to accomplish this is to work it in two different spells. The first spell would kill the champion and give an item to the sovereign, which stores the essence of the champion sacrificed (although I don't know how to store levels or give an item that is level dependent of the champion who died), and then use that item to distribute the XP to all champions on the map.

I'll have to think on this further if I want to try to produce this effect, but at the moment, strategic spell calculations do not reliably work at the moment (bug??) as several core spells use these calculations, but don't actually work because of this calculation problem.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #101114  walnut1   Server Load Time: 00:00:00.0000188   Page Render Time: