MikeBriceno
Skirmisher
posted 09-14-17 12:50 PM EDT (US)
Hello everyone,
Im modding the Japanese Civ right now and I wanted to ask if it is possible to add new >UnitType< to a certain units, such as Samurai or Naginata, etc. I wanted to add this AbstractJapanese for purposes of new Tech that will affect such units.
Is it possible? I added it to the Japanese units and somehow the tech doesnt work when the tech effect make them have more HP. I wonder if that is possible to add these new unittypes or if I need to modify something else in the game files.
Please help me out. I appreciate the help.
SkyOne578
Skirmisher
posted 09-15-17 05:52 AM
EDT (US)
1 / 9
Hello MikeBriceno!
Normally, that would work. The only cases where it doesn't work would be the small icons in the info UI (when you press Alt while a unit is being selected), some XS-related things like AI scripts, triggers and Random Map scripts, and maybe some more things like abilities + powers. In these cases, there is no way to make the game engine to recognize the new unit types — however, the unhardcode patch will add a feature in the future, which consists of letting the modders to define new unit types. But in other cases like protoy.xml and techtreey.xml, new unit types work. I mean, in theory that would work, but I have tested it only with the game without expansion (proto.xml and techtree.xml), I didn't test it with The Asian Dynasties. If you need further help, please let me know.
I hope I helped you! ;-)
SkyOne578
Skirmisher
posted 09-17-17 07:17 AM
EDT (US)
3 / 9
OK, now I understand what you're trying to do. In my opinion, enabling an action from the techtree by mentioning a unit type is kind of impossible, since the tactics files themselves are added to each proto unit instead of the generic unit type. However, it would be wiser to test your code with an existing unit type (e.g. AbstractInfantry), just to see if the limitation applies only to custom unit types.
Concerning the abilities, you cannot add ability to generic unit types, you need to mention each proto unit, one by one.
MikeBriceno
Skirmisher
posted 09-17-17 11:28 AM
EDT (US)
4 / 9
Thanks again SkyOne578,
That makes sense. I'm glad you answered.
Ok... I managed to make the game to recognize the new AnstractJapaneseWarrior unit type and it heals units with the JapaneseWarrior unit type. I did the change on an already existing unit to test it, I used the Japanese monk. He heals units with the japaneseWarrior unit type and not the logicaltypehealed unit type, which is good.
My next goal is to give ranged attack to some Japanese buildings in a late state of the game with a tech the shogun tokugawa will grant. In that I wanna used the AbstractJapanese unit type that I placed on some buildings. Hopefully it will work.
However, I'm really having a hard time in editing the tactic file for the barracks, I.e. As the aren't much tutorials around and the ones I've done have been done by me in try and error. Hopefully you'll do one soon.
Lv, Mike
SkyOne578
Skirmisher
posted 09-17-17 12:10 PM
EDT (US)
5 / 9
I already gave you a link in the Dojo post. I really hope it will help you!
MikeBriceno
Skirmisher
posted 09-20-17 06:22 PM
EDT (US)
7 / 9
Thanks Mister SCP,
Sorry about that. I was having a hard time trying to give ranged attack to the barracks. Finally I added the anim the building was missing, such as ranged attack and anti ship attack animation. Now it does the work I wanted. Thats what I meant when I said having a hard time. But the solution was easy, just that I did not know at that time.
However, if no sure if the AbstractJapanese unit type I did is going to be readable for the game. I was wondering if that is possible, meaning making a new unit type in the proto unit.
Hope you have the answer.
Lv, Mike
MikeBriceno
Skirmisher
posted 09-23-17 09:39 PM
EDT (US)
9 / 9
Thank you Mister SCP,
I really appreciate the help. I will let you know if anything else arise. Thanks.
LV, Mike