Skip to content

Commit 4a4e243

Browse files
authored
fix: star_by_name rename and less agressive erroring (#1132)
1 parent b1c5d2c commit 4a4e243

21 files changed

Lines changed: 51 additions & 59 deletions

File tree

objects/obj_en_fleet/Alarm_1.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ try {
461461
} else if (action_eta == 0) {
462462
action = "";
463463
if (array_length(complex_route) > 0) {
464-
var target_loc = star_by_name(complex_route[0]);
464+
var target_loc = find_star_by_name(complex_route[0]);
465465
if (target_loc != "none") {
466466
array_delete(complex_route, 0, 1);
467467
action_x = target_loc.x;

objects/obj_event_log/Draw_0.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if (__b__) {
4040
draw_text_ext(xx + 25, yy + 120 + (p * 26), $"{cur_event.date} (Turn {cur_event.turn}) - {cur_event.text}", -1, 1554);
4141
if (cur_event.event_target != "none") {
4242
if (point_and_click(draw_unit_buttons([xx + 1400, yy + 120 + (p * 26)], "View", [1, 1], c_green,, fnt_40k_14b, 1, true))) {
43-
var view_star = star_by_name(cur_event.event_target);
43+
var view_star = find_star_by_name(cur_event.event_target);
4444
if (view_star != "none") {
4545
main_map_defaults();
4646
obj_controller.x = view_star.x;

objects/obj_ncombat/Alarm_7.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ try {
321321
}
322322
if ((string_count("ruins", battle_special) > 0) && (defeat == 1)) {
323323
//TODO this logic is wrong assumes all player units died in ruins
324-
var _combat_star = star_by_name(obj_ncombat.battle_loc);
324+
var _combat_star = find_star_by_name(obj_ncombat.battle_loc);
325325
if (_combat_star != "none") {
326326
_combat_star.p_player[obj_ncombat.battle_id] -= obj_ncombat.world_size;
327327
}

objects/obj_p_fleet/Draw_0.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ if (action != "") {
107107
if (array_length(complex_route) > 0) {
108108
var next_loc = instance_nearest(action_x, action_y, obj_star);
109109
for (var i = 0; i < array_length(complex_route); i++) {
110-
var target_loc = star_by_name(complex_route[i]);
110+
var target_loc = find_star_by_name(complex_route[i]);
111111
draw_set_color(c_blue);
112112
draw_set_alpha(1);
113113
draw_line_dashed(next_loc.x, next_loc.y, target_loc.x, target_loc.y, 16, line_width);
114-
next_loc = star_by_name(complex_route[i]);
114+
next_loc = find_star_by_name(complex_route[i]);
115115
}
116116
}
117117
}

objects/obj_popup/Step_0.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ try {
227227
var mission_star, onceh;
228228
onceh = 0;
229229
obj_controller.temp[200] = string(loc);
230-
var mission_star = star_by_name(obj_controller.temp[200]);
230+
var mission_star = find_star_by_name(obj_controller.temp[200]);
231231
if (add_new_problem(planet, "recon", estimate, mission_star)) {
232232
title = "Inquisition Mission Demand";
233233
text = $"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. {global.chapter_name} are to land Astartes on {mission_star.name} {scr_roman(planet)} to investigate the planet within {estimate} months.";
@@ -243,7 +243,7 @@ try {
243243
var mission_star, onceh;
244244
mission_star = 0;
245245
onceh = 0;
246-
var mission_star = star_by_name(obj_controller.temp[200]);
246+
var mission_star = find_star_by_name(obj_controller.temp[200]);
247247
var mission_is_go = false;
248248
if (mission_star != "none" && planet > 0) {
249249
var _estimate = estimate;

objects/obj_turn_end/Alarm_0.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ try {
4747
ii = 0;
4848
good = 0;
4949

50-
var battle_star = star_by_name(battle_location[current_battle]);
50+
var battle_star = find_star_by_name(battle_location[current_battle]);
5151

5252
if (battle_star != "none") {
5353
// trying to find the star

objects/obj_turn_end/Alarm_4.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ instance_activate_object(obj_star);
77

88
if ((battles > 0) && (current_battle <= battles)) {
99
var ii = 0, good = 0;
10-
var battle_star = star_by_name(battle_location[current_battle]);
10+
var battle_star = find_star_by_name(battle_location[current_battle]);
1111
obj_controller.temp[1060] = battle_location[current_battle];
1212

1313
if (battle_star != "none") {

scripts/scr_ancient_ruins/scr_ancient_ruins.gml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function scr_ruins_suprise_attack_player() {
2525
instance_activate_object(obj_star_select);
2626
instance_activate_object(obj_star);
2727
instance_activate_object(obj_ground_mission);
28-
var _star = star_by_name(obj_ground_mission.loc);
28+
var _star = find_star_by_name(obj_ground_mission.loc);
2929
var _planet = obj_ground_mission.num;
3030
var _units = obj_ground_mission.display_unit;
3131

@@ -360,7 +360,7 @@ function ruins_exploration_main_sequence() {
360360
} else {
361361
var obj = obj_ground_mission.obj;
362362
instance_activate_object(obj_star);
363-
scr_ruins_reward(star_by_name(obj_ground_mission.battle_loc), obj_ground_mission.num, obj_ground_mission.explore_feature);
363+
scr_ruins_reward(find_star_by_name(obj_ground_mission.battle_loc), obj_ground_mission.num, obj_ground_mission.explore_feature);
364364
instance_destroy();
365365
exit;
366366
}
@@ -394,7 +394,7 @@ function scr_ruins_combat_end() {
394394
var _star = 0;
395395
ruins_battle = choose(6, 7, 9, 10, 11, 12);
396396

397-
_star = star_by_name(obj_ground_mission.battle_loc);
397+
_star = find_star_by_name(obj_ground_mission.battle_loc);
398398
var planet = obj_ground_mission.num;
399399
var _battle_threat = obj_ground_mission.battle_threat;
400400
if (obj_ground_mission.defeat == 0) {

scripts/scr_company_struct/scr_company_struct.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function CompanyStruct(comp) constructor {
253253
}
254254
}
255255
if (send_on_mission) {
256-
send_squad_on_mission(mission_type, star_by_name(_squad_sys));
256+
send_squad_on_mission(mission_type, find_star_by_name(_squad_sys));
257257
}
258258
bound_height[0] += 180;
259259
} else {
@@ -285,7 +285,7 @@ function CompanyStruct(comp) constructor {
285285
if (cur_assignment.type == "garrison") {
286286
var garrison_but = draw_unit_buttons([cancel_but[2] + 10, cancel_but[1]], "View Garrison", [1, 1], c_red,,,, true);
287287
if (point_and_click(garrison_but)) {
288-
var garrrison_star = star_by_name(cur_assignment.location);
288+
var garrrison_star = find_star_by_name(cur_assignment.location);
289289
obj_controller.view_squad = false;
290290
if (garrrison_star != "none") {
291291
scr_toggle_manage();

scripts/scr_dialogue/scr_dialogue.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ function scr_dialogue(diplo_keyphrase, data = {}) {
398398
if (!_found) {
399399
var _master = fetch_unit([0, 0]);
400400
if (_master.planet_location > 0) {
401-
var _master_star = star_by_name(_master.location_string);
401+
var _master_star = find_star_by_name(_master.location_string);
402402
if (_master_star != "none") {
403403
_found = true;
404404
_planet = _master.planet_location;
@@ -2183,7 +2183,7 @@ function scr_dialogue(diplo_keyphrase, data = {}) {
21832183
var _event = audience_data;
21842184
var _system = _event.system;
21852185
var _planet = _event.planet;
2186-
var _star_name = planet_numeral_name(_planet, star_by_name(_system));
2186+
var _star_name = planet_numeral_name(_planet, find_star_by_name(_system));
21872187
diplo_text = $"My patience is wearing thin, Chapter Master. I have many more problems more urgent and, yet, you continue to force me away from the work assigned to me by He on Terra. Your serf on {_star_name} will be executed along with all the other puppets I ferret out. You are close to treason, Chapter Master. Choose your next words with exceptional care for they may be your last.";
21882188

21892189
add_diplomacy_option({

0 commit comments

Comments
 (0)