maconnolly
Warlord
- Joined
- Jun 3, 2019
- Messages
- 209
Evening all. I hope this community can help.
I am attempting to create myself a mod - as much to learn the structure as to harness the improvements to gameplay. To this end, I've set myself a task of creating a new civilization, with a leader. The makeup follows a fairly simplistic/vanilla pattern - the civilization has a Unique Ability, Unique Unit and Unique Improvement. On top of this, the leader has a Unique Ability.
Civilization UA: Let the Gods feed us!
Civilization UU: Werejaguar
Civilization UI: Colossal Head
Leader UA: Fear not exploration, for God will guide us
At this stage, there are no graphical elements to this mod - which is why there is an absence of these in the screenshots below.
Disclaimer: This is in no way intended to plagiarise the work of Durkle - who I note has uploaded the Olmec Empire to the Steam Workshop. I began creating this prior to realising their mod existed and my intention is simply to learn; not to publish. If the author does read this - I have shamelessly copied your Unique Improvement idea/code simply to get that 'in' and working.
On to my situation. As far as I can tell, the unique civilization items (Ability, Unit and Improvement) all work fine. I haven't tested them all in-game, but I can get into the game with those things 'active' and seemingly functional. Through many iterations, I could not get the Leader_UA.sql file to load correctly. In this scenario, the game starts fine, albeit without this Leader UA activated.
You'll note from the below that only the Civilization UA has loaded; this screenshot was taken from one of the various iterations where the Leader UA generated an error:
Having iterated dozens of times, I believe I've finally got my SQL syntax accurate. Various missing commas later, none of the files generate any errors in either Database.log or Modding.log.
The leader UA, however, causes my game to crash to desktop within a second or two of arriving at the leader/loading screen. As illustrated in the screenshot below, I think all of the elements of the mod are loading fine from a syntax point of view, as they all appear on the screen:
If my logic is right up until this point, then I think there's simply some tragic failure of mine to stitch together the various INSERT functions. After staring at this for hours, spread across multiple days, my brain is broken enough that I'm reaching out here for help. What you'll see below in my full Leader_UA.sql code is a mish-mash of different INSERT functions that equal a near-immediate crash. I've probably ended up going down numerous rabbit-holes when a simple reference to the ALPINE_TRAINING_IGNORE_HILLS is what I am after.
My goal is simply to grant Settlers and Builders the ability to ignore the movement penalties imposed by hills. Even whilst writing this, I realise a few mistakes/assumptions I have made to this point:
1. CLASS_LANDCIVILIAN includes a number of unit types beyond Settlers/Builders. This is an assumption I made and I only checked which units are part of this class as I wrote this.
2. I haven't actually tried to point to the ALPINE_TRAINING_IGNORE_HILLS ModifierID that exists in the game. I followed a guide/post (clearly not very well) that I found yesterday and ended up with my convoluted mess below. My fault, not the guide's.
At this stage, I will gladly take someone offering up the right way to do this, with example code or actual code. I would equally be grateful for any advice/pointers/tips, however non-specific, as clearly I don't know what I am doing.
I am attempting to create myself a mod - as much to learn the structure as to harness the improvements to gameplay. To this end, I've set myself a task of creating a new civilization, with a leader. The makeup follows a fairly simplistic/vanilla pattern - the civilization has a Unique Ability, Unique Unit and Unique Improvement. On top of this, the leader has a Unique Ability.
Civilization UA: Let the Gods feed us!
Civilization UU: Werejaguar
Civilization UI: Colossal Head
Leader UA: Fear not exploration, for God will guide us
At this stage, there are no graphical elements to this mod - which is why there is an absence of these in the screenshots below.
Disclaimer: This is in no way intended to plagiarise the work of Durkle - who I note has uploaded the Olmec Empire to the Steam Workshop. I began creating this prior to realising their mod existed and my intention is simply to learn; not to publish. If the author does read this - I have shamelessly copied your Unique Improvement idea/code simply to get that 'in' and working.
On to my situation. As far as I can tell, the unique civilization items (Ability, Unit and Improvement) all work fine. I haven't tested them all in-game, but I can get into the game with those things 'active' and seemingly functional. Through many iterations, I could not get the Leader_UA.sql file to load correctly. In this scenario, the game starts fine, albeit without this Leader UA activated.
You'll note from the below that only the Civilization UA has loaded; this screenshot was taken from one of the various iterations where the Leader UA generated an error:
Spoiler :
Having iterated dozens of times, I believe I've finally got my SQL syntax accurate. Various missing commas later, none of the files generate any errors in either Database.log or Modding.log.
The leader UA, however, causes my game to crash to desktop within a second or two of arriving at the leader/loading screen. As illustrated in the screenshot below, I think all of the elements of the mod are loading fine from a syntax point of view, as they all appear on the screen:
Spoiler :
If my logic is right up until this point, then I think there's simply some tragic failure of mine to stitch together the various INSERT functions. After staring at this for hours, spread across multiple days, my brain is broken enough that I'm reaching out here for help. What you'll see below in my full Leader_UA.sql code is a mish-mash of different INSERT functions that equal a near-immediate crash. I've probably ended up going down numerous rabbit-holes when a simple reference to the ALPINE_TRAINING_IGNORE_HILLS is what I am after.
My goal is simply to grant Settlers and Builders the ability to ignore the movement penalties imposed by hills. Even whilst writing this, I realise a few mistakes/assumptions I have made to this point:
1. CLASS_LANDCIVILIAN includes a number of unit types beyond Settlers/Builders. This is an assumption I made and I only checked which units are part of this class as I wrote this.
2. I haven't actually tried to point to the ALPINE_TRAINING_IGNORE_HILLS ModifierID that exists in the game. I followed a guide/post (clearly not very well) that I found yesterday and ended up with my convoluted mess below. My fault, not the guide's.
Spoiler :
Code:
-----------------------------------------------
-- Types
-----------------------------------------------
INSERT INTO Types
(Type, Kind )
VALUES ('TRAIT_LEADER_FEAR_NOT_EXPLORATION', 'KIND_TRAIT' ),
('ABILITY_PO_NGBE_IGNORE_TERRAIN_COST', 'KIND_ABILITY' );
-----------------------------------------------
-- TypeTags
-----------------------------------------------
INSERT INTO TypeTags
(Type, Tag )
VALUES ('ABILITY_PO_NGBE_IGNORE_TERRAIN_COST', 'CLASS_LANDCIVILIAN' );
-----------------------------------------------
-- UnitAbilities
-----------------------------------------------
INSERT INTO UnitAbilities
(UnitAbilityType, Name, Description, Inactive )
VALUES ('ABILITY_PO_NGBE_IGNORE_TERRAIN_COST', 'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_NAME', 'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_DESCRIPTION', 0 );
-----------------------------------------------
-- Note on above: Have attempted executing without the use of the 'Inactive' column and produces same result.
-----------------------------------------------
-----------------------------------------------
-- UnitAbilityModifiers
-----------------------------------------------
INSERT INTO UnitAbilityModifiers
(UnitAbilityType, ModifierID )
VALUES ('ABILITY_PO_NGBE_IGNORE_TERRAIN_COST', 'MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST' );
-----------------------------------------------
-- Modifiers
-----------------------------------------------
INSERT INTO Modifiers
(ModifierId, ModifierType, RunOnce, Permanent )
VALUES ('MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST', 'MODIFIER_PLAYER_UNITS_GRANT_ABILITY', 1, 1 );
-----------------------------------------------
-- ModifierArguments
-----------------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES ('MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST', 'AbilityType', 'ABILITY_PO_NGBE_IGNORE_TERRAIN_COST' );
-----------------------------------------------
-- TraitModifiers
-----------------------------------------------
INSERT INTO TraitModifiers
(TraitType, ModifierId)
VALUES ('TRAIT_LEADER_FEAR_NOT_EXPLORATION', 'MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST');
-----------------------------------------------
-- Traits
-----------------------------------------------
INSERT INTO Traits
(TraitType, Name, Description )
VALUES ('TRAIT_LEADER_FEAR_NOT_EXPLORATION', 'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_NAME', 'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_DESCRIPTION' );
-----------------------------------------------
-- LeaderTraits
-----------------------------------------------
INSERT INTO LeaderTraits
(LeaderType, TraitType )
VALUES ('LEADER_MC_PO_NGBE', 'TRAIT_LEADER_FEAR_NOT_EXPLORATION' );
At this stage, I will gladly take someone offering up the right way to do this, with example code or actual code. I would equally be grateful for any advice/pointers/tips, however non-specific, as clearly I don't know what I am doing.
Last edited: