Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
cc66a5a
start porting to OOP Missions
OH296 Aug 12, 2026
d0bc872
more missioin bitws
OH296 Aug 12, 2026
10070ba
Merge remote-tracking branch 'adeptus/main' into mission_upgrades
OH296 Sep 15, 2026
ac05a83
continuation of OOP missions
OH296 Sep 15, 2026
b4f76e8
Merge remote-tracking branch 'adeptus/main' into mission_upgrades
OH296 Sep 17, 2026
73f1d83
majority of port done
OH296 Sep 17, 2026
efa0c7c
Update scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml
OH296 Sep 17, 2026
efde849
Update scripts/scr_crusade/scr_crusade.gml
OH296 Sep 17, 2026
845e6a4
correct indexing
OH296 Sep 17, 2026
21536fb
Apply suggestion from @cubic-dev-ai[bot]
OH296 Sep 17, 2026
ed2f4a2
Refactor missions to use object-oriented approach
OH296 Sep 19, 2026
3f427f9
Refactor planet problem management to PlanetData objects
OH296 Sep 19, 2026
ff83281
Refine PlanetData problem management and remove legacy helpers
OH296 Sep 19, 2026
220d5ec
Refactor battle queuing to centralize logic and pass structured data
OH296 Sep 20, 2026
5a04082
Refactor mission battle logic to use PlanetProblem objects
OH296 Sep 21, 2026
ca017d0
Implement structured data for enemy battle setup
OH296 Sep 21, 2026
ff50eeb
Refactor mission combat setup to use structured data
OH296 Sep 22, 2026
9f54d04
Streamline Inquisition Demon World mission generation and UI
OH296 Sep 22, 2026
962cacd
Consolidate Mechanicus Mars mission resolution
OH296 Sep 22, 2026
50139ba
Refactor Inquisition Necron Tomb mission logic
OH296 Sep 23, 2026
4b03eda
Refactor planet data access through `PlanetData` object
OH296 Sep 23, 2026
290be04
Refactor mission unit selection and assignment
OH296 Sep 23, 2026
5c0daf9
Refactor PlanetProblem lifecycle and event handling
OH296 Sep 23, 2026
7b41795
Refactor mission termination to use `delete` flag
OH296 Sep 23, 2026
21bc626
Merge remote-tracking branch 'adeptus/main' into mission_upgrades
OH296 Sep 23, 2026
deaea10
cleanup and scope
OH296 Sep 25, 2026
23d2911
Centralize mission battle outcome processing
OH296 Sep 25, 2026
1571afa
Implement 'Hive Fleet to Cult' mission and refine mission state manag…
OH296 Sep 25, 2026
187dafa
Remove obsolete planet problem utility functions
OH296 Sep 25, 2026
db1643d
Merge remote-tracking branch 'adeptus/main' into mission_upgrades
OH296 Sep 25, 2026
65e5ee4
make inquisition recon mission trigger on turn end
OH296 Sep 25, 2026
2ca2a2a
var name
OH296 Sep 25, 2026
a4ef6eb
Merge remote-tracking branch 'adeptus/main' into mission_upgrades
OH296 Sep 25, 2026
05e0a18
remove legacy temp obj
OH296 Sep 25, 2026
d9e5856
Merge remote-tracking branch 'adeptus/main' into mission_upgrades
OH296 Sep 26, 2026
a024a92
finish migrating hunt fallen to new system
OH296 Sep 26, 2026
1ba1b92
split of problems that effect the whole system as system problems
OH296 Sep 26, 2026
128f3f5
count down for system based problems
OH296 Sep 26, 2026
2164788
proper naming of files
OH296 Sep 26, 2026
bfd670d
make it compile
OH296 Sep 26, 2026
e60e3dd
review points
OH296 Sep 26, 2026
467dd7f
fully move inquisition recon to the new format
OH296 Sep 26, 2026
33fb6e6
review points
OH296 Sep 26, 2026
e435dfd
consistent naming of inquis missions and port purge mission
OH296 Sep 26, 2026
229f646
misc
OH296 Sep 27, 2026
0cd31bb
structured names for missions to reduce bloat
OH296 Sep 27, 2026
abef2a4
add documentation in the top of PlanetProblem script
OH296 Sep 27, 2026
a1edff6
better docs
OH296 Sep 27, 2026
d2031f9
review points amd update systemProblem call points
OH296 Sep 27, 2026
eea3d2b
move remainder of inquisition tomb to modern method
OH296 Sep 27, 2026
956a4d6
remove use of estimate
OH296 Sep 27, 2026
107a2e3
tweaks
OH296 Sep 27, 2026
bce7c33
minor errors
OH296 Sep 27, 2026
16e333e
save and load
OH296 Sep 27, 2026
eda4646
add on_purge mission hook point and complete inquisition_purge mission
OH296 Sep 27, 2026
89ba189
correct local var names
OH296 Sep 27, 2026
d242575
Update scripts/scr_marine_struct/scr_marine_struct.gml
OH296 Sep 27, 2026
ca22304
loadinng safety
OH296 Sep 27, 2026
a0f6514
Merge remote-tracking branch 'origin/mission_upgrades' into mission_u…
OH296 Sep 27, 2026
6413295
remove legacy variables
OH296 Sep 27, 2026
7e89b2f
more review points
OH296 Sep 27, 2026
42dc887
extract mission select feature drawing into PlanetProblem constructor
OH296 Sep 27, 2026
a6206ad
clean arrays of marines throughout
OH296 Sep 27, 2026
e6a9e93
Update scripts/scr_marine_struct/scr_marine_struct.gml
OH296 Sep 27, 2026
bb151f9
review
OH296 Sep 27, 2026
d4fc557
Merge remote-tracking branch 'origin/mission_upgrades' into mission_u…
OH296 Sep 27, 2026
34a2e63
better docs
OH296 Sep 27, 2026
f81e611
reviews
OH296 Sep 27, 2026
ccb4b1c
more tweaks
OH296 Sep 27, 2026
76e69f2
port more logic over to missin init sequence
OH296 Sep 28, 2026
f85592b
now testing
OH296 Sep 28, 2026
5f8551d
spelling and stuff
OH296 Sep 28, 2026
e39fa86
add delete_mission flag to all resolve functions
OH296 Sep 28, 2026
1e4c31c
auto delete errored missions
OH296 Sep 28, 2026
cf61a7b
further upgrades
OH296 Sep 28, 2026
d2a5c96
review points
OH296 Sep 28, 2026
f7c2b8d
more review points
OH296 Sep 28, 2026
43fde94
use PLANET_ARRAY_SIZE macro for system array creation
OH296 Sep 28, 2026
1a445b6
variable naming
OH296 Sep 28, 2026
ba5424b
even more minor changes
OH296 Sep 28, 2026
3eb7d5e
move rewards
OH296 Sep 28, 2026
5de9e66
minor review points
OH296 Sep 28, 2026
76bbc60
typos
OH296 Sep 28, 2026
708045f
argument changes
OH296 Sep 28, 2026
9b7070c
wrong arguments to alter_disposition
OH296 Sep 28, 2026
e2dcad9
arg order
OH296 Sep 28, 2026
dac29f7
passing name not p_id
OH296 Sep 28, 2026
eb39eca
add fleet problems
OH296 Sep 28, 2026
950459d
move end rurn player fleet stuff to a function call
OH296 Sep 28, 2026
7d7dd1e
make player fleet move make sense
OH296 Sep 28, 2026
050b1f0
fix discovering craft worlds
OH296 Sep 28, 2026
04706f5
consolidate great crusade mission
OH296 Sep 28, 2026
d2a1cec
cleanup crusade results
OH296 Sep 28, 2026
a346665
more tweaks
OH296 Sep 28, 2026
bf2b83c
geerally clean up fleet based functions
OH296 Sep 29, 2026
3af790c
rebuild mission log updater to account for new architecture
OH296 Sep 29, 2026
afda1d3
add a system debug slate by hijacking garrison slate when not in use
OH296 Sep 29, 2026
a320d0d
apply inheritance to cut down on bloat
OH296 Sep 29, 2026
3d5d10e
Merge remote-tracking branch 'adeptus/main' into mission_upgrades
OH296 Sep 29, 2026
4bda6c6
Merge remote-tracking branch 'adeptus/main' into mission_upgrades
OH296 Sep 30, 2026
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
4 changes: 3 additions & 1 deletion ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,6 @@
{"id":{"name":"obj_temp3","path":"objects/obj_temp3/obj_temp3.yy",},},
{"id":{"name":"obj_temp5","path":"objects/obj_temp5/obj_temp5.yy",},},
{"id":{"name":"obj_temp6","path":"objects/obj_temp6/obj_temp6.yy",},},
{"id":{"name":"obj_temp7","path":"objects/obj_temp7/obj_temp7.yy",},},
{"id":{"name":"obj_temp8","path":"objects/obj_temp8/obj_temp8.yy",},},
{"id":{"name":"obj_timer","path":"objects/obj_timer/obj_timer.yy",},},
{"id":{"name":"obj_tooltip","path":"objects/obj_tooltip/obj_tooltip.yy",},},
Expand Down Expand Up @@ -754,6 +753,7 @@
{"id":{"name":"ErrorHandler","path":"scripts/ErrorHandler/ErrorHandler.yy",},},
{"id":{"name":"exp_and_exp_growth","path":"scripts/exp_and_exp_growth/exp_and_exp_growth.yy",},},
{"id":{"name":"explode_script","path":"scripts/explode_script/explode_script.yy",},},
{"id":{"name":"FleetProblem","path":"scripts/FleetProblem/FleetProblem.yy",},},
{"id":{"name":"GitHub","path":"scripts/GitHub/GitHub.yy",},},
{"id":{"name":"GitHubBugReporter","path":"scripts/GitHubBugReporter/GitHubBugReporter.yy",},},
{"id":{"name":"GitHubContent","path":"scripts/GitHubContent/GitHubContent.yy",},},
Expand All @@ -774,6 +774,7 @@
{"id":{"name":"NameGenerator","path":"scripts/NameGenerator/NameGenerator.yy",},},
{"id":{"name":"NotificationAlert","path":"scripts/NotificationAlert/NotificationAlert.yy",},},
{"id":{"name":"object_get_depth","path":"scripts/object_get_depth/object_get_depth.yy",},},
{"id":{"name":"PlanetProblem","path":"scripts/PlanetProblem/PlanetProblem.yy",},},
{"id":{"name":"scr_add_corruption","path":"scripts/scr_add_corruption/scr_add_corruption.yy",},},
{"id":{"name":"scr_add_item","path":"scripts/scr_add_item/scr_add_item.yy",},},
{"id":{"name":"scr_add_man","path":"scripts/scr_add_man/scr_add_man.yy",},},
Expand Down Expand Up @@ -993,6 +994,7 @@
{"id":{"name":"SectorHandler","path":"scripts/SectorHandler/SectorHandler.yy",},},
{"id":{"name":"Set","path":"scripts/Set/Set.yy",},},
{"id":{"name":"SettingsManager","path":"scripts/SettingsManager/SettingsManager.yy",},},
{"id":{"name":"SystemProblem","path":"scripts/SystemProblem/SystemProblem.yy",},},
{"id":{"name":"TooltipBuilder","path":"scripts/TooltipBuilder/TooltipBuilder.yy",},},
{"id":{"name":"turn_towards_point","path":"scripts/turn_towards_point/turn_towards_point.yy",},},
{"id":{"name":"UIComponents","path":"scripts/UIComponents/UIComponents.yy",},},
Expand Down
1 change: 0 additions & 1 deletion docs/CHEATCODES.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ Arguments with stars `(argument*)` can be omitted.
- `mechmission (mission*)` - triggers a mechaniicus mission, can be run as is or with an optional missiono parameter to specify a particular mission
- `mech_mars`
- `mech_raider`
- `mech_bionics`


