[Help] Unit building tied to City type and level

This is the basic

<Prereq>
<Type>Race</Type>
<Attribute>Race_Type_Urxen</Attribute>
</Prereq>
<ProductionRequirement>
<Type>Resource</Type>
<Attribute>Mana</Attribute>
<Value>1</Value>
</ProductionRequirement>

But how to add so unit can only be built in a fortress at lvl 3 .. as an example 

 

Edit : Typo

8,653 views 9 replies
Reply #1 Top

I don't know.

Reply #2 Top

I was hoping you did :) perhaps after the game is released more info on modding is released

Reply #3 Top

There's lots of things I don't know. seanw3 maybe knows. Otherwise you should try to make it work yourself.

Reply #4 Top

I bet you can do it. I would first try having the level 3 fortress cityhub (called Cityhub3_Fortress) in the improvements xml add a resource to your city. You can make it produce 10 or so "Awesome Knights of Zantor." That resource would be used for every soldier in the unit you train of the special unit you want. You would need to make the unit and set it up just like the trained monsters we have. It's a little more complicated to actually make the unit. There are some tags you will want to add to make it something you train as opposed to something that trains automatically like mercenaries and trolls and such. You also need to make it allow grouping. Once you finish the basic stuff, I can take a look at your code. Just link it here. 

Reply #5 Top

Thanks!, ill play around with it and see 

Reply #6 Top

but if its a resource then the city would allow to build, but everywhere

 

you need to put a requirement somewhere

Reply #7 Top

Resources can be local, like population. seanw3 actually has a really clever way to accomplish what OP wanted.

Reply #8 Top

Why thank you. High praise from the mod king!  \o/

Reply #9 Top

nice, local resources are interesting, many things are doable with that

maybe some magic tower shooting in the area or ammo for city defenses