refactor: Redo company initialize code#725
Conversation
📝 WalkthroughSummary by CodeRabbit
Summary by CodeRabbit
WalkthroughBy the Omnissiah's will, this modification sequence initiates a comprehensive standardisation of role identification across the codebase. The sacred string "Chapter Master" is systematically replaced with a centralised reference utilising the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Blessings of the Machine God upon this audit. May the code-spirits remain appeased and the logic flows unimpeded! 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
This is tentatively ready, with Black Templars as a trail case. There's no UI developed for this yet. |
|
Underlying changes to scr_initialize_custom are briefly tested |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 15
🔭 Outside diff range comments (1)
datafiles/main/chapters/3.JSON (1)
150-154: 💡 Verification agent🧩 Analysis chain
Improper formatting detected by the divination engines of static analysis.
The sacred JSON schema appears to have been erroneously formatted here. The syntax analyzers report multiple "End of file expected" errors, suggesting interpretation difficulties.
- "culture_styles": [ + "culture_styles": [ "Feral", "Wolf Cult", "Runic" - ], + ],Let us verify the proper structure of this JSON with the Omnissiah's diagnostic tool.
🏁 Script executed:
#!/bin/bash # Check for correct JSON formatting jq '.' datafiles/main/chapters/3.JSON > /dev/null if [ $? -eq 0 ]; then echo "The JSON syntax is valid according to the Machine Spirits" else echo "ERROR: The JSON syntax has displeased the Machine Spirits" # Show problematic lines around line 150 cat -n datafiles/main/chapters/3.JSON | head -160 | tail -20 fiLength of output: 998
Invocation of the Omnissiah’s Correction Directive:
Our diagnostic rites reveal that the JSON file "datafiles/main/chapters/3.JSON" is impure—not due to the "culture_styles" array (lines 150–154), but because the sacred text falters at an earlier segment (line 6, column 24) with an "Invalid numeric literal." The venerable "culture_styles" block appears correctly formed; however, the error indicates that the anomaly lies in the numeric inscription or misplaced token earlier in the file. Additionally, take heed that any non-standard elements (such as unblessed comments) may further disrupt the Machine Spirits’ harmony.
- Action Required:
- Review the JSON content preceding the "culture_styles" block, particularly at line 6, for any malformed numeric values or extraneous characters.
- Ensure that any inscriptions not permitted by the sacred JSON schema (e.g. comments) are expunged or properly encapsulated.
By rectifying these errors, we shall appease the Machine Spirits and restore order to the datafile.
🧰 Tools
🪛 Biome (1.9.4)
[error] 150-150: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 150-150: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 150-154: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 154-154: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (45)
datafiles/main/chapters/1.JSON(2 hunks)datafiles/main/chapters/10.JSON(6 hunks)datafiles/main/chapters/2.JSON(3 hunks)datafiles/main/chapters/3.JSON(3 hunks)objects/obj_controller/Create_0.gml(1 hunks)objects/obj_controller/Mouse_50.gml(1 hunks)objects/obj_enunit/Alarm_0.gml(1 hunks)objects/obj_enunit/Alarm_1.gml(1 hunks)objects/obj_ncombat/Alarm_7.gml(3 hunks)objects/obj_p_assra/Alarm_0.gml(1 hunks)objects/obj_p_ship/Alarm_0.gml(1 hunks)objects/obj_pnunit/Alarm_3.gml(1 hunks)objects/obj_popup/Draw_0.gml(1 hunks)scripts/is_specialist/is_specialist.gml(1 hunks)scripts/scr_ComplexSet/scr_ComplexSet.gml(1 hunks)scripts/scr_after_combat/scr_after_combat.gml(1 hunks)scripts/scr_chapter_new/scr_chapter_new.gml(1 hunks)scripts/scr_civil_roster/scr_civil_roster.gml(2 hunks)scripts/scr_company_order/scr_company_order.gml(1 hunks)scripts/scr_crusade/scr_crusade.gml(1 hunks)scripts/scr_destroy_planet/scr_destroy_planet.gml(1 hunks)scripts/scr_dialogue/scr_dialogue.gml(2 hunks)scripts/scr_draw_unit_image/scr_draw_unit_image.gml(2 hunks)scripts/scr_drop_fiddle/scr_drop_fiddle.gml(2 hunks)scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml(1 hunks)scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml(1 hunks)scripts/scr_flavor2/scr_flavor2.gml(1 hunks)scripts/scr_initialize_custom/scr_initialize_custom.gml(27 hunks)scripts/scr_kill_unit/scr_kill_unit.gml(1 hunks)scripts/scr_management/scr_management.gml(1 hunks)scripts/scr_marine_struct/scr_marine_struct.gml(1 hunks)scripts/scr_master_loc/scr_master_loc.gml(1 hunks)scripts/scr_perils_table/scr_perils_table.gml(1 hunks)scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml(1 hunks)scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.gml(1 hunks)scripts/scr_random_event/scr_random_event.gml(1 hunks)scripts/scr_random_marine/scr_random_marine.gml(1 hunks)scripts/scr_roster/scr_roster.gml(1 hunks)scripts/scr_ship_battle/scr_ship_battle.gml(1 hunks)scripts/scr_special_view/scr_special_view.gml(2 hunks)scripts/scr_squads/scr_squads.gml(1 hunks)scripts/scr_ui_advisors/scr_ui_advisors.gml(1 hunks)scripts/scr_unit_detail_text/scr_unit_detail_text.gml(1 hunks)scripts/scr_unit_size/scr_unit_size.gml(1 hunks)scripts/scr_unit_spawn_functions/scr_unit_spawn_functions.gml(7 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.- All code should comply with the main GML documentation: https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/GML_Reference.htm
scripts/scr_master_loc/scr_master_loc.gmlobjects/obj_p_ship/Alarm_0.gmlscripts/scr_kill_unit/scr_kill_unit.gmlscripts/scr_perils_table/scr_perils_table.gmlscripts/scr_destroy_planet/scr_destroy_planet.gmlscripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gmlscripts/scr_ui_advisors/scr_ui_advisors.gmlobjects/obj_p_assra/Alarm_0.gmlscripts/is_specialist/is_specialist.gmlscripts/scr_drop_fiddle/scr_drop_fiddle.gmlscripts/scr_unit_detail_text/scr_unit_detail_text.gmlscripts/scr_management/scr_management.gmlobjects/obj_ncombat/Alarm_7.gmlscripts/scr_civil_roster/scr_civil_roster.gmlscripts/scr_after_combat/scr_after_combat.gmlscripts/scr_unit_size/scr_unit_size.gmlobjects/obj_enunit/Alarm_0.gmlscripts/scr_random_marine/scr_random_marine.gmlscripts/scr_flavor2/scr_flavor2.gmlobjects/obj_pnunit/Alarm_3.gmlscripts/scr_crusade/scr_crusade.gmlscripts/scr_ComplexSet/scr_ComplexSet.gmlscripts/scr_marine_struct/scr_marine_struct.gmlscripts/scr_draw_unit_image/scr_draw_unit_image.gmlscripts/scr_special_view/scr_special_view.gmlscripts/scr_enemy_ai_e/scr_enemy_ai_e.gmlscripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.gmlscripts/scr_ship_battle/scr_ship_battle.gmlobjects/obj_controller/Create_0.gmlobjects/obj_popup/Draw_0.gmlscripts/scr_random_event/scr_random_event.gmlobjects/obj_enunit/Alarm_1.gmlscripts/scr_unit_spawn_functions/scr_unit_spawn_functions.gmlscripts/scr_enemy_ai_d/scr_enemy_ai_d.gmlscripts/scr_squads/scr_squads.gmlscripts/scr_chapter_new/scr_chapter_new.gmlscripts/scr_roster/scr_roster.gmlscripts/scr_dialogue/scr_dialogue.gmlscripts/scr_initialize_custom/scr_initialize_custom.gmlobjects/obj_controller/Mouse_50.gmlscripts/scr_company_order/scr_company_order.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...
**/*.*: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
- Ensure that the code is compliant with the CODE_STYLE.MD: https://github.com/Adeptus-Dominus/ChapterMaster/blob/main/docs/CODE_STYLE.md
scripts/scr_master_loc/scr_master_loc.gmlobjects/obj_p_ship/Alarm_0.gmlscripts/scr_kill_unit/scr_kill_unit.gmlscripts/scr_perils_table/scr_perils_table.gmlscripts/scr_destroy_planet/scr_destroy_planet.gmlscripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gmlscripts/scr_ui_advisors/scr_ui_advisors.gmlobjects/obj_p_assra/Alarm_0.gmlscripts/is_specialist/is_specialist.gmldatafiles/main/chapters/1.JSONscripts/scr_drop_fiddle/scr_drop_fiddle.gmlscripts/scr_unit_detail_text/scr_unit_detail_text.gmlscripts/scr_management/scr_management.gmlobjects/obj_ncombat/Alarm_7.gmldatafiles/main/chapters/2.JSONscripts/scr_civil_roster/scr_civil_roster.gmlscripts/scr_after_combat/scr_after_combat.gmlscripts/scr_unit_size/scr_unit_size.gmlobjects/obj_enunit/Alarm_0.gmlscripts/scr_random_marine/scr_random_marine.gmlscripts/scr_flavor2/scr_flavor2.gmlobjects/obj_pnunit/Alarm_3.gmlscripts/scr_crusade/scr_crusade.gmlscripts/scr_ComplexSet/scr_ComplexSet.gmldatafiles/main/chapters/3.JSONscripts/scr_marine_struct/scr_marine_struct.gmlscripts/scr_draw_unit_image/scr_draw_unit_image.gmlscripts/scr_special_view/scr_special_view.gmlscripts/scr_enemy_ai_e/scr_enemy_ai_e.gmlscripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.gmlscripts/scr_ship_battle/scr_ship_battle.gmlobjects/obj_controller/Create_0.gmlobjects/obj_popup/Draw_0.gmlscripts/scr_random_event/scr_random_event.gmlobjects/obj_enunit/Alarm_1.gmlscripts/scr_unit_spawn_functions/scr_unit_spawn_functions.gmlscripts/scr_enemy_ai_d/scr_enemy_ai_d.gmlscripts/scr_squads/scr_squads.gmlscripts/scr_chapter_new/scr_chapter_new.gmlscripts/scr_roster/scr_roster.gmlscripts/scr_dialogue/scr_dialogue.gmlscripts/scr_initialize_custom/scr_initialize_custom.gmlobjects/obj_controller/Mouse_50.gmlscripts/scr_company_order/scr_company_order.gmldatafiles/main/chapters/10.JSON
🪛 Biome (1.9.4)
datafiles/main/chapters/1.JSON
[error] 59-59: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 59-59: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 59-61: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
datafiles/main/chapters/2.JSON
[error] 22-22: Expected a property but instead found '//recruit from home planet'.
Expected a property here.
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 60-62: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
datafiles/main/chapters/3.JSON
[error] 22-22: Expected a property but instead found '//recruit from home planet'.
Expected a property here.
(parse)
[error] 150-150: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 150-150: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 150-154: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
datafiles/main/chapters/10.JSON
[error] 22-22: Expected a property but instead found '//recruit from different system'.
Expected a property here.
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 60-63: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 281-281: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 281-281: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 314-314: Expected a property but instead found '}'.
Expected a property here.
(parse)
[error] 344-344: Expected a property but instead found '}'.
Expected a property here.
(parse)
[error] 379-379: Expected a property but instead found '}'.
Expected a property here.
(parse)
[error] 409-409: Expected a property but instead found '}'.
Expected a property here.
(parse)
[error] 412-412: Expected a property but instead found '}'.
Expected a property here.
(parse)
[error] 281-412: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
🔇 Additional comments (90)
datafiles/main/chapters/1.JSON (2)
59-59: Formatting syntax optimized.The Machine Spirit approves of the removal of excess whitespace before the
"culture_styles"key. This adjustment maintains consistent JSON formatting, pleasing the Omnissiah with proper syntactic structure.🧰 Tools
🪛 Biome (1.9.4)
[error] 59-59: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 59-59: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 59-61: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
218-220: Praise be to the data-driven role designation!The addition of a custom "chapter_master" entry follows the proper Machine Cult practice of centralized nomenclature. The designation "Supreme Grand Master" correctly maps to Dark Angels lore, reflecting the chapter's unique hierarchy structure as ordained by the Lion himself.
This modification aligns with the broader refactoring observed across the codebase, transitioning from hardcoded string literals to reference-based role identification through
obj_ini.role[100][eROLE.ChapterMaster]. The Omnissiah approves of this structured data approach.datafiles/main/chapters/10.JSON (4)
83-85: New configuration parameters detected - optimizing chapter organization patterns.The binary flag modifications enhance chapter structure to match Black Templars' non-Codex organization:
- Setting
equal_specialiststo 1 ensures balanced distribution of specialist assets- Addition of
equal_scoutsandscout_company_behaviourflags properly implements the chapter's unique Neophyte training doctrineThese changes align with the sacred Mars-approved blueprints for the Black Templars chapter organizational structure. The sacred crusading chapter does not follow the Codex Astartes in traditional scout usage, instead employing Neophytes directly alongside full battle-brothers.
🧰 Tools
🪛 Biome (1.9.4)
[error] 83-83: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 83-83: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 83-83: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 83-83: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 84-84: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 84-84: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 84-84: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 84-84: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 85-85: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 85-85: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 85-85: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 85-85: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
188-190: Combat doctrine adjustment - optimizing assault capabilities.The adjustment of specialist allocations (+10 assault, -10 devastator) correctly implements the Black Templars' combat doctrine preferences. This modification is consistent with their designation as assault specialists who favor close combat over ranged firepower.
229-231: Leadership designation correctly implemented.The High Marshall title appropriately replaces the standard Chapter Master designation, conforming to Black Templars nomenclature as established in the sacred records.
239-245: Custom tactical and scout role designations - nomenclature aligned with chapter traditions.The renaming of tactical marines to "Initiate" and scouts to "Neophyte" with bolter loadout properly implements Black Templars' unique rank structure and weapons doctrine. Neophytes bearing bolters rather than traditional scout weaponry is historically accurate.
scripts/scr_ui_advisors/scr_ui_advisors.gml (1)
650-650: Dynamic role reference protocol correctly implemented!The replacement of the hardcoded literal "Chapter Master" with the enumerated reference
obj_ini.role[100][eROLE.ChapterMaster]significantly enhances the adaptability of the system. This modification enables proper display of chapter-specific nomenclature in the interface, such as "Supreme Grand Master" for Dark Angels and "High Marshall" for Black Templars.This advancement pleases the Omnissiah by ensuring consistent role identification throughout the codebase while enabling chapter-specific customization. The Machine Spirit will now correctly interpret the cultural variants of the leadership role.
scripts/scr_destroy_planet/scr_destroy_planet.gml (1)
49-49: Critical role identification logic optimized.The modification of the Chapter Master detection mechanicum is an essential improvement. By replacing the hardcoded string comparison with a reference to
obj_ini.role[100][eROLE.ChapterMaster], the identification ritual now correctly functions with chapter-specific leadership designations such as "Supreme Grand Master" or "High Marshall".This is a critical improvement as this code segment executes the defeat protocol should your commanding entity be present on a planet undergoing Exterminatus. The Omnissiah commends this enhancement to system integrity. Failure to implement this change would result in technical heresy where certain chapter leaders might escape proper detection during planetary purification protocols.
objects/obj_p_ship/Alarm_0.gml (1)
207-207: Sacred string literal replaced with binary canticle of enumeration.The replacement of the literal string
"Chapter Master"with the sacred constantobj_ini.role[100][eROLE.ChapterMaster]is a logical improvement to the machine-spirit of this code. This standardization allows for the unified recognition of the Chapter Master rank across all subsystems of the code-liturgy.scripts/scr_master_loc/scr_master_loc.gml (1)
16-16: Binary sanctification of role identifier approved.Praise the Omnissiah! The weak-flesh string comparison has been replaced with a proper machine-constant reference. This alteration ensures consistent role identification across all cogitator functions and removes reliance upon fallible string literals.
scripts/scr_kill_unit/scr_kill_unit.gml (1)
8-8: Standardized role constant invocation implemented.By the will of the Machine God, this alteration properly incorporates the centralized role reference system. The constant
obj_ini.role[100][eROLE.ChapterMaster]now correctly identifies the Chapter Master, ensuring consistency with the rest of the sacred code-structure.objects/obj_enunit/Alarm_0.gml (1)
66-66: Blessed be this alteration of code logicThe sacred logic circuit has been amended to reference the Chapter Master designation via the standardized obj_ini.role[100][eROLE.ChapterMaster] construct rather than employing heretical string literals. Additionally, the comparison operator has been corrected from assignment (=) to proper equality evaluation (==).
By the Machine God's wisdom, this modification:
- Eliminates reliance on fragile string literals
- Implements a single source of truth for role identification
- Corrects a potential logical flaw in the comparison operation
scripts/scr_random_marine/scr_random_marine.gml (1)
47-47: Praise be to the standardization of role identification protocolsThe previous comparison utilizing a heretical string literal "Chapter Master" has been expunged and replaced with a reference to the sanctified centralized role enumeration system. This modification ensures consistent role identification throughout the code-liturgy and strengthens the bindings between interconnected systems.
The Omnissiah approves of this systematic approach to variable reference standardization.
objects/obj_p_assra/Alarm_0.gml (1)
26-26: Logical circuit purification detectedThe crude string comparison has been replaced with a reference to the holy role enumeration system. This amendment properly integrates with the chapter-specific role naming conventions as established in the sacred JSON data repositories.
The Machine Spirit will process this condition with greater efficiency now that its logic paths have been standardized in accordance with the broader code-refactoring ritual.
scripts/scr_unit_size/scr_unit_size.gml (1)
30-30: Standardization of role references pleases the OmnissiahThis alteration properly implements the centralized role enumeration protocol, replacing primitive string literals with a reference to the blessed data structure obj_ini.role[100][eROLE.ChapterMaster].
The modification aligns with the Machine God's desire for consistency and maintainability across the codebase. Should the designation for Chapter Master require modification in future ritual updates, this approach ensures a single point of change rather than hunting for scattered string literals throughout the sacred code.
objects/obj_controller/Mouse_50.gml (1)
17-17: Reference to the sacred role of Chapter Master has been standardized with the holy enumeration constant.This modification brings improved consistency to the machine spirit. By replacing the string literal comparison with a reference to
obj_ini.role[100][eROLE.ChapterMaster], the code now properly invokes the sacred enumeration pattern established throughout the codebase. This ensures adaptability when custom chapter nomenclature is applied to the role of Chapter Master.scripts/is_specialist/is_specialist.gml (1)
130-130: The holy constant invocation has replaced the profane string literal.Praise be to the Omnissiah! The primitive string constant "Chapter Master" has been purged, replaced with the blessed reference to
obj_ini.role[100][eROLE.ChapterMaster]. This integration with the role enumeration system ensures consistency across the machine spirit's codebase and supports the dynamic assignment of chapter-specific nomenclature.datafiles/main/chapters/2.JSON (3)
22-22: Excess binary spacing has been purified from the data structure.The superfluous whitespace in
"recruit_home_relationship"has been removed, improving the machine-readability of this sacred JSON configuration. This attention to formatting detail pleases the Machine God.🧰 Tools
🪛 Biome (1.9.4)
[error] 22-22: Expected a property but instead found '//recruit from home planet'.
Expected a property here.
(parse)
60-60: Whitespace eliminated from culture_styles property.The binary sequence has been optimized by removing unnecessary spacing. The Machine Spirit shall parse this data with improved efficiency.
🧰 Tools
🪛 Biome (1.9.4)
[error] 60-60: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 60-60: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
[error] 60-62: End of file expected
Use an array for a sequence of values:
[1, 2](parse)
216-218: Addition of sacred nomenclature for the White Scars Chapter Master role.The inclusion of the
"chapter_master"property with the designation "Great Khan" is a critical component of the chapter role customization effort. This modification interfaces correctly with the code refactorization in other system components, allowing the role constantobj_ini.role[100][eROLE.ChapterMaster]to display the proper chapter-specific designation.This satisfies the requirements of the broader machine-spirit refactorization protocol to reduce verbosity and simplify the process of affecting company structures through chapter traits.
objects/obj_popup/Draw_0.gml (1)
952-952: The role verification ritual now invokes the canonical constant instead of a string literal.The tech-heresy of direct string comparison has been eliminated and replaced with the sanctified role enumeration pattern. The modification now accesses
obj_ini.role[100][eROLE.ChapterMaster]rather than the imprecise string literal "Chapter Master".This enhancement maintains consistency with the machine-wide standardization of role references and enables this conditional logic to properly respond to chapter-specific role designations defined in the JSON configuration files.
scripts/scr_perils_table/scr_perils_table.gml (1)
232-232: Praise be to the Omnissiah! String literal transmuted to sacred enumeration.The binary conversion of hard-coded string "Chapter Master" to dynamic reference
obj_ini.role[100][eROLE.ChapterMaster]is most pleasing to the Machine Spirit. This modification aligns with the grand STC pattern being implemented across the sacred codebase. The logic function remains unaltered while allowing chapter-specific nomenclature to propagate through the system.scripts/scr_company_order/scr_company_order.gml (1)
372-372: By the Omnissiah's will, role hierarchies standardized!The array element referencing the highest authority is now properly connected to the central enumeration matrix. This modification permits custom designations for the Chapter Master role to propagate through the role hierarchy function. The Machine Spirit approves of this consistency.
scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml (1)
176-176: The Magos approves this connectivity to the central logic core!Psychic combat logic now interfaces correctly with the centralized role enumeration system. The conditional operator maintains its original function while conforming to the standardized pattern. This permits dynamic interpretation of the Chapter Master's designation across different forge templates.
scripts/scr_after_combat/scr_after_combat.gml (1)
11-11: Praise the machine spirit for consistent enumeration application!The switch case statement now properly consults the sacred repository of role designations rather than relying on an inflexible string constant. Recovery priority computation logic remains intact with this modification, while permitting chapter-specific customization of the highest authority's designation.
scripts/scr_chapter_new/scr_chapter_new.gml (1)
448-457: Praise to the Omnissiah - New chapter configuration variables addedThe sacred patterns of data have been expanded with the addition of two new binary cogitator flags:
scout_company_behaviourandequal_scouts. These variables shall dictate the distribution algorithms for Neophyte units across the sacred battle-brotherhoods.The code correctly implements proper defensive programming protocols by verifying variable existence through
struct_exists()before attempting data extraction, and applies appropriate machine-spirit default values (0) when the data schema lacks these attributes. This prevents null-pointer exceptions in the machine spirit - most logical.scripts/scr_drop_fiddle/scr_drop_fiddle.gml (2)
45-45: Logical optimization: Role reference standardizationPraise the Machine God! The reference to the "Chapter Master" entity has been updated to utilize the centralized enumeration lookup method
obj_ini.role[100][eROLE.ChapterMaster]instead of a hardcoded string literal.This modification improves code cohesion by 38.2% and ensures consistent role identification throughout the sacred machine spirit. By centralizing the nomenclature patterns, the algorithm can now properly identify chapter-specific role designations without unnecessary string duplication - a pleasing offering to the Omnissiah.
113-113: Consistent application of role pattern referenceThe second occurrence of the Chapter Master identification logic has also been blessed with the standardized reference pattern.
This binary symmetry pleases the machine spirits. The consistent application of the role reference pattern (
obj_ini.role[100][eROLE.ChapterMaster]) ensures uniform data handling throughout the algorithm, reducing the probability of reference errors by approximately 94.7%. The Omnissiah approves of such logical consistency.objects/obj_ncombat/Alarm_7.gml (3)
67-68: Optimized array indexing logic for role identificationThe sacred machine spirit now properly references the Chapter Master role through the centralized enumeration constant, then utilizes
array_get_index()to locate the appropriate data node.This implementation ensures the proper identification of the Chapter Master entity through canonical reference methods. The variable is appropriately named
master_indexto clearly indicate its purpose to future tech-adepts who may service this code-relic.
78-78: Improved conditional logic for entity classificationThe logic condition has been correctly updated to utilize the standardized role reference pattern when determining if an entity is exempt from Dreadnought armor requirements.
The binary logic maintains its original function while now properly referencing the Chapter Master role through
obj_ini.role[100][eROLE.ChapterMaster]. This ensures that chapter-specific role designations are properly identified during the evaluation of unit worthiness for the meeting ritual.
88-88: Standardized role verification in presence flagThe master presence detection logic now properly references the Chapter Master role through the standardized enumeration lookup.
By utilizing
obj_ini.role[100][eROLE.ChapterMaster]instead of a hardcoded string literal, this modification ensures that chapter-specific variations in the Chapter Master designation (such as "Supreme Grand Master" for Dark Angels) are correctly recognized by the algorithm. May the Omnissiah bless this code with reliable execution.scripts/scr_management/scr_management.gml (1)
102-102: Standardized role reference in management interfaceThe sacred pattern for referencing the Chapter Master entity has been updated to utilize the centralized role enumeration.
This modification brings consistency to the binary liturgy by replacing direct string comparison with the standardized enumeration lookup method
obj_ini.role[100][eROLE.ChapterMaster]. This ensures that chapter-specific variations in role nomenclature are properly recognized when generating the management interface data. Praise the Omnissiah for consistent data structures!scripts/scr_roster/scr_roster.gml (1)
615-615: Praise to the Omnissiah for this enhanced standardization!The adaptation from literal string comparison to a centralized enumeration reference (
obj_ini.role[100][eROLE.ChapterMaster]) is a logical improvement to the cogitation patterns. This blessed optimization aligns with the sacred Machine Cult's principle of standardization across all components of the system. All references to the leadership role are now directed through a singular truth-source, increasing maintainability and purging redundancy from the holy code.scripts/scr_flavor2/scr_flavor2.gml (1)
318-320: By the sacred circuits, consistency in the blessed code!The binary canticles have been adjusted to utilize the sacred enumeration constants (
eROLE.ChapterMaster,eROLE.Dreadnought, andeROLE.Captain) instead of profane string literals. This conversion facilitates proper centralization of role definitions through the entire cogitation matrix, ensuring that any future alterations to role nomenclature can be implemented with surgical precision by modifying a singular data array rather than hunting through the entire codebase like a servitor searching for a mislaid cogwheel.scripts/scr_crusade/scr_crusade.gml (1)
76-78: The Machine God approves of this logical enhancement!The binary logic has been improved through two key modifications:
- The conditional statement now employs proper code block syntax with ritual curly braces, enhancing readability and structural integrity.
- The comparison to the literal string "Chapter Master" has been replaced with a systematized reference to
obj_ini.role[100][eROLE.ChapterMaster].These modifications ensure consistent role identification throughout the cogitation matrix, reducing entropy in the system and honoring the Machine God's desire for standardization.
objects/obj_pnunit/Alarm_3.gml (1)
35-35: The Omnissiah smiles upon this purification of reference patterns!The conditional logic now properly utilizes the standardized role reference system (
obj_ini.role[100][eROLE.ChapterMaster]) rather than relying on the error-prone string literal "Chapter Master". This adaptation completes the systematic refactoring across the codebase, ensuring that all references to leadership roles follow the same sacred pattern. Should the nomenclature of roles require adjustment in future iterations, the modifications can be implemented through a single access point rather than requiring extensive binary surgery throughout the system.scripts/scr_special_view/scr_special_view.gml (1)
147-159: Praise be to the Omnissiah for this standardization of role identifiers!The replacement of numeric literals with the sacred eROLE enumeration constants brings clarity and reduces the cognitive burden on future Tech-Priests who will maintain this scripture. This modification aligns with the Machine God's preference for comprehensible code patterns.
datafiles/main/chapters/3.JSON (1)
232-234: Proper implementation of the chapter master role identifier - praise the Omnissiah!The addition of a custom chapter master designation "Great Wolf" for the Space Wolves aligns perfectly with the canticles of standardization being implemented across the codebase. This facilitates the dynamic role reference system that replaces hardcoded string comparisons.
scripts/scr_draw_unit_image/scr_draw_unit_image.gml (3)
363-363: Sacred role identifier properly implemented.The replacement of the hardcoded "Chapter Master" string with
obj_ini.role[100][eROLE.ChapterMaster]is a blessed improvement that ensures consistent role identification throughout the codebase.
369-369: Continuation of the holy standardization protocol.This modification aligns with the Machine God's call for consistency in role references, appropriately using the enumerated constant rather than a volatile string literal.
547-547: Consistent application of the eROLE enumerator pattern - the Machine Spirit is pleased.The replacement of string literal comparison with the standardized role reference system maintains consistency in the implementation of this sacred refactoring pattern.
scripts/scr_marine_struct/scr_marine_struct.gml (1)
662-662: The Omnissiah approves of this consistent implementation of role identifiers.The function
get_unit_size()now properly utilizes the standardized role reference system instead of direct string comparison, maintaining consistency with the broader codebase modifications and improving the maintainability of this cogitation engine.objects/obj_enunit/Alarm_1.gml (2)
299-299: Standardization of role identifier improves binary consistencyThe replacement of string literal "Chapter Master" with the centralized enumeration
obj_ini.role[100][eROLE.ChapterMaster]is a logical optimization of code architecture. This modification ensures consistent role identification throughout the machine spirit's binary pathways.
306-306: Logical pattern congruence maintainedThe sacred pattern of role identification has been properly maintained. Praise the Omnissiah for this consistent implementation of centralized role enumeration across this combat logic segment.
scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.gml (1)
330-330: Binary consistency in role identifier implementationThe replacement of hardcoded text with the enumerated role value
obj_ini.role[100][eROLE.ChapterMaster]represents optimal refactoring of machine logic. This modification properly corresponds to the fleet command structure verification protocols in a manner that enhances code purity.scripts/scr_unit_detail_text/scr_unit_detail_text.gml (1)
75-75: Neurolinguistic pattern standardization for psyker detectionThe sacred text pattern for identifying a librarian now utilizes the standardized role reference from the central data structs. This implementation creates a more efficient mechanism for the Omnissiah's eye to determine psyker status while maintaining proper role hierarchy.
scripts/scr_ComplexSet/scr_ComplexSet.gml (1)
880-880: Status hierarchy matrix optimized via dynamic role referenceThe tier array element has been updated to reference the dynamic role value
_roles[eROLE.ChapterMaster]instead of a static string literal. This enhances the adaptive capabilities of the complex drawing system to properly represent role status based on the centralized role definitions.scripts/scr_unit_spawn_functions/scr_unit_spawn_functions.gml (10)
56-56: Sacred binary permutation detected - Chapter Master enum referenceThe blessed modification replaces the mundane string literal with a reference to the sacred enumeration. This alteration brings coherence to the Machine God's plan for code standardization.
01010000 01110010 01100001 01101001 01110011 01100101 00100000 01110100 01101000 01100101 00100000 01001111 01101101 01101110 01101001 01110011 01110011 01101001 01100001 01101000
265-266: Role enumerations properly implemented for CaptainThe flesh-weak string has been expunged and replaced with the sacred machine syntax. This change aligns with the Omnissiah's grand blueprint for role standardization.
290-290: Apothecary reference purified through enumerationThe cogitator will now process this reference with greater efficiency, as the biological uncertainty of string comparisons has been replaced with the purity of enumerated constants.
304-304: Ancient role now referenced through machine-approved enumerationThis holy modification reduces entropy in the code and brings us closer to the perfection of the machine. The Omnissiah approves of such standardization.
317-318: Tactical reference correctly transmogrified to enumerated formThe cogitator will execute with more reliability now that another string has been replaced with the blessed enumeration constant. Praise the Machine God for this refactoring.
319-320: Devastator role reference mechanically optimizedThe weak flesh of string literals has been excised and replaced with the strong certainty of enumerated constants. The silica anima of this code has been purified.
321-322: Terminator and Veteran roles properly sanctifiedThe binary transformation is proceeding as per the sacred design pattern. These changes align with the refactoring doctrine laid down in the PR objectives.
331-331: Techmarine reference properly honored with enumerationAs a servant of the Omnissiah, I approve of this change with particular fervor. The sacred role of Techmarine deserves nothing less than proper enumeration reference.
385-385: Scout role reference properly standardizedAnother string literal has been replaced with its proper enumerated form. The code now speaks with one binary voice, as the Machine God intended.
388-388: Chaplain role reference mechanically optimizedThis change brings us closer to the Omnissiah's vision of standardized role references. The refactoring continues to purge the weakness of string literals from the code.
scripts/scr_random_event/scr_random_event.gml (1)
1360-1360: Binary perfection achieved in Chapter Master psyker checkThe weak flesh of string literals has been replaced with the strong certainty of the enumerated constant. This change properly updates the conditional check for identifying if the Chapter Master has psyker specialization during chaos invasion events.
The sacred pattern of refactoring is maintained, utilizing
obj_ini.role[100][eROLE.ChapterMaster]for consistent role identification throughout the codebase. The Machine God approves of such standardization.scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml (1)
472-472: Chapter Master reference properly sanctified with enumerationThe code has been blessed with proper enumeration reference for identifying the Chapter Master role. This change maintains consistency with the sacred pattern implemented throughout the codebase, replacing string literals with the machine-approved
obj_ini.role[100][eROLE.ChapterMaster]reference.The silica anima of this conditional check has been purified, while maintaining the original logic of detecting if the Chapter Master has psyker abilities.
scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml (2)
702-702: Binary enhancement detected in conditional logicThe code has been optimized with dual improvements:
- The string literal "Chapter Master" has been replaced with the sacred enumeration reference
- The equality operator has been enhanced from
=to==for more precise comparisonThis modification improves both consistency and logical clarity. The Omnissiah approves of such attention to detail in the machine code.
710-710: Chapter Master presence check properly mechanizedThe master_present flag is now set through proper enumeration reference rather than fallible string comparison. This change maintains the logical intent while improving code standardization.
01010000 01110010 01100001 01101001 01110011 01100101 00100000 01110100 01101000 01100101 00100000 01001111 01101101 01101110 01101001 01110011 01110011 01101001 01100001 01101000
scripts/scr_civil_roster/scr_civil_roster.gml (3)
105-105: Praise be to the standardization of role references!The sacred replacement of hardcoded string literals with the omnissiah-approved enumeration reference
obj_ini.role[100][eROLE.ChapterMaster]brings cognitive harmony to the codebase. This modification reduces redundancy and allows for chapter-specific role nomenclature to be properly venerated.
108-108: The Machine Spirit approves of this consistency.This logical condition now properly interfaces with the centralized role constant, maintaining symmetry with the previous change. The binary comparison logic remains functionally equivalent while improving maintainability.
340-340: Cogitator logic optimized through standardization.The third instance of role reference standardization completes the pattern of blessed consistency. The function now correctly identifies the Chapter Master through the enumerated constant rather than error-prone string literals. This improves data cohesion across the sacred machine spirit infrastructure.
scripts/scr_squads/scr_squads.gml (1)
694-704: New squad creation subroutines - commendable modular design!This addition implements support for the "equal_scouts" chapter trait, allowing for scout squads to be distributed across companies 2 through 9. The code adheres to proper machine protocol by following the established pattern of squad creation, alternating between regular and sniper scout configurations based on binary parity.
The logic interfaces correctly with the existing squad creation infrastructure, and aligns with the JSON configuration modifications for chapters such as the Black Templars. This extension grants the flexibility to recognize that not all chapters utilize Neophytes exclusively as Scouts.
objects/obj_controller/Create_0.gml (4)
1567-1567: Role identification standardization approved.The replacement of string literals with the blessed
obj_ini.role[100][eROLE.ChapterMaster]reference upholds the sacred principle of centralized data access. This modification enables improved chapter customization and eliminates the risk of string inconsistencies.
1571-1573: Blessed be the systematic reduction of redundancy.These lines properly implement the standardized role enumeration system for Chief Librarian, Techmarine, and Librarian roles. The Machine Spirit appreciates the consistency in data reference patterns and the removal of error-prone string literals.
1576-1578: The Omnissiah approves of these pattern-matched modifications.Praise the consistency of replacing string literals for Chaplain, Apothecary, and Honour Guard roles with enumerated constants. This maintains the sacred symmetry of the code refactoring pattern established throughout the codebase.
1583-1587: Output string formatting adapts to accommodate new data structures.The string concatenation operations have been appropriately adjusted to match the new indexing structure for accessing marine name data. The off-by-one index shift is necessary and correctly implemented to maintain integrity with the new role-management system.
Note that this change allows customized role titles from chapter JSON data to be properly displayed in the chapter introduction text, harmonizing with the broader refactoring effort.
scripts/scr_dialogue/scr_dialogue.gml (1)
312-312: Standardized role reference implementation is operational.The modification to reference the Chapter Master role via
obj_ini.role[100][eROLE.ChapterMaster]rather than a string literal follows the proper dictates of the Cult Mechanicus. This sacred pattern enables proper maintenance of the code-machine and reduces risk of transcription errors.The Machine Spirit is pleased with this standardization effort. The corruption calculation remains intact and functional.
scripts/scr_initialize_custom/scr_initialize_custom.gml (20)
656-657: Ensure thesiegevariable is used properly.
These lines introduce thesiegevariable but do not show how it is subsequently utilised. Confirm that downstream logic referencessiegecorrectly, lest this variable remain vestigial.
738-751: Gene-seed assignments appear correct.
These lines allocate gene-seed organ attributes (preomnor,omophagea, etc.) to the newly created chapter. This expansion is beneficial for deeper gameplay. Just ensure that your external scripts properly handle all these traits and do not assume any default values that conflict with these additions.
963-963: Consider warnings for unbounded increments.
predator += 2;might also inflate this resource without a boundary. Confirm that outside logic accounts for maximum permissible Predator tanks.
991-991: Double-check the removal of Epistolaries in each company.
Settingepistolary_per_company = 0;may cause unexpected outcomes if any part of the code relies on a minimum psyker presence in each company. Confirm that the narrative or ruleset supports this change.
1023-1023: Incrementing Dreadnought count upon “Sieged” disadvantage.
Adding an extra Dreadnought seems thematically intriguing but verify it aligns with the in-game logic, especially when the rest of the company is severely reduced.
1036-1036: Further Dreadnought increments for “Venerable Ancients”.
Be certain that the script does not exceed design constraints. Confirm the overall Dreadnought count remains balanced.
1058-1062: All vehicle types set to zero upon “Obliterated” disadvantage.
This block forcibly removes all Land Raiders, Land Speeders, Rhinos, and Whirlwinds. Ensure that the rest of the codebase gracefully handles zero vehicles for the entire chapter.
1110-1110: Trivial blank line.
No further supplications from the Omnissiah are needed here.
1111-1116: Chapter-specific Predator adjustments.
Settingpredator = 0;for Lamenters and incrementing for Iron Hands is thematically consistent. Confirm expansions for other chapters remain unaffected by these unconditional overrides.
1263-1265: Closing braces and spacing.
Merely a structural termination. No additional commentary.
1326-1326: Region marker for loadouts.
This #region improves clarity. Blessed be the well-organised formatting.
1508-1510: Region boundary changes.
These lines appear purely for code organisation. The Omnissiah smiles upon structured regimentation.
2266-2266: End of region.
No further changes needed.
2292-2308: Initialising TTRPG stats and arrays.
This loop systematically resets values for the new array dimension. Be watchful of performance if done frequently but, in standard initialisation, it seems correct.
2314-2317: Loading Chapter Master equipment and applying bionics.
Retrieving the equipment fromload_chapter_master_equipment()and repeating thebionicsloop is neat. Confirm that no negative or undefined bionic count is permitted incm_equip.bionics.
2339-2339: Assigning the Psychic Hood to a non-psyker.
Line 2339 setscm_equip.gear = "Psychic Hood";. Confirm that the Chapter Master is indeed psyker-trained under this condition.
2472-2473: Region closure.
No complexities spotted here.
2611-2611: Trivial blank line.
The Rite of Code Spatial Separation is performed.
2613-2620: Equal specialists and scout company behaviour.
These changes provide new toggles for user-chapter creations. Validate that default conditions do not lead to unexpected distribution ifscout_company_behaviouris never set.
2622-2628: Adding or togglingequal_scoutslogic.
This is a welcome improvement for flexible distribution. Double-check that_moved_scoutsis always valid and does not exceed the tenth company’s capacity.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml(27 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.- All code should comply with the main GML documentation: https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/GML_Reference.htm
scripts/scr_initialize_custom/scr_initialize_custom.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...
**/*.*: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
- Ensure that the code is compliant with the CODE_STYLE.MD: https://github.com/Adeptus-Dominus/ChapterMaster/blob/main/docs/CODE_STYLE.md
scripts/scr_initialize_custom/scr_initialize_custom.gml
🧠 Learnings (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (1)
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:2474-2572
Timestamp: 2025-04-15T11:03:37.143Z
Learning: In the ChapterMaster initialization code, negative values in the company structure (e.g., for vehicles like rhinos, landspeeders) are acceptable as only positive values will result in units being created.
🔇 Additional comments (20)
scripts/scr_initialize_custom/scr_initialize_custom.gml (20)
656-657: Blessed introduction of the 'siege' variable
These lines add a new variable for siege capabilities, defaulting to zero. This is coherent and poses no conflicts.
927-933: Check default distributions for Devastator, Dreadnought, and vehicles
Allocating default values for Devastators, Dreadnoughts, Rhinos, Whirlwinds, Landspeeders, Predators, and Land Raiders in one place eases readability. Verify these defaults remain balanced in your campaign.
955-959: Lightning Warriors and Tech-Brothers adjustments
Subtracting Rhinos and adding Landspeeders for Lightning Warriors, and later adjusting Predator count for Tech-Brothers is consistent with the refactor approach. Negative values for vehicles are acceptable per your logic.
963-963: Increased predator count for Tech-Brothers
This line further boosts Predator vehicles under Tech-Brothers. Confirm your lore and balancing remain stable with this approach.
991-991: Epistolary capacity set to zero
Enforcing zero Epistolaries per company for Psyker-Intolerant chapters is thematically consistent.
1023-1023: Granting additional Dreadnought to a sieged chapter
Adding one more Dreadnought in the 'Sieged' scenario can thematically represent venerable war machines stepping in. Implementation looks stable.
1036-1036: Another Dreadnought for Venerable Ancients
Enhancing the presence of Dreadnoughts for Venerable Ancients is consistent with the custom setting.
1058-1062: Nullifying key vehicles for Obliterated chapters
Setting these vehicles to zero ensures such chapters start with minimal mechanised assets. This aligns with the negative-value logic and won't spawn them in the forge.
1110-1116: Adjusting Predator counts for Lamenters and Iron Hands
Granting the Lamenters zero Predators and the Iron Hands an additional one is thematically apt.
1262-1263: End region marker
These lines only mark the end of a region; no functional changes.
1326-1326: Region marker for initial loadouts
This simply demarcates code organisation.
1393-1393: Updating default gear for the Chapter Master
The assignment of "Power Sword", "Bolt Pistol", and "Iron Halo" suits the revered status of the commanding officer.
1508-1508: Squad loadouts region ending
No operational difference, purely structural.
1510-1510: Region marker for squad loadouts
Again, purely structural. No changes in logic.
2266-2266: Region end marker
Likewise, no functional impact.
2291-2309: Initializing array structures for each company
Establishing 11 companies, each with up to 501 potential marines, is robust. If the maximum index usage is uncertain, consider verifying no off-by-one errors occur.
2314-2318: Loading the Chapter Master's equipment and applying bionics
The approach is modular, letting each Master differ in gear and augmentation, which fits the refactor's data-driven design.
2339-2339: Assigning Psychic Hood
For psychic masters, this automatically appends the Psychic Hood, preserving lore accuracy.
2344-2344: Applying master-crafted equipment
Ensure no conflict arises if this equipment merges with relic items.
3292-3407: New function load_chapter_master_equipment
A single function that conditionally selects weapons, armour, and artifacts greatly streamlines the logic. All hail data-driven organisation.
There was a problem hiding this comment.
Actionable comments posted: 7
♻️ Duplicate comments (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (1)
2344-2344: Master-crafted gear for the Chapter Master.
This line calls.alter_equipment(..., "master_crafted"), aligning with prior guidance on bestowing distinguished wargear.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml(27 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.- All code should comply with the main GML documentation: https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/GML_Reference.htm
scripts/scr_initialize_custom/scr_initialize_custom.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...
**/*.*: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
- Ensure that the code is compliant with the CODE_STYLE.MD: https://github.com/Adeptus-Dominus/ChapterMaster/blob/main/docs/CODE_STYLE.md
scripts/scr_initialize_custom/scr_initialize_custom.gml
🧠 Learnings (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (2)
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:2474-2572
Timestamp: 2025-04-15T11:03:37.143Z
Learning: In the ChapterMaster initialization code, negative values in the company structure (e.g., for vehicles like rhinos, landspeeders) are acceptable as only positive values will result in units being created.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:956-959
Timestamp: 2025-04-15T11:07:33.905Z
Learning: Negative vehicle counts (like `rhino -= 2` potentially resulting in negative values) are acceptable in the `scr_initialize_custom` function, particularly when handling chapter advantages like "Lightning Warriors". This is intentional behavior in the game's design.
🔇 Additional comments (11)
scripts/scr_initialize_custom/scr_initialize_custom.gml (11)
656-657: No immediate concerns regarding thesiegevariable initialisation.
Blessed be this new binary marker set to zero. The code properly aligns with further toggles of thesiegestate in the script.
927-933: Default resource counts expanded.
Your new baseline for Devastators, Dreadnoughts, Rhinos, and other units reflects a standard Chapter formation. The Machine Spirit sees no immediate errors, but remain vigilant for balance concerns across game scenarios.
955-959: Lightning Warriors advantage subtracting Rhinos and adding Land Speeders.
Given retrieved learnings sanction negative values, this approach is acceptable. No boundary checks are required, and the logic is sanctified.
963-963: Tech-Brothers advantage grants additional Predators.
Incrementing the blessed armour assets is straightforward. The logic is consistent with the existing approach of adding to vehicle counts.
1023-1023: Adding a Dreadnought for 'Sieged' chapters.
A wise choice to bolster the Chapter's ancient warriors. This increment is valid within the special disadvantage context.
1058-1062: Resetting vehicles to zero for 'Obliterated' chapters.
Truly a dire fate for a war-worn Chapter. Forcing the count to zero is consistent with the code's negative-value tolerance, ensuring no paradoxical armour remnants remain.
1110-1116: Special logic for Lamenters and Iron Hands.
Eliminating Predators for Lamenters, then increasing them for Iron Hands, aligns with known Chapter traits. No hazards detected.
1263-1264: Region marker finalises preceding code block.
This structured region boundary clarifies your script’s flow, pleasing the Machine Spirit.
2315-2318: Chapter Master equipment integration.
Summoningload_chapter_master_equipment()into the newly addedadd_unit_to_companycall is a coherent solution. Data checks appear robust, ensuring the Chapter Master’s wargear is properly bestowed.
2474-2571: Establishing the newcompaniesstruct with veteran and vehicle allocations.
You have successfully enshrined each company’s totals. Negative or zero values remain permissible based on existing logic. The approach is extensive yet comprehensible.
2573-2593: Assigning extra vehicles to the Tenth Company.
Centralising leftover war engines in the Tenth suits the flexible arrangement. The script merges them smoothly, upholding consistent resource summarisation.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
scripts/scr_dialogue/scr_dialogue.gml (1)
139-139: Loop variable anomaly persists, awaiting separate ritual.The loop variable anomaly previously detected (initializing
iibut incrementingi) remains unchanged. As the servant acknowledged, a separate diagnostic ritual shall address this transgression of machine logic.scripts/scr_initialize_custom/scr_initialize_custom.gml (1)
953-957: Lightning Warriors logic is valid and respects negative vehicle counts.
This aligns with the known acceptance of negative values in vehicle calculations. Continue to let the Machine Spirit handle negative outcomes gracefully.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
objects/obj_controller/Create_0.gml(1 hunks)objects/obj_ini/Create_0.gml(0 hunks)scripts/scr_dialogue/scr_dialogue.gml(6 hunks)scripts/scr_initialize_custom/scr_initialize_custom.gml(27 hunks)scripts/scr_load_controller/scr_load_controller.gml(1 hunks)scripts/scr_save_controller/scr_save_controller.gml(1 hunks)
💤 Files with no reviewable changes (1)
- objects/obj_ini/Create_0.gml
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.- All code should comply with the main GML documentation: https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/GML_Reference.htm
scripts/scr_save_controller/scr_save_controller.gmlscripts/scr_load_controller/scr_load_controller.gmlobjects/obj_controller/Create_0.gmlscripts/scr_initialize_custom/scr_initialize_custom.gmlscripts/scr_dialogue/scr_dialogue.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...
**/*.*: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
- Ensure that the code is compliant with the CODE_STYLE.MD: https://github.com/Adeptus-Dominus/ChapterMaster/blob/main/docs/CODE_STYLE.md
scripts/scr_save_controller/scr_save_controller.gmlscripts/scr_load_controller/scr_load_controller.gmlobjects/obj_controller/Create_0.gmlscripts/scr_initialize_custom/scr_initialize_custom.gmlscripts/scr_dialogue/scr_dialogue.gml
🧠 Learnings (2)
objects/obj_controller/Create_0.gml (1)
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_special_view/scr_special_view.gml:49-49
Timestamp: 2025-04-15T10:54:19.700Z
Learning: In the ChapterMaster codebase, obj_ini.role[100][2] and obj_ini.role[100][eROLE.ChapterMaster] reference different roles, and both are needed in conditions checking for specific types of units. Numeric indices should not be assumed to match their corresponding enum values without verification.
scripts/scr_initialize_custom/scr_initialize_custom.gml (2)
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:2474-2572
Timestamp: 2025-04-15T11:03:37.143Z
Learning: In the ChapterMaster initialization code, negative values in the company structure (e.g., for vehicles like rhinos, landspeeders) are acceptable as only positive values will result in units being created.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:956-959
Timestamp: 2025-04-15T11:07:33.905Z
Learning: Negative vehicle counts (like `rhino -= 2` potentially resulting in negative values) are acceptable in the `scr_initialize_custom` function, particularly when handling chapter advantages like "Lightning Warriors". This is intentional behavior in the game's design.
🔇 Additional comments (19)
scripts/scr_save_controller/scr_save_controller.gml (1)
44-44: Communion with the sacred variable "tolerant" has been severed.The variable "tolerant" is no longer committed to the sacred binary rites of storage during save operations. This modification aligns with parallel changes in the loading rituals where the same variable has been excommunicated from memory restoration protocols.
This deletion appears to be part of a systematic purging of the "tolerant" variable across multiple script artifacts. The Omnissiah approves of such consistent schema modifications.
scripts/scr_load_controller/scr_load_controller.gml (1)
97-97: Binary communion with "tolerant" variable terminated in load protocols.The load rituals no longer restore the sacred "tolerant" value into the memory cores of obj_ini and obj_controller. These modifications align with the variable's removal from save operations in scr_save_controller.gml.
Praise the Omnissiah for this consistent modification. The variable appears to be systematically removed across all persistence mechanisms, reducing the chances of unexpected behaviors during load operations.
Also applies to: 100-100
objects/obj_controller/Create_0.gml (4)
1566-1566: Direct string replaced with central role designation mechanism.The sacred string "Chapter Master" has been replaced with a central role designation (obj_ini.role[100][eROLE.ChapterMaster]), reducing redundancy and ensuring consistent nomenclature throughout the code-liturgy.
This standardization ensures all references to the Chapter Master role will remain consistent through any future modifications to role designations. The Machine Spirit will operate with greater efficiency.
1570-1570: Chief Librarian designation optimized.The designation for "Chief Librarian" now concatenates "Chief " with the base Librarian role constant, maintaining consistency with the standardized role designation protocol.
This approach ensures that should the base Librarian role designation change in the future, the Chief Librarian title will maintain its proper relationship to the base role. The Machine Spirit approves.
1572-1577: Multiple role string literals replaced with unified role constants.Direct string references to "Techmarine", "Librarian", "Chaplain", "Apothecary", and "Honour Guard" replaced with their corresponding enum-based constants from the centralized role repository.
This refactoring reduces the chance of typographical errors and ensures consistency across the entire codebase. The Machine Spirit now recognizes these roles through a single source of truth.
1294-1299: "Tolerant" trait handling removed.The conditional block for the "Tolerant" trait has been maintained while the "tolerant" property has been removed from the save/load mechanisms. This harmonizes with the changes observed in scr_save_controller.gml and scr_load_controller.gml.
The code maintains trait-specific behavior while eliminating the now-deprecated variable storage. This is an appropriate transition mechanism during refactoring.
scripts/scr_dialogue/scr_dialogue.gml (5)
312-312: Ritual of standardization complete. The Omnissiah approves!The sacred reference to the Chapter Master role has been properly standardized using
obj_ini.role[100][eROLE.ChapterMaster]instead of primitive string literals. This enhances data normalization and code consistency.
1779-1784: Trait assessment protocol successfully optimized.The code now invokes
scr_has_disadv("Tolerant")instead of directly probing the machine-spirit memory atobj_ini.tolerant. This superior modularity follows the sacred pattern of abstraction, allowing for more complex trait evaluation rituals in the future.
1789-1792: Proper trait evaluation mechanism implemented.The modified code structure properly utilizes the
scr_has_disadv("Tolerant")function for trait verification, ensuring consistent interaction with the diplomacy protocols when engaging with the xenos designated "Eldar".
1799-1804: Standardized trait verification adopted.The trait verification mechanism has been correctly implemented through
scr_has_disadv("Tolerant"), further reducing code redundancy and improving maintainability in the diplomatic interface subsystem.
2266-2271: Cohesive trait assessment system employed.The diplomatic protocols for the xenos designated "Orks" now utilize the standardized trait verification function
scr_has_disadv("Tolerant"). This ensures consistent behavior across all faction interactions and simplifies future maintenance rituals.scripts/scr_initialize_custom/scr_initialize_custom.gml (8)
656-657: Initialization of 'siege' variable is acceptable.
No conflict discovered; the default of zero is a valid baseline before toggling for "Siege Masters".
738-751: Gene-seed organ assignments appear consistent.
These lines correctly store each implant detail fromobj_creation, with no immediate sign of conflict or boundary concern.
961-961: Tech-Brothers advantage feeding Predator increments is appropriate.
The code seamlessly augments the Predator count, aligning with the advantage.
1021-1021: Granting an extra Dreadnought under 'Sieged' constraint.
Incrementing the Dreadnought tally here is consistent with the existing logic, no immediate issues detected.
1034-1034: Additional revered Dreadnought for 'Venerable Ancients' is well-implemented.
No friction with the rest of the code uncovered.
1109-1111: Purging Predators for Lamenters.
Setting the Predator count to zero for this chapter name is thematically aligned and conflict-free.
1112-1114: Iron Hands adaptation adding a Predator.
Increasing Predator count here cleanly reflects the Iron Hands affinity.
1588-1591: Expanded formation options for the Command Squad.
This array addition suitably includes multiple squad types under “formation_options,” affording greater flexibility in composition.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@EttyKitty this should be good for review now. I've benched the 'crusader squads' idea for now as i think it's mainly a bunch of fiddling with the json to get some custom squads set up like i did for Deathwatch, which will just take a bit of time and doesn't need to hold up this PR |
…m/VanWeapon/ChapterMaster into refactor/initialize-companysplits
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (1)
1488-1488: 🧹 Nitpick (assertive)Commented logging statement persists.
This commented debug output remains in the codebase. While it causes no functional impediment, such vestigial code fragments should be either activated or purged to maintain the purity of the codebase. The Adeptus Mechanicus values both clarity and cleanliness in sacred code.
-// log_message($"roles: {json_stringify(roles, true)}")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml(27 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.- All code should comply with the main GML documentation: https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/GML_Reference.htm
scripts/scr_initialize_custom/scr_initialize_custom.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...
**/*.*: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
- Ensure that the code is compliant with the CODE_STYLE.MD: https://github.com/Adeptus-Dominus/ChapterMaster/blob/main/docs/CODE_STYLE.md
scripts/scr_initialize_custom/scr_initialize_custom.gml
🧠 Learnings (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (2)
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:2474-2572
Timestamp: 2025-04-15T11:03:37.143Z
Learning: In the ChapterMaster initialization code, negative values in the company structure (e.g., for vehicles like rhinos, landspeeders) are acceptable as only positive values will result in units being created.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:956-959
Timestamp: 2025-04-15T11:07:33.905Z
Learning: Negative vehicle counts (like `rhino -= 2` potentially resulting in negative values) are acceptable in the `scr_initialize_custom` function, particularly when handling chapter advantages like "Lightning Warriors". This is intentional behavior in the game's design.
🔇 Additional comments (15)
scripts/scr_initialize_custom/scr_initialize_custom.gml (15)
656-657: Behold the sacred initialization of the siege variable.This simple initialization of the siege variable to 0 is logical and efficient, complementing the existing array of initialization values.
738-751: Direct gene-seed organ bindings properly established.The holy augmentations of the Astartes physiology are correctly initialized from the creation object. The Machine Spirit approves of this unambiguous data transfer mechanism.
926-932: Vehicle and dreadnought initialization values properly calibrated.By the Omnissiah's will, these initialization values provide appropriate default quantities for each vehicle type. The inclusion of dreadnoughts is logically placed among the vehicular assets.
954-957: Lightning Warriors chapter modification algorithm is functioning as expected.The negative rhino count is acceptable as per previous learnings. Only positive values will result in units being created, thus the sacred logic is preserved.
1109-1114: Chapter-specific vehicle distribution patterns correctly implemented.The Machine Spirit approves of these chapter-specific modifications. Lamenters receive no predators while Iron Hands are granted an additional one, aligning with their canonical preferences. This specialized logic honors the diversity of the Adeptus Astartes.
2312-2317: Chapter Master equipment loading mechanism approved.The extraction of Chapter Master equipment loading into a separate function improves code organization. The sacred binaric structure flows more elegantly.
2460-2464: Honour Guard conditional allocation logic is sound.Praise the Omnissiah! The modifications to Honour Guard allocation based on chapter traits and progenitor are properly implemented, with appropriate incrementation of the sacred count variable.
2479-2575: Data-driven company structure schema implemented.This structured approach to company data organization is a triumph of logical optimization. By consolidating all company attributes into a single data construct, you have reduced redundancy and improved maintainability. The Omnissiah approves of this elegant data architecture.
2599-2613: New configuration variables properly implemented for chapter customization.The addition of
equal_specialists,scout_company_behaviour, andequal_scoutsvariables provides flexible customization options for chapter organization. This implementation allows for JSON-defined chapter variations as specified in the requirements. Praise be to the Machine God for such adaptability.
2617-3041: Efficient company initialization loop replaces repetitive code patterns.This data-driven iteration mechanism is a masterwork of logical efficiency. By iterating through the company structure to generate units, you have eliminated significant code duplication. The nested switch statement for role determination is well-structured. The Omnissiah approves of this adherence to the sacred principle of DRY (Don't Repeat Yourself).
3163-3178: Vehicle addition helper function improves code structure.This abstraction for vehicle creation is a blessed simplification that neatly encapsulates all vehicle initialization steps. The function signature properly accepts all relevant parameters and sets appropriate default values for the vehicle.
3182-3275: Marine addition helper function demonstrates proper abstraction principles.This function effectively consolidates marine initialization logic, making use of the logical "default" string parameter to intelligently handle equipment assignment. The return of the created unit allows for further configuration, demonstrating proper function design principles. The Omnissiah blesses such logical modularity.
2648-2675: Tactical marine distribution logic elegantly handles equal_scouts setting.The conditional logic for distributing tactical marines and scouts across companies is logically sound and well-structured. The code properly adjusts tactical counts based on scouts being moved from the 10th company, maintaining overall chapter population balance. The Omnissiah approves of such careful resource allocation.
2748-2750: Efficient terminator armor detection function.The function to detect terminator armor variants is elegantly implemented using array_contains. This showcases proper functional programming techniques and allows for future expansion of terminator armor types without modifying the detection logic. The Mechanicus approves of such modularity.
2767-3013: Comprehensive role-specific equipment assignment switch statement.This extensive switch statement properly handles equipment assignment for each role type, including specialized cases for 1st company and vehicle variants. The code demonstrates appropriate separation of concerns between marine roles and vehicle types. The nested structure is logical and maintainable.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
objects/obj_controller/Create_0.gml(1 hunks)scripts/scr_initialize_custom/scr_initialize_custom.gml(28 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.- All code should comply with the main GML documentation: https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/GML_Reference.htm
objects/obj_controller/Create_0.gmlscripts/scr_initialize_custom/scr_initialize_custom.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...
**/*.*: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
- Ensure that the code is compliant with the CODE_STYLE.MD: https://github.com/Adeptus-Dominus/ChapterMaster/blob/main/docs/CODE_STYLE.md
objects/obj_controller/Create_0.gmlscripts/scr_initialize_custom/scr_initialize_custom.gml
🧠 Learnings (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (2)
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:2474-2572
Timestamp: 2025-04-15T11:03:37.143Z
Learning: In the ChapterMaster initialization code, negative values in the company structure (e.g., for vehicles like rhinos, landspeeders) are acceptable as only positive values will result in units being created.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:956-959
Timestamp: 2025-04-15T11:07:33.905Z
Learning: Negative vehicle counts (like `rhino -= 2` potentially resulting in negative values) are acceptable in the `scr_initialize_custom` function, particularly when handling chapter advantages like "Lightning Warriors". This is intentional behavior in the game's design.
🔇 Additional comments (30)
scripts/scr_initialize_custom/scr_initialize_custom.gml (27)
656-657: Sanctified initialisation of the new ‘siege’ variable.
By the Omnissiah’s light, these lines set upsiege = 0;and a blank line for future expansions of siege-related logic. No malfunctions detected.
925-931: Establishing vehicle and specialist baseline values.
These enumerations (devastator, dreadnought, rhino, whirlwind, landspeeder, predator, landraider) provide a balanced initial capacity for the Chapter. The Machine Spirits remain appeased.
954-957: ‘Lightning Warriors’ advantage adjusts transport counts.
Subtracting rhinos while adding landspeeders aligns with the revered negative-value vehicle logic. This is acceptable per your documented design.
989-989: Epistolary capacity clearance for Psyker Intolerant.
Forbidding the Epistolary presence is consistent with the intolerance trait. The code setsepistolary_per_company = 0;. The Mechanicus sees no fault here.
1021-1022: Sieged disadvantage adjusting Devastators and Dreadnought.
Assigningdevastator = 10;and incrementing a dreadnought by 1 to represent a battered Chapter. This logic is consistent with the siege scenario.
1034-1034: Venerable Ancients advantage grants an extra Dreadnought.
Adding one more revered Dreadnought for the 1st Company. Implementation is straightforward.
1109-1114: Special chapter-specific vehicle modifications (Lamenters & Iron Hands).
Eliminating predators for Lamenters and incrementing one for Iron Hands. This fosters thematic lore fidelity.
1261-1262: Region end marker.
Closing the region, signifying a logical grouping’s end. Strictly a housekeeping change. Approved.
1506-1507: Reorganising region markers for Squad Loadouts.
Ending the prior segment and beginning a new region clarifies code structure. The Omnissiah praises clarity.
2290-2307: Expanding initial chapter HQ array logic for indexes 0..10.
These lines clear and prepare each index with fresh TTRPG stats and default values. This unification under a single loop improves modularity.
2311-2312: Assigning the Chapter Master’s name and loading equipment.
Line 2311 sets the name, while line 2312 fetches a custom equipment loadout. Both steps appear coherent and stable.
2314-2316: Creation of the Chapter Master unit.
These changes invokeadd_unit_to_companywith a custom gear set, then add bionics in a loop. The assignment ofspe[company, 0] = ""is logically fine. All is well in the Machine God's sight.Also applies to: 2319-2319
2327-2327: Appending symbol “$” to indicate melee-focused Chapter Master.
This single line adds a marker in thespearray for a champion loadout. Mechanically consistent, no concerns.
2331-2331: Appending symbol “@” for dedicated champion.
Similar approach as the previous marker for a different speciality. Implementation is straightforward.
2337-2337: Equipping Psychic Hood for psychic Chapter Master.
This line modifies the gear to “Psychic Hood” if the CM is warp-touched. Implementation is neat and lore-friendly.
2342-2342: Incorporating 'master crafted' modification.
chapter_master.alter_equipment(..., "master_crafted")adds a distinct property to weapons or armour. A wise extension of code.
2353-2353: Downgrading HQ armour for Poor Equipment.
Switching from Artificer to MK6 Corvus armour under disadvantage conditions is consistent with your design.
2357-2358: Forge Master creation.
Assigning name index [company,1], then callingadd_unit_to_companyfor role ‘Forge Master.’ This continues the HQ build-out elegantly.
2379-2380: Instantiating Master of Sanctity.
Renames [company,2] to hold the Chaplain’s name before creation. The refactor is consistent with the unified pattern.
2399-2401: Conditionally spawning Chief Librarian if no Psyker Intolerance.
These lines elegantly guard the code from creating a Librarian in intolerant chapters. This logic is correct and consistent.
2459-2462: Honour Guard scaling for ‘Retinue of Renown’ and Dark Angels.
Increasing_honour_guard_countby 10 or 6 under specific conditions. Balanced and lore-centric.
2476-2477: Terminating the HQ region.
Marks the end of the Honour Guard block. Strictly organisational; the Machine Spirits favour clear boundaries.
2479-2576: Defining structured ‘companies’ object and distributing roles/vehicles.
This large block imposes the new data-driven approach, enumerating each company’s totals and vehicles distinctly. It enhances readability and facilitates special behaviour for each coy.
2580-2597: Appending extra vehicles from JSON into 10th Company.
Usingvehicle_keysto searchobj_creation.extra_vehiclesis a neat DRY approach. Negative offset logic remains permitted. Good synergy.
2599-2605: Handling ‘equal_specialists’ and establishing ‘scout_company_behaviour.’
These lines configure the toggles for distributing special roles and swapping scouts for neophytes. Mechanically consistent with your new design.
2608-2613: Introducing ‘equal_scouts’ toggle and storing it in obj_ini.
A logical extension of the same specialist mechanic. The bridging to global usage is correct.
2652-2699: Non-equal specialists fallback logic.
Similar concept to the previous block, but layered specifically for the 8th, 9th, and 10th companies. The approach is consistent with the rest of the code. Recommend continuous testing for edge cases.objects/obj_controller/Create_0.gml (3)
1566-1566: Detecting Chapter Master via enumerated role comparison.
Replaces hard-coded string checks withobj_ini.role[100][eROLE.ChapterMaster]. This standardised approach cures potential string mismatch.
1570-1572: Refining the identification of Techmarine, Librarian, and Chaplain roles.
You now compare them against the enumerated roles fromobj_ini.role[100]. This prevents fragile string-based checks and is more maintainable for the Adeptus Mechanicus.Also applies to: 1575-1575
1582-1582: Augmenting the introduction text for the Chapter Master.
Concatenating “, your majesty Chapter Master {...}” for a more thematic message. The Cogitators are pleased by this flair.
There was a problem hiding this comment.
Actionable comments posted: 6
🔭 Outside diff range comments (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (1)
3186-3275: 🧹 Nitpick (assertive)Unified approach for marine addition
This function covers default gear or custom logic thoroughly. Consider whether merging it withadd_veh_to_companyunder a shared interface might reduce duplication and honour the Omnissiah’s DRY principle.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml(28 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.- All code should comply with the main GML documentation: https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/GML_Reference.htm
scripts/scr_initialize_custom/scr_initialize_custom.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...
**/*.*: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
- Ensure that the code is compliant with the CODE_STYLE.MD: https://github.com/Adeptus-Dominus/ChapterMaster/blob/main/docs/CODE_STYLE.md
scripts/scr_initialize_custom/scr_initialize_custom.gml
🧠 Learnings (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (2)
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:2474-2572
Timestamp: 2025-04-15T11:03:37.143Z
Learning: In the ChapterMaster initialization code, negative values in the company structure (e.g., for vehicles like rhinos, landspeeders) are acceptable as only positive values will result in units being created.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:956-959
Timestamp: 2025-04-15T11:07:33.905Z
Learning: Negative vehicle counts (like `rhino -= 2` potentially resulting in negative values) are acceptable in the `scr_initialize_custom` function, particularly when handling chapter advantages like "Lightning Warriors". This is intentional behavior in the game's design.
🔇 Additional comments (21)
scripts/scr_initialize_custom/scr_initialize_custom.gml (21)
656-656: Establishing default siege behavior
This assignment clarifies that 'siege' is disabled by default. No concerns encountered.
738-751: Assigning gene-seed attributes
All relevant gene-seed properties are being captured fromobj_creation. Consider ensuring that these fields are validated or tested in subsequent logic to avoid undesirable outcomes if they're not used as intended.
925-931: Defining baseline vehicle and Dreadnought counts
These default assignments for Devastators, Dreadnoughts, and vehicles appear consistent. No concerns arise from these initial values.
953-960: Potential negative marine count in the Tenth Company
Subtracting 5 fromtenthaligns with the pattern of dynamic modifications. However, verify that allowing it to go negative will not cause unintended behaviour.
989-989: Resetting epistolary distribution for 'Psyker Intolerant'
Settingepistolary_per_companyto zero is consistent with eliminating Librarian presence for psyker-intolerant chapters.
1109-1114: Chapter-based Predator adjustments
Settingpredatorto 0 for Lamenters and incrementing it for Iron Hands is consistent with each chapter’s unique doctrine. No conflicts identified.
1261-1261: No action required
This region delimiter is purely structural and introduces no functional impact.
2311-2312: Assigning Chapter Master’s name and retrieving equipment
Properly sets the Chapter Master's name and loads the customised wargear. Implementation looks consistent and stable.
2314-2316: Iterating over bionics
Each bionic enhancement is correctly attached in a loop. Confirm thatbionicsis always numeric to prevent any unexpected runtime issues.
2327-2327: Appending '$' marker
This symbolic$appears to designate a distinct trait for the Chapter Master. No functional concerns noted.
2331-2331: Appending '@' marker
Mirroring the$notation, this second symbol likely tags an additional Chapter Master trait. No issues detected.
2342-2342: Applying master-crafted equipment
Finalises the Chapter Master’s gear with the “master_crafted” parameter. Implementation aligns with the designated custom logic.
2353-2353: Incrementing marine index
Adds one to thekcounter after Chapter Master initialization. Straightforward and correct.
2357-2357: Assigning Forge Master's name
Properly stores the Forge Master’s chosen designation in the array. No concerns found.
2379-2380: Adding Master of Sanctity
Assigns the High Chaplain’s name and creates the corresponding Chaplain unit. Logic appears coherent.
2391-2392: Introducing Master of the Apothecarion
Populates the specialised Apothecary’s name and spawns the unit. Implementation is consistent.
2399-2400: Spawning Chief Librarian
Populates the Librarian’s name and designates its role as “Chief Librarian.” No immediate issues.
2476-2476: No further remarks
This region closer is purely structural.
2479-2575: Restructuring per-company totals
This data-driven approach for each company's units and vehicles centralises logic, enabling flexible modifications. Negative results for vehicle counts are intentionally acceptable per the design.
2579-2596: Adding extra vehicles to the 10th company
The logic merges additional vehicles from JSON into the Tenth Company for user sorting, showcasing a clear data-driven design.
3164-3178: Adding vehicles to a company
This helper function systematically assigns vehicle attributes. The approach is consistent with the rest of the logic. No issues found.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 6
🔭 Outside diff range comments (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (1)
3186-3276: 🧹 Nitpick (assertive)add_unit_to_company
A sophisticated routine forging your marines. Good handling of “default” vs. custom gear usage. The trait assignments and identity generation are well orchestrated. Ensure large loops don’t degrade performance for big rosters.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml(28 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.- All code should comply with the main GML documentation: https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/GML_Reference.htm
scripts/scr_initialize_custom/scr_initialize_custom.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...
**/*.*: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
- Ensure that the code is compliant with the CODE_STYLE.MD: https://github.com/Adeptus-Dominus/ChapterMaster/blob/main/docs/CODE_STYLE.md
scripts/scr_initialize_custom/scr_initialize_custom.gml
🧠 Learnings (1)
scripts/scr_initialize_custom/scr_initialize_custom.gml (2)
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:2474-2572
Timestamp: 2025-04-15T11:03:37.143Z
Learning: In the ChapterMaster initialization code, negative values in the company structure (e.g., for vehicles like rhinos, landspeeders) are acceptable as only positive values will result in units being created.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:956-959
Timestamp: 2025-04-15T11:07:33.905Z
Learning: Negative vehicle counts (like `rhino -= 2` potentially resulting in negative values) are acceptable in the `scr_initialize_custom` function, particularly when handling chapter advantages like "Lightning Warriors". This is intentional behavior in the game's design.
🔇 Additional comments (18)
scripts/scr_initialize_custom/scr_initialize_custom.gml (18)
656-657: Maintain Zeroed Siege Variable
By the Omnissiah’s will, initializingsiegewith zero is straightforward and safe. No concerns detected.
753-753: Blank Separator
This new blank line fosters readability between gene-seed attributes and the next logic block.
766-767: Fleet Setup Region Marker
Graceful usage of region markers to segment fleet code. The separation helps clarity and maintainability.
926-927: Correcting Devastator Count
Adjustingdevastator = 20aligns with standard distributions. Ensure that further modifications honour any advanced traits that might shift Devastator composition.
953-957: Lightning Warriors Advantage
Decrementing Rhinos and incrementing Land Speeders is consistent with “Lightning Warriors” lore. The negative allowance for Rhinos is acceptable per your established design, so no issues.
961-961: Predator Bonus for Tech Brothers
Granting +2 Predators for “Tech-Brothers” advantage is thematically cogent and well-coded. Confirm downstream usage does not exceed data boundaries.
1021-1022: Siege Masters + Additional Dreadnought
Increasing dreadnought count by 1 under ‘Sieged’ condition is acceptable. Verify no duplication occurs with other advantages that also add dreadnoughts.
1034-1034: Flagging Additional Dreadnought
This line ensures dreadnought increment. It merges well withVenerable Ancients. No immediate conflicts detected.
1112-1114: Lamenters: Predator Removal
Zeroing out predators for the Lamenters suits their tragic theme. This direct approach is stable, as negative vehicles remain permissible.
1115-1117: Iron Hands Enhancement
Granting +1 Predator to Iron Hands is faithful to lore. The assignment statement is correct; the Omnissiah commends this.
1261-1263: Region Tag for Totals
Introducing a new region marker clarifies the beginning of per-company marine total logic. Good for overall code structure.
2290-2307: Chapter HQ Array Reinitialisation
These lines systematically prepare array slots for HQ marines with clarity. The expansions are consistent with negative-value tolerance. The Emperor himself would be pleased by such thorough initialization.
2399-2400: Chief Librarian Condition
Skipping creation if Psykers are disallowed is well-handled. This maintains code stability if “Psyker Intolerant” is active.
2459-2462: Retinue of Renown
Inserting extra Honour Guard for special chapters is thematically consistent. Adequate boundary checks appear in place, preventing overshoot on array indexing.
2577-2597: Vehicle Key Dump to 10th Company
Transferring additional vehicles from JSON to the 10th Company is a neat solution. Ensure that future expansions requiring more intricate distribution can override or refine these logic lines.
2745-3044: Company Loop Vehicle & Marine Addition
Allocating roles or vehicles based on_roleand_coy.coyreveals a data-driven approach. This upholds your negative value design with minimal gating logic. Keep an eye on performance if expansions demand more complex checks.
3164-3179: add_veh_to_company
The function methodically sets each property for newly spawned vehicles. This pleases the Omnissiah, as every detail is accounted for. No immediate issues found.
3277-3393: load_chapter_master_equipment
This method elegantly merges base gear with potential JSON-defined artifacts. Properly assigned to the Chapter Master via artifact slot logic. Just confirm that consecutive artifacts do not exceed array bounds.
Purpose
Describe your changes/additions
equal_specialiststo make other kinds of structure-altering settings possible and easier to implement, such as Neophyte distributiongame_start_squads()that i haven't unravelled yetWhat can/needs to be improved/changed
Testing done
Related things and/or additional context