Skip to content
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
55fec8e
Create scr_battle_count.gml
Frost-bit-jpg Mar 27, 2025
417e4bd
Create scr_battle_count.yy
Frost-bit-jpg Mar 27, 2025
4e7cc4d
Merge branch 'Adeptus-Dominus:main' into scr_battle_count
Frost-bit-jpg Mar 27, 2025
2532464
Update ChapterMaster.yyp
Frost-bit-jpg Mar 27, 2025
b52591b
Update Alarm_5.gml
Frost-bit-jpg Mar 27, 2025
e7f5175
Update scr_enemy_ai_a.gml
Frost-bit-jpg Mar 27, 2025
f9e4bc2
Update scr_battle_count.gml
Frost-bit-jpg Mar 27, 2025
7f6ff0d
Update scr_battle_count.gml
Frost-bit-jpg Mar 27, 2025
d93abb2
Update scr_battle_count.gml
Frost-bit-jpg Mar 27, 2025
fb55269
Update scr_enemy_ai_a.gml
Frost-bit-jpg Mar 27, 2025
a233b7d
Update scr_enemy_ai_a.gml
Frost-bit-jpg Mar 27, 2025
03d4573
Update scr_enemy_ai_a.gml
Frost-bit-jpg Mar 27, 2025
c5411af
Update Alarm_5.gml
Frost-bit-jpg Mar 27, 2025
8c32358
Update scr_battle_count.gml
Frost-bit-jpg Mar 27, 2025
f6c1228
Update scr_enemy_ai_a.gml
Frost-bit-jpg Mar 27, 2025
d48bb6a
Update Create_0.gml
Frost-bit-jpg Mar 27, 2025
c4f1acb
Update scr_load_controller.gml
Frost-bit-jpg Mar 27, 2025
fbde5da
Update scr_save_controller.gml
Frost-bit-jpg Mar 27, 2025
80c2456
Update scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml
Frost-bit-jpg Mar 27, 2025
605af3c
Update scripts/scr_battle_count/scr_battle_count.gml
Frost-bit-jpg Mar 27, 2025
8a5f5d9
Merge branch 'main' into scr_battle_count
Frost-bit-jpg Mar 28, 2025
ff1bab5
Update scripts/scr_battle_count/scr_battle_count.gml
Frost-bit-jpg Mar 28, 2025
2729420
Update scr_battle_count.gml
Frost-bit-jpg Mar 28, 2025
05d18eb
Update scr_battle_count.gml
Frost-bit-jpg Mar 28, 2025
b6c7cd0
Update scr_battle_count.gml
Frost-bit-jpg Mar 28, 2025
00e0d51
Update scripts/scr_battle_count/scr_battle_count.gml
Frost-bit-jpg Mar 28, 2025
85bf01a
Update scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml
Frost-bit-jpg Mar 28, 2025
18793de
fix: failed to check demonworlds as hostile
Frost-bit-jpg Mar 28, 2025
4312395
fix: scr_battle_count metadata
MCPO-Spartan-117 Mar 28, 2025
b300e25
fix: Proper comment
MCPO-Spartan-117 Mar 28, 2025
01aaa7a
fix: Remove diff symbols from bot
MCPO-Spartan-117 Mar 28, 2025
25b40e8
fix: Format and fix for loop
MCPO-Spartan-117 Mar 28, 2025
e398fb7
fix: Proper colors
MCPO-Spartan-117 Mar 28, 2025
2b8f6ab
refactor: Array and struct for readability and maintenance
MCPO-Spartan-117 Mar 28, 2025
9c47283
style: Auto changes
MCPO-Spartan-117 Mar 28, 2025
0b345ed
refactor: Use elses and some formatting
MCPO-Spartan-117 Mar 28, 2025
826bd9c
Merge pull request #2 from MCPO-Spartan-117/scr_battle_count
Frost-bit-jpg Mar 28, 2025
0df49ad
Update scripts/scr_battle_count/scr_battle_count.gml
OH296 Mar 28, 2025
869907b
Update scripts/scr_battle_count/scr_battle_count.gml
Frost-bit-jpg Mar 29, 2025
66738db
Merge branch 'main' into scr_battle_count
Frost-bit-jpg Mar 29, 2025
627d8d6
Merge branch 'main' into scr_battle_count
Frost-bit-jpg Mar 30, 2025
4b3ae9e
Merge branch 'main' into scr_battle_count
Frost-bit-jpg Mar 31, 2025
a8951d5
Merge branch 'main' into scr_battle_count
Frost-bit-jpg Apr 2, 2025
c655f4a
Revert "refactor: Use elses and some formatting"
MCPO-Spartan-117 Apr 2, 2025
63ee714
Revert "fix: failed to check demonworlds as hostile"
MCPO-Spartan-117 Apr 2, 2025
ea571a5
Merge pull request #7 from MCPO-Spartan-117/scr_battle_count
Frost-bit-jpg Apr 2, 2025
d4a15f6
Merge branch 'main' into scr_battle_count
Frost-bit-jpg Apr 12, 2025
fae1b8e
Update scripts/scr_load_controller/scr_load_controller.gml
Frost-bit-jpg Apr 12, 2025
14c4b91
Merge branch 'main' into scr_battle_count
Frost-bit-jpg May 11, 2025
a5de627
Merge branch 'main' into scr_battle_count
Frost-bit-jpg May 16, 2025
262bd45
Update scr_battle_count.gml
Frost-bit-jpg May 16, 2025
8aa0d3e
Update scr_battle_count.gml
Frost-bit-jpg May 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@
{"id":{"name":"scr_pen_And_paper","path":"scripts/scr_pen_And_paper/scr_pen_And_paper.yy",},},
{"id":{"name":"scr_perils_table","path":"scripts/scr_perils_table/scr_perils_table.yy",},},
{"id":{"name":"scr_planetary_feature","path":"scripts/scr_planetary_feature/scr_planetary_feature.yy",},},
{"id":{"name":"scr_battle_count","path":"scripts/scr_battle_count/scr_battle_count.yy",},},
{"id":{"name":"scr_PlanetData","path":"scripts/scr_PlanetData/scr_PlanetData.yy",},},
{"id":{"name":"scr_player_combat_weapon_stacks","path":"scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.yy",},},
{"id":{"name":"scr_player_fleet_combat_functions","path":"scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.yy",},},
Expand Down Expand Up @@ -1679,4 +1680,4 @@
"TextureGroups":[
{"$GMTextureGroup":"","%Name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","customOptions":"","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"name":"Default","resourceType":"GMTextureGroup","resourceVersion":"2.0","targets":-1,},
],
}
}
2 changes: 2 additions & 0 deletions objects/obj_ncombat/Alarm_5.gml
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ if (defeat=0) and (reduce_power=true){
p_owner[battle_planet] = eFACTION.Imperium
}
dispo[battle_planet] += 10;
global.enemies_cleared_count += 1;
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated
scr_battle_count();
scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name);
scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}", x, y);
if (dispo[battle_planet] >= 101) then p_owner[battle_planet] = 1;
Expand Down
70 changes: 70 additions & 0 deletions scripts/scr_battle_count/scr_battle_count.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
function scr_battle_count(){
// Ensure the global variable exists (safety check)
if (!variable_global_exists("enemies_cleared_count")) {
log_error("Global variable 'enemies_cleared_count' not found in check_purge_milestone!");
exit; // Exit the function if the counter doesn't exist
}
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated

// Check if the count is positive and a multiple of 4
if (global.enemies_cleared_count > 0 && (global.enemies_cleared_count mod 4 == 0)) {
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated

// --- ACTION TO PERFORM EVERY 4 CLEARS ---

// --- Randomly Choose Flavor Text ---
var _num_options = 5; // <<< SET THIS to the number of text options below
Copy link
Copy Markdown
Contributor

@MCPO-Spartan-117 MCPO-Spartan-117 Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really wish GM had a constant marker like in C++ but the compiler should make it one anyway.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MCPO-Spartan-117 instances like this where its defined within a function static approximates a c++ style constant marker

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static is static, they are not constants.

Copy link
Copy Markdown
Collaborator

@OH296 OH296 Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static is static, they are not constants.

They are in that they are reserved across all calls of a function so within the scope of the method they are are good as we have to a constant. And in the instance above it would be appropriate for it to be made a static to achieve the same goal is all i'm saying

Copy link
Copy Markdown
Contributor

@MCPO-Spartan-117 MCPO-Spartan-117 Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

statics are constant in the sense of they are stay for the entire process in the same place they were initialized, constants are something that is pre computed during compilation, and no, you shouldn't make this a static, it will probably override the compiler's logic and it wouldn't be a constant anymore, and it wouldn't solve any issues.

Copy link
Copy Markdown
Collaborator

@OH296 OH296 Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A static wouldn't be reducing handling any more than a var would

it would be stored in memory rather than being generated and gc'd. Its an almost irrelevant quibble but you asked.

What are you talking about? how is the part relevant? overriding the logic doesn't mean it wouldn't work.

Well i never saw what logic would be overridden in first place?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there is the misunderstanding,
This is the variable i'm talking about.
var _num_options = 5

Not the one from obj_controller.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be stored in memory rather than being generated and gc'd. Its an almost irrelevant quibble but you asked.

You slightly changed handling and that is it.

Well i never saw what logic would be overridden in first place?

Initiation and type qualifier.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there is the misunderstanding, This is the variable i'm talking about. var _num_options = 5

Not the one from obj_controller.

Okay sorry i'm reading back through the code i had a completely different variable for some insane reason. apologies. But now i'm reading through In general why is this data not just being put in a an array and a random item plucked from the array this is just overly verbose IMO

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright so considering how easy it might for some players to just clean the planet perhaps we can adjust it to be 6 or even 8? i'm open to suggestions to make it more complex if necessary.
Perhaps timeout?

var _text_choice = irandom(_num_options - 1); // Generates a random integer from 0 to (_num_options - 1)

// Use a switch statement for cleaner selection
switch (_text_choice) {

case 0: // Option 1 (Influential Ears)
scr_alert("blue", "reward", "Word of your Chapter's tireless defence of the Sector reaches influential ears within the Imperium.", 0, 0);
scr_event_log("INFO", "Imperial Factions note the Chapter's continued effectiveness in purging threats.");
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated
break;

case 1: // Option 2 (Efficiency Not Unnoticed)
scr_alert("blue", "reward", "The efficiency of your recent purges has not gone unnoticed. Certain Imperial factions mark your Chapter's progress.", 0, 0);
scr_event_log("INFO", "Imperial elements acknowledge the Chapter's effectiveness against sector threats.");
break;

case 2: // Option 3 (Bureaucratic Acknowledgment)
scr_alert("blue", "reward", "Data-slate communiques confirm receipt of your operational summaries. Standard commendations issued.", 0, 0);
scr_event_log("INFO", "Administratum logs successful anti-xenos/heretic operations by the Chapter.");
break;

case 3: // Option 4 (Faith and Fury)
scr_alert("blue", "reward", "Your Chapter's righteous fury against the enemies of Man strengthens the faith of nearby Imperial worlds.", 0, 0);
scr_event_log("INFO", "Tales of the Chapter's victories inspire piety and bolster relations with the faithful.");
break;

case 4: // Option 5 (Simple Effectiveness)
scr_alert("blue", "reward", "Reports highlight your Chapter's capability in neutralizing sector threats. Imperial support elements take note.", 0, 0);
scr_event_log("INFO", "Chapter operations demonstrably reduce enemy presence; Imperial factions approve.");
break;

// Add more cases here if you create more text options
// case 5:
// scr_alert(...);
// scr_event_log(...);
// break;

default: // Fallback in case something goes wrong
scr_alert("blue", "reward", "Your Chapter continues its duties effectively.", 0, 0);
scr_event_log("INFO", "Chapter effectiveness noted by Imperial factions.");
break;
}
// --- End Flavor Text Selection ---


// --- Apply disposition bonuses (without clamping - as requested previously) ---
if (instance_exists(obj_controller)) {
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated
obj_controller.disposition[eFACTION.Imperium] += 8;
obj_controller.disposition[eFACTION.Mechanicus] += 5;
obj_controller.disposition[eFACTION.Ecclesiarchy] += 6;
obj_controller.disposition[eFACTION.Inquisition] += 4;
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated
} else {
log_error("obj_controller not found in check_purge_milestone!");
}
// --- END ACTION TO PERFORM ---
}
}
Comment thread
Frost-bit-jpg marked this conversation as resolved.
12 changes: 12 additions & 0 deletions scripts/scr_battle_count/scr_battle_count.yy
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"$GMScript":"v1",
"%Name":"scr_battle_count",
"isCompatibility":false,
"isDnD":false,
"name":"scr_battle_count",
Comment thread
Frost-bit-jpg marked this conversation as resolved.
"parent":{
"name":"Helpers",
"path":"folders/Scripts/Helpers.yy",
},
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated
"resourceType":"GMScript",
"resourceVersion":"2.0",
}
61 changes: 14 additions & 47 deletions scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml
Original file line number Diff line number Diff line change
Expand Up @@ -818,57 +818,24 @@ function scr_enemy_ai_a() {

// 135;

var planet_saved = ((p_player[_run] + p_raided[_run]) > 0 && p_orks[_run] = 0 && p_tyranids[_run] < 4 && p_chaos[_run] = 0 && p_traitors[_run] = 0 && p_necrons[_run] = 0 && p_tau[_run] = 0);

var planet_saved = ((p_player[_run] + p_raided[_run]) > 0 && p_orks[_run] == 0 && p_tyranids[_run] < 4 && p_chaos[_run] == 0 && p_traitors[_run] == 0 && p_necrons[_run] == 0 && p_tau[_run] == 0);
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated
if (planet_saved){
var who_cleansed="";
var who_return="";
var make_alert = false;
var planet_string = $"{name} {scr_roman(_run)}";
if (p_owner[_run] = 7) {
who_cleansed="Orks"
make_alert=true;
}else if (p_owner[_run] = 8 && p_pdf[_run] = 0) {
who_cleansed="Tau"
make_alert=true;
}else if (p_owner[_run] = 13) {
who_cleansed="Necrons"
make_alert=true;
}else if (p_owner[_run] = 10) {
who_cleansed="Chaos"
make_alert=true;
} else if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0){
who_cleansed="Gene Stealer Cult"
make_alert=true;
delete_features(p_feature[_run], P_features.Gene_Stealer_Cult);
adjust_influence(eFACTION.Tyranids, -25, _run);
}
if (make_alert){
if (p_first[_run] = 1){
p_owner[_run] = eFACTION.Player;
who_return = "your";
} else if (p_first[_run] = 3 || p_type[_run]=="Forge"){
who_return="mechanicus";
obj_controller.disposition[3] += 10;
p_owner[_run] = eFACTION.Mechanicus
}else if (p_type[_run]!="Dead"){
who_return="the governor";
if (who_cleansed=="tau"){
who_return="a more suitable governer"
}
p_owner[_run] = eFACTION.Imperium;
}
dispo[_run] += 10;
scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name);
scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}", x, y);
if (dispo[_run] >= 101) then p_owner[_run] = 1;
var who_cleansed = ""; var who_return = ""; var make_alert = false; var original_owner_before_cleanse = p_owner[_run]; var planet_string = $"{name} {scr_roman(_run)}";
if (original_owner_before_cleanse == eFACTION.Ork) { who_cleansed="Orks"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Tau && p_pdf[_run] == 0) { who_cleansed="Tau"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Necrons) { who_cleansed="Necrons"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Chaos) { who_cleansed="Chaos"; make_alert=true; } else if (original_owner_before_cleanse == eFACTION.Tyranids || (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult) && p_tyranids[_run] <= 0)){ who_cleansed="Tyranid"; if (planet_feature_bool(p_feature[_run], P_features.Gene_Stealer_Cult)) { who_cleansed = "Genestealer Cult"; delete_features(p_feature[_run], P_features.Gene_Stealer_Cult); adjust_influence(eFACTION.Tyranids, -25, _run, self); } make_alert=true; }
if (make_alert){
if (p_first[_run] == eFACTION.Player){ p_owner[_run] = eFACTION.Player; who_return = "your Chapter"; } else if (p_first[_run] == eFACTION.Mechanicus || p_type[_run]=="Forge"){ who_return = "the Adeptus Mechanicus"; obj_controller.disposition[eFACTION.Mechanicus] += 5; p_owner[_run] = eFACTION.Mechanicus; } else if (p_type[_run] != "Dead"){ who_return = "the planetary governor"; if (who_cleansed=="Tau"){ who_return = "a loyal governor"; } var _is_shrine_or_cathedral = (p_type[_run] == "Shrine" || planet_feature_bool(p_feature[_run], P_features.Sororitas_Cathedral)); if (p_first[_run] == eFACTION.Ecclesiarchy || _is_shrine_or_cathedral) { if (p_first[_run] == eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Ecclesiarchy; who_return = "the Ecclesiarchy"; } obj_controller.disposition[eFACTION.Ecclesiarchy] += 5; } else { p_owner[_run] = eFACTION.Imperium; } } else { if (p_first[_run] != eFACTION.Player && p_first[_run] != eFACTION.Mechanicus && p_first[_run] != eFACTION.Ecclesiarchy) { p_owner[_run] = eFACTION.Imperium; who_return = "Imperial Administration"; } }
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated
if (who_return != "") {
dispo[_run] = max(-90, min(100, dispo[_run] + 10));
global.enemies_cleared_count += 1;
scr_battle_count();
scr_event_log("", $"{who_cleansed} cleansed from {planet_string}", name); scr_alert("green", "owner", $"{who_cleansed} cleansed from {planet_string}. Control returned to {who_return}.", x, y);
if (dispo[_run] >= 100 && p_owner[_run] != eFACTION.Player && p_type[_run] != "Dead") { p_owner[_run] = eFACTION.Player; scr_alert("blue", "owner", $"The populace of {planet_string} pledges allegiance to your Chapter!", x, y); }
}
Comment thread
Frost-bit-jpg marked this conversation as resolved.
Outdated
}

}

if (p_raided[_run] > 0) then p_raided[_run] = 0;
delete _planet_data;
} // end repeat here

}


// quene player battles here
Expand Down