### Disposition:
Expand Down
2 changes: 1 addition & 1 deletion objects/obj_bomb_select/Alarm_1.gml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ship_use = [];
ship_max = [];
ship_ide = [];

var _ships = fleet_full_ship_array(sh_target);
var _ships = sh_target.full_ship_array();
max_ships = array_length(_ships);
bomb_a = calculate_fleet_bombard_score(_ships);
var _total_fleet_loaded = calculate_fleet_content_size(_ships);
Expand Down
5 changes: 3 additions & 2 deletions objects/obj_drop_select/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ btn_back.button_color = CM_GREEN_COLOR;
btn_back.width = 90;

if (purge == 0) {
var _p_data = p_target.get_planet_data(planet_number);
sisters = p_target.p_sisters[planet_number];
eldar = p_target.p_eldar[planet_number];
ork = p_target.p_orks[planet_number];
Expand Down Expand Up @@ -211,11 +212,11 @@ if (purge == 0) {
}

var spesh = false;
if ((planet_feature_bool(p_target.p_feature[planet_number], eP_FEATURES.WARLORD10) == 1) && (obj_controller.faction_defeated[10] == 0) && (obj_controller.faction_gender[10] == 1) && (obj_controller.known[eFACTION.CHAOS] > 0) && (obj_controller.turn >= obj_controller.chaos_turn)) {
if ((_p_data.has_feature(eP_FEATURES.WARLORD10)) && (obj_controller.faction_defeated[10] == 0) && (obj_controller.faction_gender[10] == 1) && (obj_controller.known[eFACTION.CHAOS] > 0) && (obj_controller.turn >= obj_controller.chaos_turn)) {
spesh = true;
}

if (has_problem_planet(planet_number, "tyranid_org", p_target)) {
if (_p_data.has_problem("inquisition_tyranid_org")) {
tyranids = 2;
attacking = 9;
}
Expand Down
11 changes: 0 additions & 11 deletions objects/obj_en_fleet/Alarm_1.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
try {
var orb = orbiting;

if ((round(owner) != eFACTION.IMPERIUM) && (navy == 1)) {
owner = 0;
}
Expand Down Expand Up @@ -205,15 +203,6 @@ try {
}
}

if (owner == eFACTION.TAU) {

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.

P2: This removes the only way the player discovers the Tau faction without flying into Tau space: a Tau fleet parking within 80 px of a stationary player fleet. No replacement exists — only obj_p_fleet/Create_0.gml still sets known[eFACTION.TAU], and only when the player arrives at a Tau-owned planet. If the deletion is intentional, note it; otherwise keep the proximity check (e.g., in the enemy-fleet end-turn logic) so the discovery path survives the refactor.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At objects/obj_en_fleet/Alarm_1.gml, line 208:

<comment>This removes the only way the player discovers the Tau faction without flying into Tau space: a Tau fleet parking within 80 px of a stationary player fleet. No replacement exists — only obj_p_fleet/Create_0.gml still sets known[eFACTION.TAU], and only when the player arrives at a Tau-owned planet. If the deletion is intentional, note it; otherwise keep the proximity check (e.g., in the enemy-fleet end-turn logic) so the discovery path survives the refactor.</comment>

<file context>
@@ -205,15 +203,6 @@ try {
-
         if (owner == eFACTION.TYRANIDS) {
             // Juggle bio-resources
             if (capital_number * 2 > frigate_number) {
</file context>

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.

P2: Removing this block changes Tau first-contact: known[eFACTION.TAU] is now only set when the player fleet arrives at a Tau-owned star (obj_p_fleet/Create_0.gml:103) or wins a battle (obj_ncombat/Alarm_7.gml:437). On the target branch an idle Tau fleet parked within 80px of a player fleet (at any star — e.g. a Tau raid/expansion fleet sitting in a neutral or player system) revealed the faction. A player who encounters Tau away from Tau territory without winning a battle will never discover them, which gates the diplomacy tab and Tau gossip events. If passive contact is intended, re-add a proximity or fleet-problem-based trigger.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At objects/obj_en_fleet/Alarm_1.gml, line 208:

<comment>Removing this block changes Tau first-contact: `known[eFACTION.TAU]` is now only set when the player fleet arrives at a Tau-owned star (obj_p_fleet/Create_0.gml:103) or wins a battle (obj_ncombat/Alarm_7.gml:437). On the target branch an idle Tau fleet parked within 80px of a player fleet (at any star — e.g. a Tau raid/expansion fleet sitting in a neutral or player system) revealed the faction. A player who encounters Tau away from Tau territory without winning a battle will never discover them, which gates the diplomacy tab and Tau gossip events. If passive contact is intended, re-add a proximity or fleet-problem-based trigger.</comment>

<file context>
@@ -205,15 +203,6 @@ try {
-
         if (owner == eFACTION.TYRANIDS) {
             // Juggle bio-resources
             if (capital_number * 2 > frigate_number) {
</file context>

if (instance_exists(obj_p_fleet) && (obj_controller.known[eFACTION.TAU] == 0)) {
var p_ship = instance_nearest(x, y, obj_p_fleet);
if ((p_ship.action == "") && (point_distance(x, y, p_ship.x, p_ship.y) <= 80)) {
obj_controller.known[eFACTION.TAU] = 1;
}
}
}

if (owner == eFACTION.TYRANIDS) {
// Juggle bio-resources
if (capital_number * 2 > frigate_number) {
Expand Down
26 changes: 13 additions & 13 deletions objects/obj_en_fleet/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ escort_health = 100;

/// Called from save function to take all object variables and convert them to a json savable format and return it
serialize = function() {
var object_fleet = self;
var _object_fleet = self;

var save_data = {
var _save_data = {
obj: object_get_name(object_index),
x,
y,
Expand All @@ -98,34 +98,34 @@ serialize = function() {
"in_view",
];

copy_serializable_fields(object_fleet, save_data, excluded_from_save);
copy_serializable_fields(_object_fleet, _save_data, excluded_from_save);

return save_data;
return _save_data;
};
deserialize = function(save_data) {
deserialize = function(_save_data) {
var exclusions = [
"id",
"cargo_data",
"orbiting",
]; // skip automatic setting of certain vars, handle explicitly later

// Automatic var setting
var all_names = struct_get_names(save_data);
var _len = array_length(all_names);
var _all_names = struct_get_names(_save_data);
var _len = array_length(_all_names);
for (var i = 0; i < _len; i++) {
var var_name = all_names[i];
if (array_contains(exclusions, var_name)) {
var _var_name = _all_names[i];
if (array_contains(exclusions, _var_name)) {
continue;
}
var loaded_value = struct_get(save_data, var_name);
var _loaded_value = struct_get(_save_data, _var_name);
try {
variable_instance_set(self, var_name, loaded_value);
variable_instance_set(self, _var_name, _loaded_value);
} catch (e) {
LOGGER.exception("Deserialization failed", e);
}
}
if (struct_exists(save_data, "cargo_data")) {
variable_instance_set(self, "cargo_data", save_data.cargo_data);
if (struct_exists(_save_data, "cargo_data")) {
variable_instance_set(self, "cargo_data", _save_data.cargo_data);
if (fleet_has_cargo("ork_warboss")) {
var _boss = new NewPlanetFeature(eP_FEATURES.ORKWARBOSS);
_boss.load_json_data(cargo_data.ork_warboss);
Expand Down
35 changes: 3 additions & 32 deletions objects/obj_en_fleet/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,9 @@ if (ii_check == 0) {
}
}

if (owner == eFACTION.TYRANIDS) {
if (owner == eFACTION.TYRANIDS && orbiting != noone) {

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.

P2: Custom agent: Code Quality Review

orbiting != noone does not prove that the referenced star is still active, so these member accesses can raise a missing-instance error after the star is destroyed or deactivated. Guard this branch with instance_exists(orbiting) before calling has_orbiting_player_fleet() or reading vision.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At objects/obj_en_fleet/Step_0.gml, line 70:

<comment>`orbiting != noone` does not prove that the referenced star is still active, so these member accesses can raise a missing-instance error after the star is destroyed or deactivated. Guard this branch with `instance_exists(orbiting)` before calling `has_orbiting_player_fleet()` or reading `vision`.</comment>

<file context>
@@ -67,15 +67,9 @@ if (ii_check == 0) {
 }
 
-if (owner == eFACTION.TYRANIDS) {
+if (owner == eFACTION.TYRANIDS && orbiting != noone) {
     image_alpha = 0;
-    if (instance_exists(obj_p_fleet)) {
</file context>

image_alpha = 0;
if (instance_exists(obj_p_fleet)) {
var bundy = instance_nearest(x, y, obj_p_fleet);
if ((bundy.action == "") && (self.action == "") && (point_distance(bundy.x, bundy.y, x, y) < 90) && (bundy.x > x) && (bundy.y < y)) {
image_alpha = 1;
}
}
if ((instance_nearest(x, y - 32, obj_star).vision == 1) && (action == "")) {
if (orbiting.has_orbiting_player_fleet() || orbiting.vision == 1){
Comment on lines +70 to +72

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.

P2: Moving Tyranid fleets now skip the alpha reset because set_fleet_movement() clears orbiting before setting action = "move". A fleet visible at its previous star therefore remains visible while traveling; keep the reset under the faction check and guard only the orbiting lookup with instance_exists(orbiting).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At objects/obj_en_fleet/Step_0.gml, line 70:

<comment>Moving Tyranid fleets now skip the alpha reset because `set_fleet_movement()` clears `orbiting` before setting `action = "move"`. A fleet visible at its previous star therefore remains visible while traveling; keep the reset under the faction check and guard only the orbiting lookup with `instance_exists(orbiting)`.</comment>

<file context>
@@ -67,15 +67,9 @@ if (ii_check == 0) {
 }
 
-if (owner == eFACTION.TYRANIDS) {
+if (owner == eFACTION.TYRANIDS && orbiting != noone) {
     image_alpha = 0;
-    if (instance_exists(obj_p_fleet)) {
</file context>
Suggested change
if (owner == eFACTION.TYRANIDS && orbiting != noone) {
image_alpha = 0;
if (instance_exists(obj_p_fleet)) {
var bundy = instance_nearest(x, y, obj_p_fleet);
if ((bundy.action == "") && (self.action == "") && (point_distance(bundy.x, bundy.y, x, y) < 90) && (bundy.x > x) && (bundy.y < y)) {
image_alpha = 1;
}
}
if ((instance_nearest(x, y - 32, obj_star).vision == 1) && (action == "")) {
if (orbiting.has_orbiting_player_fleet() || orbiting.vision == 1){
if (owner == eFACTION.TYRANIDS) {
image_alpha = 0;
if (instance_exists(orbiting) && (orbiting.has_orbiting_player_fleet() || orbiting.vision == 1)){

image_alpha = 1;
Comment on lines +70 to 73

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.

P2: Custom agent: Code Quality Review

Parenthesize the comparisons in these mixed-operator conditions and add the missing space before { to match CODE_STYLE.md and the surrounding GML formatting.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At objects/obj_en_fleet/Step_0.gml, line 70:

<comment>Parenthesize the comparisons in these mixed-operator conditions and add the missing space before `{` to match `CODE_STYLE.md` and the surrounding GML formatting.</comment>

<file context>
@@ -67,15 +67,9 @@ if (ii_check == 0) {
 }
 
-if (owner == eFACTION.TYRANIDS) {
+if (owner == eFACTION.TYRANIDS && orbiting != noone) {
     image_alpha = 0;
-    if (instance_exists(obj_p_fleet)) {
</file context>
Suggested change
if (owner == eFACTION.TYRANIDS && orbiting != noone) {
image_alpha = 0;
if (instance_exists(obj_p_fleet)) {
var bundy = instance_nearest(x, y, obj_p_fleet);
if ((bundy.action == "") && (self.action == "") && (point_distance(bundy.x, bundy.y, x, y) < 90) && (bundy.x > x) && (bundy.y < y)) {
image_alpha = 1;
}
}
if ((instance_nearest(x, y - 32, obj_star).vision == 1) && (action == "")) {
if (orbiting.has_orbiting_player_fleet() || orbiting.vision == 1){
image_alpha = 1;
if ((owner == eFACTION.TYRANIDS) && (orbiting != noone)) {
image_alpha = 0;
if (orbiting.has_orbiting_player_fleet() || (orbiting.vision == 1)) {
image_alpha = 1;

}
}
Expand Down Expand Up @@ -146,30 +140,7 @@ if ((owner == eFACTION.TYRANIDS) && (trade_goods == "")) {
}

if (global.load >= 0) {
if (owner == eFACTION.IMPERIUM) {
sprite_index = spr_fleet_imperial;
}
if (owner == eFACTION.MECHANICUS) {
sprite_index = spr_fleet_mechanicus;
}
if (owner == eFACTION.INQUISITION) {
sprite_index = spr_fleet_inquisition;
}
if (owner == eFACTION.ELDAR) {
sprite_index = spr_fleet_eldar;
}
if (owner == eFACTION.ORK) {
sprite_index = spr_fleet_ork;
}
if (owner == eFACTION.TAU) {
sprite_index = spr_fleet_tau;
}
if (owner == eFACTION.TYRANIDS) {
sprite_index = spr_fleet_tyranid;
}
if (owner == eFACTION.CHAOS) {
sprite_index = spr_fleet_chaos;
}
choose_fleet_sprite_image();
}
if (image_index == 0) {
image_index = 1;
Expand Down
22 changes: 21 additions & 1 deletion objects/obj_enunit/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ hostile_splash = 0;
flank = 0;
flyer = 0; // Works same as flank, but does not get denoted as such
neww = 0;

enemy_dudes = 0;
column_size = 0;

unit_count = 0;
Expand Down Expand Up @@ -75,6 +75,26 @@ dudes_wep2 = array_create(_array_size, "");
dudes_gear = array_create(_array_size, "");
dudges_mobi = array_create(_array_size, "");

add_enemies = function(enemy_data){
var _start_index = 1;
for (var i = 1; i < _array_size; i++)
if (dudes[i] == ""){
_start_index = i;
}
{

}
Comment on lines +80 to +86

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.

P1: add_enemies selects index 1001 on a fresh unit, while Alarm_1 only initializes indices 1–700, so data-driven battles contain no processed enemies. Find the first empty slot and stop the scan there.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At objects/obj_enunit/Create_0.gml, line 80:

<comment>`add_enemies` selects index 1001 on a fresh unit, while `Alarm_1` only initializes indices 1–700, so data-driven battles contain no processed enemies. Find the first empty slot and stop the scan there.</comment>

<file context>
@@ -75,6 +75,26 @@ dudes_wep2 = array_create(_array_size, "");
 
+add_enemies = function(enemy_data){
+    var _start_index =  1;
+    for (var i = 1; i < _array_size; i++)
+        if (dudes[i] == ""){
+            _start_index = i;
</file context>
Suggested change
for (var i = 1; i < _array_size; i++)
if (dudes[i] == ""){
_start_index = i;
}
{
}
for (var i = 1; i < _array_size; i++) {
if (dudes[i] == "") {
_start_index = i;
break;
}
}

for (var i = 0; i < array_length(enemy_data); i++){
var _data = enemy_data[i];
dudes[_start_index] = _data.name;
dudes_num[_start_index] = _data.number;
if (struct_exists(_data, "special")){
dudes_special[_start_index] = _data.special;
}
_start_index++;
enemy_dudes += _data.number;
}
}
alarm[1] = 5;

hit = function() {
Expand Down
2 changes: 1 addition & 1 deletion objects/obj_fleet_select/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ selection_window.inside_method = function() {

var math_string = (string_width("Manage Units") / 2) + 6;
if (point_and_click(draw_unit_buttons([center_draw - math_string, yy + height - 50], "Manage Units", [1, 1], c_blue))) {
var _fleet_array = fleet_full_ship_array(current_fleet);
var _fleet_array = current_fleet.full_ship_array();
var _fleet_marines = collect_role_group("all", ["", 0, _fleet_array]);

group_selection(_fleet_marines, {purpose: "Ship Management", purpose_code: "manage", number: 0, system: 0, ships: _fleet_array, feature: "none", planet: 0, selections: []});
Expand Down
14 changes: 7 additions & 7 deletions objects/obj_ini/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,21 @@ deserialize = function(save_data) {
]; // skip automatic setting of certain vars, handle explicitly later

// Automatic var setting
var all_names = struct_get_names(save_data);
var _all_names = struct_get_names(save_data);

if (!array_contains(all_names, "chapter_squad_arrangement")) {
if (!array_contains(_all_names, "chapter_squad_arrangement")) {
chapter_squad_arrangement = json_to_gamemaker(working_directory + $"main/squads/company_squad_builds.json", json_parse);
}

for (var i = 0; i < array_length(all_names); i++) {
var var_name = all_names[i];
if (array_contains(exclusions, var_name)) {
for (var i = 0; i < array_length(_all_names); i++) {
var _var_name = _all_names[i];
if (array_contains(exclusions, _var_name)) {
continue;
}

var loaded_value = struct_get(save_data, var_name);
var loaded_value = struct_get(save_data, _var_name);
try {
variable_instance_set(id, var_name, loaded_value);
variable_instance_set(id, _var_name, loaded_value);
} catch (e) {
LOGGER.exception("Deserialization failed", e);
}
Expand Down
Loading
Loading