New spells
I would like to create a few new spells that allow my custom heroes to control creatures of the same type as their king type. How would you discern the spells ability to see what animal is which.
I would like to create a few new spells that allow my custom heroes to control creatures of the same type as their king type. How would you discern the spells ability to see what animal is which.
<SpellTargetCreatureType>Elemental</SpellTargetCreatureType>
I think you might have to add a few new tags to the creatures themselves to discern between wolves, bears, and such as these are all classified as beasts. Might look at background stats that heavenfall uses and add them to the appropriate creatures. Without careful application this will make your mod incompatible with heavenfalls.
Ya, thats great! Thanks guys! Yes, the goal is to make as many mods inter-fuctional as possible
Be aware that you cannot strictly speaking create new types of monsters using <SpellTargetCreatureType>.
What you can do is give all the appropriate unittypes a new unitstat, and then have the spell use that unitstat to work. HOWEVER, this would not prevent someone from casting a spell on a target if it doesn't have the unitstat. Checking target unitstats can only be done after the spell has been cast.
.........Im confused.
The Tame spell has this
<SpellTargetCreatureType>Beast</SpellTargetCreatureType>
meaning it can only be used on unittypes with
<CreatureType>Beast</CreatureType>
However, you cannot create new "classes" of monsters like this. You cannot just switch out "Beast" in those two lines with "Beast_Bear" or something.
That makes sense!
<SpellTargetCreatureType>Snake</SpellTargetCreatureType>
You mean like this?
Yes, that does not work.
Hm.....so I need to find another way.
What Heavenfall is saying is that if you want to create a spell "Charm Snake," you would need to create a spell that targets Beasts (has <SpellTargetCreatureType>Beast</SpellTargetCreatureType> in the spell XML). Then you'd need that spell's success to depend on a UnitStat of that creature (let's call this UnitStat_IsSnake, which is 1 for snakes and 0 for anything else).
After you created this spell, you'd then need to define UnitStat_IsSnake (see CoreUnitStats.XML for how this is done), remembering to set the default value to 0 since in my example we want snakes to have UnitStat_IsSnake = 1 and non-snakes to have UnitStat_IsSnake = 0 for everything else. Then, you'd need to modify the creature definitions for all the Beast-type creatures you consider to be snakes to have them set UnitStat_IsSnake to 1 (like this: <UnitStat_IsSnake>1</UnitStat_IsSnake>); definitions for monster creatures are mostly in CoreMonsterUnitTypes.XML.
Alternatively, you could remove the restriction on valid target creature types and then just tie the success or failure of the spell to whether or not the target unit has UnitStat_IsSnake = 1. You'd still need to create UnitStat_IsSnake and set the default value as well as the correct value for anything that isn't a snake.
If you wanted to create multiple such spells (Charm Snake, Dominate Dragon, Bind Bear, etc), it would be cleaner and easier to create a single unit stat, say UnitStat_CreatureType (assuming this doesn't conflict with anything), and have that be 1 for snakes, 2 for dragons, 3 for bears, 4 for trolls, and so on. Then each of your spells could have their success or failure dependent on having the correct value for UnitStat_CreatureType. However, I don't know how the success or failure based on UnitStats is done, so I can't say for certain whether or not this would work. This combined UnitStat would also result in having to add the tag to a lot of creatures, but you'd still have to do roughly the same amount of work for separate UnitStats, and having lots of UnitStats increases the chances of conflicting with other mods or existing but hidden UnitStats (I don't know if there are any).
The other part of what Heavenfall said is that if you make the spell success or failure dependent on the target's UnitStats, you could waste mana targeting creatures that can never be affected by the spell since you cannot use UnitStats to mark different units as valid or invalid targets for a spell. Using Charm Snake as an example, even though Charm Snake only works on creatures with UnitStat_IsSnake = 1, I can still cast it on creatures with UnitStat_IsSnake = 0, and you probably won't be able to see that UnitStat anywhere. Thus, if you decide to go with the UnitStat_IsSnake or UnitStat_CreatureType route for your spells, you should probably make certain that there is a clear distinction that the player can see between what the spell works on and what the spell doesn't work on (unless your mod is for your personal use only, then whatever works for you is fine). For instance, if I make a spell that lets me take Trolls but not Ogres, and all I say in the spell description is that the spell allows me to "control some large humanoid monsters," there's a problem. With the example of snakes, there probably isn't much of an issue, as long as you remember to mark all of the snake-like creatures with the proper UnitStats, but for some other things there could be issues of how to properly communicate what the valid targets are.
THANK YOU! IT ALL MAKE SENSE!
I was griping about this a lot in FE Modding before LH came out. I also wanted to devise a control spell targeting the Subtype [Bears, Spiders, Wolves, etc] which wasn't possible in FE. I'd hoped they'd come up with a fix in LH, unfortunately not.
Welcome Guest! Please take the time to register with us.