Moving horse resources from point A to point B in game with a unit

Noroh

Chieftain
Joined
Oct 11, 2015
Messages
7
I want to create a Horse Thief unit based on the Scout for the Comanche civ I'm modding into BNW. However I'm lost on how to proceed. I want them to be able to remove horse resources from one tile, move any distance I wish, and place the horses on an empty tile. Does anyone know how this can be accomplished? Please and thank you! :)
 
Thanks! :D
I would like to make the Horse Thief a replacement for the scout, but I can't seem to edit any of the XML traits of your Herdsman, am I messing something up?
 
It seems like all the unit info is in the actual lua files, at least I can't find any XML references, help? :confused:
 
It seems like all the unit info is in the actual lua files, at least I can't find any XML references, help? :confused:

The unit definitions are in XML/UnitsHerdsmen.xml

However, if you're thinking that you can just tweak a couple of XML settings to achieve what you want, then you're seriously out of luck. Moving resources requires significant Lua coding (you have to allow for the tile being owned, worked and/or locked by a city), and you're going to need to work out which bits of that mod you need to port over to your own Scout replacement unique unit to achieve the effect you want.
 
Ah, I see the problem, I just downloaded the file directly and tried to mess with it, do I have to put it in the Civ V mod folders and start it first? I figured I could take your herdsmen and basically rename them as scouts, not letting any other civ have them and getting rid of the scouts for the Comanche.
 
That's all possible, but you'll need to rework the main herdsmen unit as a UU for the Comanche - which could be as simple as changing its UnitClass and adding an override for the civ ... but it's been a long time since I've look into that code, so you'll have to check that there are no dependencies in the Lua on things you're changing in the XML
 
So...I've never done anything like lua before, and I have no prior experience with programming or code, how do I look at the Lua files?
 
So, if I read the code correctly, the way you were able to differentiate between the Herders having or lacking horses was by changing the unit style from non-combat to combat, right? So could I change the initial state to a combat unit and have it shift to a non-combat unit, then define the combat unit as being a scout?
 
Back
Top Bottom