Adding a unit action?

Lynxbrutal

Chieftain
Joined
May 19, 2015
Messages
17
I'm in the process of adding a "claim" function to scouts. I have it properly initialized everywhere, but I can't find how to add an action button for it. For example, how the pillage and upgrade missions have a button when you select the unit. How do I add a button like this?
 
I believe you will have to edit the UnitPanel and UnitPanel_small XML files, as well as the UnitPanel Lua file, and have them imported into VFS to override the stock ones.

Note that this will make your mod incompatible with any other mod which has its own UnitPanel replacement, and that the AI will be unable to utilize this new mission unless you've coded the logic for it into your mod.
 
Alright, we've found the files you spoke of but can't figure out which one has the action buttons and/or how to add one.
 
You can probably start with whoward's UI tutorials if you want to be able to understand the files and how to make changes. Otherwise, you can attempt to look at existing mods who have already modified the Unit Panels to see if you can make sense of what to change.
 
Top Bottom