[GS] Adding hotkeys for unit promotion/upgrade/pillage..

SongAdieu

Chieftain
Joined
Feb 15, 2017
Messages
6
Trying to apply hotkeys for unit promotions/upgrading/pillaging/forming armies+corps.
Currently stuck in a situation where part of the mod doesn't function properly due to what I think has to do with my .modinfo file.

I was able to get it to show in the Options > Keybindings section (so each hotkey can be changed).
However, these two files aren't being read correctly in the .modinfo file that I've created.
-UnitCommands.xml
-UnitOperations.xml
--their default location: ...\Base\Assets\Gameplay\Data\..

If anyone can help me understand why these aren't being read, I've tried different variations of placement in the .modinfo with the most recent changes of adding LoadOrder (which I'm not entirely sure how this works ~ just seen it in many other mods).

I'll upload my progress so far, for anyone interested in helping me finish this mod.

Discord: @[Godly] je#6276
 

Attachments

Your xml files are attempting to re-enter data the game already has. For example, the game already has "KIND_UNITCOMMAND" registered within table <Kinds>. You cannot therefore attempt to re-enter the same "Kind" value as you are attempting here:
Code:
<Kinds>
<Row Kind="KIND_UNITCOMMAND"/>
</Kinds>
This causes a fatal unique constraint error at the very top of your file, and the game ceases to execute anything further within that file. Since you have this basic mistake in all your xml files as far as I can see, none of your UpdateDatabase actions survive being loaded into the game's databases.

  1. Table "Kinds" requires that each new row added to the table must have a unique argument-data for column "Kind=". Repeats of "KIND_SOMETHINGS" already registered within the table are not allowed.
  2. Table "Types" requires that each new row added to the table must have a unique argument-data for column "Type=". Repeats of Type="SOMETHING_SOMETHING" already registered within the table are not allowed.
  3. Table "UnitCommands" requires that each new row added to the table must have a unique argument-data for column "CommandType=". Repeats of "UNITCOMMAND_SOMETHINGS" already registered within the table are not allowed.
  4. The other tables you are writing data to also have the same type of uniqueness requirements.
Database.log will be reporting errrors for Unique Constraint Errors stemming from your xml code.

In order to alter data within a row the game aleady has defined within a table, either an <Update> or <Replace> is needed instead of a <Row> syntax.
 
Your xml files are attempting to re-enter data the game already has. For example, the game already has "KIND_UNITCOMMAND" registered within table <Kinds>. You cannot therefore attempt to re-enter the same "Kind" value as you are attempting here:
Code:
<Kinds>
<Row Kind="KIND_UNITCOMMAND"/>
</Kinds>
This causes a fatal unique constraint error at the very top of your file, and the game ceases to execute anything further within that file. Since you have this basic mistake in all your xml files as far as I can see, none of your UpdateDatabase actions survive being loaded into the game's databases.

  1. Table "Kinds" requires that each new row added to the table must have a unique argument-data for column "Kind=". Repeats of "KIND_SOMETHINGS" already registered within the table are not allowed.
  2. Table "Types" requires that each new row added to the table must have a unique argument-data for column "Type=". Repeats of Type="SOMETHING_SOMETHING" already registered within the table are not allowed.
  3. Table "UnitCommands" requires that each new row added to the table must have a unique argument-data for column "CommandType=". Repeats of "UNITCOMMAND_SOMETHINGS" already registered within the table are not allowed.
  4. The other tables you are writing data to also have the same type of uniqueness requirements.
Database.log will be reporting errrors for Unique Constraint Errors stemming from your xml code.

In order to alter data within a row the game aleady has defined within a table, either an <Update> or <Replace> is needed instead of a <Row> syntax.


Thank you for a very detailed help guide which explains a few things.I will definitely make these changes.
 
It is now a working mod.. amazing, and thank you so much for your help. Would you like to be a known contributor for this mod, I +
 
It is now a working mod.. amazing, and thank you so much for your help. Would you like to be a known contributor for this mod, I +

Did you ever release this? I was trying to hobble together a similar hotkey mod for unit commands. Clicking the aerial attack button each time was maddening me.
 
I am tired of waiting until someone creates this mod... And created it myself. You can find the mod named "Extra Hotkeys" in the steam workshop that adds hotkeys for actions like pillage, upgrade unit, promote unit, form corps/army, create/exit escort, etc.
This mod uses SQL and doesn't modify Lua files of the game.
 

Attachments

Back
Top Bottom