From 3eafda624980f14c96fcdf7995082fb3c8ae3aad Mon Sep 17 00:00:00 2001 From: Blogaugis Date: Wed, 24 Dec 2025 16:46:17 +0200 Subject: [PATCH 1/2] feat: imperial missions - Version up to "v0.11.06.00"; - Adds 2 barebones missions for Imperium and Ecclesiarchy factions. --- ChapterMaster.yyp | 4 +- datafiles/main/version.json | 4 +- .../scr_imperium_mission.gml | 63 +++++++++++++++++++ .../scr_imperium_mission.yy | 13 ++++ scripts/scr_sob_mission/scr_sob_mission.gml | 63 +++++++++++++++++++ scripts/scr_sob_mission/scr_sob_mission.yy | 13 ++++ 6 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 scripts/scr_imperium_mission/scr_imperium_mission.gml create mode 100644 scripts/scr_imperium_mission/scr_imperium_mission.yy create mode 100644 scripts/scr_sob_mission/scr_sob_mission.gml create mode 100644 scripts/scr_sob_mission/scr_sob_mission.yy diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 6fd18c028..295ef5a32 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -579,7 +579,7 @@ "isEcma":false, "LibraryEmitters":[], "MetaData":{ - "IDEVersion":"2024.1400.0.901", + "IDEVersion":"2024.1400.0.904", }, "name":"ChapterMaster", "resources":[ @@ -835,6 +835,7 @@ {"id":{"name":"scr_image","path":"scripts/scr_image/scr_image.yy",},}, {"id":{"name":"scr_imperial_manage_fleet_functions","path":"scripts/scr_imperial_manage_fleet_functions/scr_imperial_manage_fleet_functions.yy",},}, {"id":{"name":"scr_imperial_navy_functions","path":"scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.yy",},}, + {"id":{"name":"scr_imperium_mission","path":"scripts/scr_imperium_mission/scr_imperium_mission.yy",},}, {"id":{"name":"scr_income","path":"scripts/scr_income/scr_income.yy",},}, {"id":{"name":"scr_ini_ship_cleanup","path":"scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.yy",},}, {"id":{"name":"scr_initialize_custom","path":"scripts/scr_initialize_custom/scr_initialize_custom.yy",},}, @@ -916,6 +917,7 @@ {"id":{"name":"scr_ship_count","path":"scripts/scr_ship_count/scr_ship_count.yy",},}, {"id":{"name":"scr_ship_occupants","path":"scripts/scr_ship_occupants/scr_ship_occupants.yy",},}, {"id":{"name":"scr_shoot","path":"scripts/scr_shoot/scr_shoot.yy",},}, + {"id":{"name":"scr_sob_mission","path":"scripts/scr_sob_mission/scr_sob_mission.yy",},}, {"id":{"name":"scr_special_view","path":"scripts/scr_special_view/scr_special_view.yy",},}, {"id":{"name":"scr_specialist_point_handler","path":"scripts/scr_specialist_point_handler/scr_specialist_point_handler.yy",},}, {"id":{"name":"scr_specialist_points","path":"scripts/scr_specialist_points/scr_specialist_points.yy",},}, diff --git a/datafiles/main/version.json b/datafiles/main/version.json index da3503594..629711b64 100644 --- a/datafiles/main/version.json +++ b/datafiles/main/version.json @@ -1,5 +1,5 @@ { - "build_date": "2025-12-23", - "version": "v0.11.05.03", + "build_date": "2025-12-24", + "version": "v0.11.06.00", "commit_hash": "unknown hash" } \ No newline at end of file diff --git a/scripts/scr_imperium_mission/scr_imperium_mission.gml b/scripts/scr_imperium_mission/scr_imperium_mission.gml new file mode 100644 index 000000000..ff8cdb824 --- /dev/null +++ b/scripts/scr_imperium_mission/scr_imperium_mission.gml @@ -0,0 +1,63 @@ +/* + Mission flow: + scr_random_event -> rolls rng for inquis mission + scr_inquisition_mission -> rolls rng and tests suitable planets for which mission + mission_inquisition_ -> logic and mechanics for spawning the mission and triggering the popup + scr_popup -> displays the panel with mission details and Accept/Refuse buttons + obj_popup.Step0 -> find `mission_is_go` section and add necessary event logic for when the player accepts + scr_mission_functions > mission_name_key -> need to update this so that missions display in the mission log + + + Helpers: + scr_mission_eta -> given the xy of a _star where the mission is, calculate how long you should have to complete the mission + Todo? maybe add a disposition influence here so that angy inquisitor gives you less spare time and vice versa + scr_star_has_planet_with_feature -> given the id of a _star and a `P_features` enum value, check if any planet on that _star has the desired feature + star_has_planet_with_forces -> given the id of a _star, and a faction, returns whether or not there are forces present there and in sufficient number +*/ + + +/// @param {Enum.EVENT} event +function scr_imperium_mission(){ +function mission_investigate_registry(){ + var stars = scr_get_stars(); + var _valid_stars = array_filter_ext(stars, + function(_star,index){ + if (scr_star_has_planet_with_feature(_star, P_features.Ancient_Ruins)){ + var fleet = instance_nearest(_star.x,_star.y,obj_p_fleet); + if (fleet == undefined || point_distance(_star.x,_star.y,fleet.x,fleet.y)>=160){ + return true; + } + return false; + } + return false; + }); + + if (array_length(_valid_stars) == 0){ + log_error("RE: Investigate Registry, couldn't find a _star"); + exit; + } + + var _star = array_random_element(_valid_stars); + var planet = scr_get_planet_with_feature(_star, P_features.Ancient_Ruins); + if (planet == -1){ + log_error("RE: Investigate Registry, couldn't pick a planet"); + exit; + } + + + var eta = infinity; + with(obj_p_fleet){ + if (action!=""){ + continue; + } + eta = min(eta, scr_mission_eta(_star.x,_star.y,1)); + } + eta = min(max(3,eta),100); + + var text=$"You overhear the Sector Governor instructions regarding {string(_star.name)} {scr_roman(planet)}"; + text+=$" It seems there are numerous registry mismatches regarding taxes and other data. We could investigate this ourselves, by landing marines there."; + text += $" You have {string(eta)} months until Imperium completes own investigation."; + scr_popup("Registry Investigation",text,"imperium",$"recon|{string(_star.name)}|{string(planet)}|{string(eta)}|"); + +} +} \ No newline at end of file diff --git a/scripts/scr_imperium_mission/scr_imperium_mission.yy b/scripts/scr_imperium_mission/scr_imperium_mission.yy new file mode 100644 index 000000000..733fd1cfa --- /dev/null +++ b/scripts/scr_imperium_mission/scr_imperium_mission.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_imperium_mission", + "isCompatibility":false, + "isDnD":false, + "name":"scr_imperium_mission", + "parent":{ + "name":"Scripts", + "path":"folders/Scripts.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_sob_mission/scr_sob_mission.gml b/scripts/scr_sob_mission/scr_sob_mission.gml new file mode 100644 index 000000000..4fd733ee4 --- /dev/null +++ b/scripts/scr_sob_mission/scr_sob_mission.gml @@ -0,0 +1,63 @@ +/* + Mission flow: + scr_random_event -> rolls rng for inquis mission + scr_inquisition_mission -> rolls rng and tests suitable planets for which mission + mission_inquisition_ -> logic and mechanics for spawning the mission and triggering the popup + scr_popup -> displays the panel with mission details and Accept/Refuse buttons + obj_popup.Step0 -> find `mission_is_go` section and add necessary event logic for when the player accepts + scr_mission_functions > mission_name_key -> need to update this so that missions display in the mission log + + + Helpers: + scr_mission_eta -> given the xy of a _star where the mission is, calculate how long you should have to complete the mission + Todo? maybe add a disposition influence here so that angy inquisitor gives you less spare time and vice versa + scr_star_has_planet_with_feature -> given the id of a _star and a `P_features` enum value, check if any planet on that _star has the desired feature + star_has_planet_with_forces -> given the id of a _star, and a faction, returns whether or not there are forces present there and in sufficient number +*/ + + +/// @param {Enum.EVENT} event +function scr_sob_mission(){ +function mission_investigate_priest(){ + var stars = scr_get_stars(); + var _valid_stars = array_filter_ext(stars, + function(_star,index){ + if (scr_star_has_planet_with_feature(_star, P_features.Ancient_Ruins)){ + var fleet = instance_nearest(_star.x,_star.y,obj_p_fleet); + if (fleet == undefined || point_distance(_star.x,_star.y,fleet.x,fleet.y)>=160){ + return true; + } + return false; + } + return false; + }); + + if (array_length(_valid_stars) == 0){ + log_error("RE: Investigate Priest, couldn't find a _star"); + exit; + } + + var _star = array_random_element(_valid_stars); + var planet = scr_get_planet_with_feature(_star, P_features.Ancient_Ruins); + if (planet == -1){ + log_error("RE: Investigate Priest, couldn't pick a planet"); + exit; + } + + + var eta = infinity; + with(obj_p_fleet){ + if (action!=""){ + continue; + } + eta = min(eta, scr_mission_eta(_star.x,_star.y,1)); + } + eta = min(max(3,eta),100); + + var text=$"You overhear the Ecclesiarchy instructions regarding {string(_star.name)} {scr_roman(planet)}"; + text+=$" It seems one of the priests there is behaving strangely. We could investigate this ourselves, by landing marines there."; + text += $" You have {string(eta)} months until Ecclesiarchy completes own investigation."; + scr_popup("Priest Investigation",text,"ecclesiarchy",$"recon|{string(_star.name)}|{string(planet)}|{string(eta)}|"); + +} +} \ No newline at end of file diff --git a/scripts/scr_sob_mission/scr_sob_mission.yy b/scripts/scr_sob_mission/scr_sob_mission.yy new file mode 100644 index 000000000..a5d4a1d13 --- /dev/null +++ b/scripts/scr_sob_mission/scr_sob_mission.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_sob_mission", + "isCompatibility":false, + "isDnD":false, + "name":"scr_sob_mission", + "parent":{ + "name":"Scripts", + "path":"folders/Scripts.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file From a8f253009ae2abf6040b195e4d09a833d7c1428e Mon Sep 17 00:00:00 2001 From: Blogaugis Date: Thu, 5 Feb 2026 18:20:17 +0200 Subject: [PATCH 2/2] event infrastructure Some tweaks to event code, mimicking inquisition's... --- .../scr_imperium_mission.gml | 2 +- scripts/scr_random_event/scr_random_event.gml | 28 ++++++++++++++++++- scripts/scr_sob_mission/scr_sob_mission.gml | 2 +- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/scripts/scr_imperium_mission/scr_imperium_mission.gml b/scripts/scr_imperium_mission/scr_imperium_mission.gml index ff8cdb824..7d8d6a6ee 100644 --- a/scripts/scr_imperium_mission/scr_imperium_mission.gml +++ b/scripts/scr_imperium_mission/scr_imperium_mission.gml @@ -17,7 +17,7 @@ /// @param {Enum.EVENT} event -function scr_imperium_mission(){ +function scr_imperium_mission(event){ function mission_investigate_registry(){ var stars = scr_get_stars(); var _valid_stars = array_filter_ext(stars, diff --git a/scripts/scr_random_event/scr_random_event.gml b/scripts/scr_random_event/scr_random_event.gml index f0497400f..f5563380f 100644 --- a/scripts/scr_random_event/scr_random_event.gml +++ b/scripts/scr_random_event/scr_random_event.gml @@ -61,6 +61,8 @@ function scr_random_event(execute_now) { EVENT.strange_building, // Not sure if techmarine in the mood for building is a good thing EVENT.sororitas, // This requires checks for renegade or traitor EVENT.rogue_trader, + EVENT.imperium_mission, // Good event as it is an opportunity with no loss risk + EVENT.sisters_mission, // Same as imperium mission ]; } else if(player_luck == luck.neutral){ @@ -121,6 +123,18 @@ function scr_random_event(execute_now) { events_total -= 1; } break; + case EVENT.imperium_mission: + if (known[eFACTION.Imperium]==0 || obj_controller.disposition[1] < 0 || obj_controller.faction_status[eFACTION.Imperium] == "War") { + events_share[i] -= 1; + events_total -= 1; + } + break; + case EVENT.sob_mission: + if (known[eFACTION.Ecclesiarchy]==0 || obj_controller.disposition[5] < 0 || obj_controller.faction_status[eFACTION.Ecclesiarchy] == "War") { + events_share[i] -= 1; + events_total -= 1; + } + break; case EVENT.mechanicus_mission: if (known[eFACTION.Mechanicus] == 0 || obj_controller.disposition[3] < 50 || obj_controller.faction_status[eFACTION.Mechanicus] == "War") { events_share[i] -= 1; @@ -357,7 +371,19 @@ function scr_random_event(execute_now) { evented = spawn_mechanicus_mission(); } - + + else if (chosen_event == EVENT.imperium_mission) { + scr_imperium_mission(chosen_event); + _evented = true; + + } + + else if (chosen_event == EVENT.sisters_mission) { + scr_sob_mission(chosen_event); + _evented = true; + + } + else if (chosen_event == EVENT.inquisition_planet || chosen_event == EVENT.inquisition_mission) { scr_inquisition_mission(chosen_event); _evented = true; diff --git a/scripts/scr_sob_mission/scr_sob_mission.gml b/scripts/scr_sob_mission/scr_sob_mission.gml index 4fd733ee4..2f12d1124 100644 --- a/scripts/scr_sob_mission/scr_sob_mission.gml +++ b/scripts/scr_sob_mission/scr_sob_mission.gml @@ -17,7 +17,7 @@ /// @param {Enum.EVENT} event -function scr_sob_mission(){ +function scr_sob_mission(event){ function mission_investigate_priest(){ var stars = scr_get_stars(); var _valid_stars = array_filter_ext(stars,