Skip to content

Commit

Permalink
fix defualt options not being set fucking up squads
Browse files Browse the repository at this point in the history
  • Loading branch information
OH296 committed Jan 9, 2025
1 parent ab1f7e1 commit ebbbbd4
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 66 deletions.
12 changes: 6 additions & 6 deletions objects/obj_creation/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,17 @@ if (full_liveries == ""){
weapon_color:weapon_color
}
livery_picker.scr_unit_draw_data();
livery_picker.set_defualt_armour(struct_cols,col_special);
livery_picker.set_default_armour(struct_cols,col_special);
full_liveries = array_create(21,DeepCloneStruct(livery_picker.map_colour));
full_liveries[eROLE.Librarian] = livery_picker.set_defualt_librarian(struct_cols);
full_liveries[eROLE.Librarian] = livery_picker.set_default_librarian(struct_cols);

full_liveries[eROLE.Chaplain] = livery_picker.set_defualt_chaplain(struct_cols);
full_liveries[eROLE.Chaplain] = livery_picker.set_default_chaplain(struct_cols);

full_liveries[eROLE.Apothecary] = livery_picker.set_defualt_apothecary(struct_cols);
full_liveries[eROLE.Apothecary] = livery_picker.set_default_apothecary(struct_cols);

full_liveries[eROLE.Techmarine] = livery_picker.set_defualt_techmarines(struct_cols);
full_liveries[eROLE.Techmarine] = livery_picker.set_default_techmarines(struct_cols);
livery_picker.scr_unit_draw_data();
livery_picker.set_defualt_armour(struct_cols,col_special);
livery_picker.set_default_armour(struct_cols,col_special);
}

// on left mouse release, if greater than 5000 and less than 9000, set cooldown to 0
Expand Down
4 changes: 2 additions & 2 deletions objects/obj_ini/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ companies=10;
progenitor=ePROGENITOR.NONE;
aspirant_trial = 0;

//defualt sector name to prevent potential crash
//default sector name to prevent potential crash
sector_name = "Terra Nova";

//default
load_to_ships=[2,0,0];
if (instance_exists(obj_creation)){load_to_ships=obj_creation.load_to_ships;}

Expand Down
2 changes: 1 addition & 1 deletion objects/obj_ncombat/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (instance_number(obj_ncombat)>1) then instance_destroy();

set_zoom_to_defualt();
set_zoom_to_default();
var co,i;co=-1;
repeat(15){co+=1;i=-1;
repeat(401){i+=1;
Expand Down
2 changes: 1 addition & 1 deletion objects/obj_popup/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set_zoom_to_defualt();
set_zoom_to_default();
type=0;size=2;y_scale=1;
if (size=1) then sprite_index=spr_popup_small;
if (size=2) then sprite_index=spr_popup_medium;
Expand Down
2 changes: 1 addition & 1 deletion scripts/is_specialist/is_specialist.gml
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ function group_selection(group, selection_data){
try {
var unit, s, unit_location;
obj_controller.selection_data = selection_data;
set_zoom_to_defualt();
set_zoom_to_default();
with (obj_controller){
menu=1;
onceh=1;
Expand Down
12 changes: 6 additions & 6 deletions scripts/scr_chapter_new/scr_chapter_new.gml
Original file line number Diff line number Diff line change
Expand Up @@ -368,17 +368,17 @@ function scr_chapter_new(argument0) {
}
obj_creation.livery_picker = new ColourItem(100,230);
obj_creation.livery_picker.scr_unit_draw_data();
obj_creation.livery_picker.set_defualt_armour(struct_cols,col_special);
obj_creation.livery_picker.set_default_armour(struct_cols,col_special);
obj_creation.full_liveries = array_create(21,DeepCloneStruct(obj_creation.livery_picker.map_colour));
obj_creation.full_liveries[eROLE.Librarian] = obj_creation.livery_picker.set_defualt_librarian(struct_cols);
obj_creation.full_liveries[eROLE.Librarian] = obj_creation.livery_picker.set_default_librarian(struct_cols);

obj_creation.full_liveries[eROLE.Chaplain] = obj_creation.livery_picker.set_defualt_chaplain(struct_cols);
obj_creation.full_liveries[eROLE.Chaplain] = obj_creation.livery_picker.set_default_chaplain(struct_cols);

obj_creation.full_liveries[eROLE.Apothecary] = obj_creation.livery_picker.set_defualt_apothecary(struct_cols);
obj_creation.full_liveries[eROLE.Apothecary] = obj_creation.livery_picker.set_default_apothecary(struct_cols);

obj_creation.full_liveries[eROLE.Techmarine] = obj_creation.livery_picker.set_defualt_techmarines(struct_cols);
obj_creation.full_liveries[eROLE.Techmarine] = obj_creation.livery_picker.set_default_techmarines(struct_cols);
obj_creation.livery_picker.scr_unit_draw_data();
obj_creation.livery_picker.set_defualt_armour(struct_cols,col_special);
obj_creation.livery_picker.set_default_armour(struct_cols,col_special);
}
obj_creation.livery_picker.map_colour = full_liveries[0];
obj_creation.livery_picker.role_set = 0;
Expand Down
12 changes: 6 additions & 6 deletions scripts/scr_chapter_random/scr_chapter_random.gml
Original file line number Diff line number Diff line change
Expand Up @@ -391,17 +391,17 @@ function scr_chapter_random(argument0) {
}
obj_creation.livery_picker = new ColourItem(100,230);
obj_creation.livery_picker.scr_unit_draw_data();
obj_creation.livery_picker.set_defualt_armour(struct_cols,col_special);
obj_creation.livery_picker.set_default_armour(struct_cols,col_special);
obj_creation.full_liveries = array_create(21,DeepCloneStruct(obj_creation.livery_picker.map_colour));
obj_creation.full_liveries[eROLE.Librarian] = obj_creation.livery_picker.set_defualt_librarian(struct_cols);
obj_creation.full_liveries[eROLE.Librarian] = obj_creation.livery_picker.set_default_librarian(struct_cols);

obj_creation.full_liveries[eROLE.Chaplain] = obj_creation.livery_picker.set_defualt_chaplain(struct_cols);
obj_creation.full_liveries[eROLE.Chaplain] = obj_creation.livery_picker.set_default_chaplain(struct_cols);

obj_creation.full_liveries[eROLE.Apothecary] = obj_creation.livery_picker.set_defualt_apothecary(struct_cols);
obj_creation.full_liveries[eROLE.Apothecary] = obj_creation.livery_picker.set_default_apothecary(struct_cols);

obj_creation.full_liveries[eROLE.Techmarine] = obj_creation.livery_picker.set_defualt_techmarines(struct_cols);
obj_creation.full_liveries[eROLE.Techmarine] = obj_creation.livery_picker.set_default_techmarines(struct_cols);
obj_creation.livery_picker.scr_unit_draw_data();
obj_creation.livery_picker.set_defualt_armour(struct_cols,col_special);
obj_creation.livery_picker.set_default_armour(struct_cols,col_special);

obj_creation.livery_picker.map_colour = full_liveries[0];
obj_creation.livery_picker.role_set = 0;
Expand Down
8 changes: 4 additions & 4 deletions scripts/scr_company_struct/scr_company_struct.gml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function CompanyStruct(comp) constructor{
return obj_ini.squads[company_squads[cur_squad]];
}

static defualt_member = function(){
static default_member = function(){
var member = obj_ini.squads[company_squads[0]].members[0];
obj_controller.temp[120] = fetch_unit(member);
selected_unit = obj_controller.temp[120];
Expand All @@ -89,18 +89,18 @@ function CompanyStruct(comp) constructor{
}
}
if (!squad_found){
defualt_member();
default_member();
}
}
} else {
defualt_member();
default_member();
}
} else if (obj_controller.view_squad){
obj_controller.view_squad = false;
obj_controller.unit_profile =false;
}
if (selected_unit.squad=="none"){
defualt_member();
default_member();
}
if (selected_unit.squad!="none"){
current_squad = obj_ini.squads[selected_unit.squad];
Expand Down
10 changes: 5 additions & 5 deletions scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function ColourItem(xx,yy) constructor{
}
}

static set_defualt_armour = function(struct_cols, armour_style=0){
static set_default_armour = function(struct_cols, armour_style=0){
map_colour.right_pauldron = struct_cols.right_pauldron;
map_colour.left_pauldron = struct_cols.left_pauldron;

Expand Down Expand Up @@ -152,7 +152,7 @@ function ColourItem(xx,yy) constructor{
return DeepCloneStruct(map_colour);
}

static set_defualt_techmarines = function(struct_cols){
static set_default_techmarines = function(struct_cols){
set_pattern(Colors.Red,full_body);
map_colour.eye_lense = Colors.Green;
map_colour.right_pauldron = Colors.Red;
Expand All @@ -161,7 +161,7 @@ function ColourItem(xx,yy) constructor{
return DeepCloneStruct(map_colour);
}

static set_defualt_apothecary = function(struct_cols){
static set_default_apothecary = function(struct_cols){
set_pattern(Colors.White,full_body);
map_colour.eye_lense = Colors.Red;
map_colour.right_pauldron = Colors.White;
Expand All @@ -170,7 +170,7 @@ function ColourItem(xx,yy) constructor{
return DeepCloneStruct(map_colour);
}

static set_defualt_chaplain = function(struct_cols){
static set_default_chaplain = function(struct_cols){
set_pattern(Colors.Black,full_body);
map_colour.eye_lense = Colors.Red;
map_colour.right_pauldron = Colors.Black;
Expand All @@ -180,7 +180,7 @@ function ColourItem(xx,yy) constructor{
}


static set_defualt_librarian = function(struct_cols){
static set_default_librarian = function(struct_cols){
set_pattern(Colors.Dark_Ultramarine,full_body);
map_colour.eye_lense = Colors.Cyan;
map_colour.right_pauldron = Colors.Dark_Ultramarine;
Expand Down
6 changes: 3 additions & 3 deletions scripts/scr_controller_helpers/scr_controller_helpers.gml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function scr_menu_clear_up(specific_area_function){
function scr_change_menu(specific_area_function){
var continue_sequence = false;
with (obj_controller){
set_zoom_to_defualt();
set_zoom_to_default();
continue_sequence = scr_menu_clear_up(function(){
if (zoomed==0) && (diplomacy==0){
return true;
Expand All @@ -75,7 +75,7 @@ function scr_in_game_help(){
scr_change_menu(function(){
with (obj_controller){
if (zoomed == 0) and (!instance_exists(obj_ingame_menu)) and (!instance_exists(obj_popup)){
set_zoom_to_defualt();
set_zoom_to_default();
if (menu!=17.5){
menu=17.5;
cooldown=8000;
Expand Down Expand Up @@ -105,7 +105,7 @@ function scr_in_game_menu(){
location_viewer.update_garrison_log();
managing=0;
}
set_zoom_to_defualt();
set_zoom_to_default();
instance_create(0,0,obj_ingame_menu);
}
});
Expand Down
12 changes: 6 additions & 6 deletions scripts/scr_creation/scr_creation.gml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ function scr_creation(slide_num) {
weapon_color:weapon_color
}
livery_picker.scr_unit_draw_data();
livery_picker.set_defualt_armour(struct_cols,col_special);
livery_picker.set_default_armour(struct_cols,col_special);
full_liveries = array_create(21,DeepCloneStruct(livery_picker.map_colour));
full_liveries[eROLE.Librarian] = livery_picker.set_defualt_librarian(struct_cols);
full_liveries[eROLE.Librarian] = livery_picker.set_default_librarian(struct_cols);

full_liveries[eROLE.Chaplain] = livery_picker.set_defualt_chaplain(struct_cols);
full_liveries[eROLE.Chaplain] = livery_picker.set_default_chaplain(struct_cols);

full_liveries[eROLE.Apothecary] = livery_picker.set_defualt_apothecary(struct_cols);
full_liveries[eROLE.Apothecary] = livery_picker.set_default_apothecary(struct_cols);

full_liveries[eROLE.Techmarine] = livery_picker.set_defualt_techmarines(struct_cols);
full_liveries[eROLE.Techmarine] = livery_picker.set_default_techmarines(struct_cols);
livery_picker.scr_unit_draw_data();
livery_picker.set_defualt_armour(struct_cols,col_special);
livery_picker.set_default_armour(struct_cols,col_special);
}
}
}
Expand Down
29 changes: 13 additions & 16 deletions scripts/scr_initialize_custom/scr_initialize_custom.gml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,8 +1726,8 @@ function scr_initialize_custom() {
"min": 4,
"loadout": {
"required": {
"wep1": [wep1[100, 10], 7],
"wep2": [wep2[100, 10], 7],
"wep1": [wep1[100, 10], 5],
"wep2": [wep2[100, 10], 5],
},
"option": {
"wep1": [
Expand Down Expand Up @@ -3035,12 +3035,12 @@ function scr_initialize_custom() {
repeat(temp1) {
k += 1;
man_size += 1;
add_unit_to_company("marine", company, k, roles.tactical, eROLE.Tactical, "","", "", "", "");
add_unit_to_company("marine", company, k, roles.tactical, eROLE.Tactical, "default","default", "default", "default", "default");
}
repeat(assault) {
k += 1;
man_size += 1;
add_unit_to_company("marine", company, k, roles.assault, eROLE.Assault, "", "", "", "default", "");
add_unit_to_company("marine", company, k, roles.assault, eROLE.Assault, "default", "default", "default", "default", "default");
}
repeat(devastator) {
k += 1;
Expand All @@ -3049,14 +3049,14 @@ function scr_initialize_custom() {
if (wep1[defaults_slot, eROLE.Devastator] == "Heavy Ranged") {
_wep1 = choose("Multi-Melta", "Lascannon", "Missile Launcher", "Heavy Bolter");
}
add_unit_to_company("marine", company, k, roles.devastator, eROLE.Devastator, _wep1, "","", "default", "");
add_unit_to_company("marine", company, k, roles.devastator, eROLE.Devastator, _wep1, "default","default", "default", "default");
}
}
if (company = 10) {
repeat(temp1) {
k += 1;
man_size += 1;
add_unit_to_company("scout", company, k, roles.scout, eROLE.Scout, "", "", "", "", "Scout Armour");
add_unit_to_company("scout", company, k, roles.scout, eROLE.Scout, "defaultdefault", "defaultdefault", "defaultdefault", "defaultdefault", "Scout Armour");
}
}
}
Expand All @@ -3065,7 +3065,7 @@ function scr_initialize_custom() {
if (company < 8) then repeat(temp1) {
k += 1;
man_size += 1;
add_unit_to_company("marine", company, k, roles.tactical, eROLE.Tactical, "", "", "", "", "");
add_unit_to_company("marine", company, k, roles.tactical, eROLE.Tactical, "default", "default", "default", "default", "default");
}

// reserve company only of assault
Expand All @@ -3083,30 +3083,27 @@ function scr_initialize_custom() {
if (wep1[defaults_slot, eROLE.Devastator] == "Heavy Ranged") {
_wep1 = choose("Multi-Melta", "Lascannon", "Missile Launcher", "Heavy Bolter");
}
add_unit_to_company("marine", company, k, roles.devastator,eROLE.Devastator, _wep1, "","","default", "");
add_unit_to_company("marine", company, k, roles.devastator,eROLE.Devastator, _wep1,);
}

if (company = 10) then
for (var i = 0; i < temp1; i++) {
k += 1;
man_size += 1;
add_unit_to_company("scout", company, k, roles.scout,eROLE.Scout, "", "", "", "", "Scout Armour");
add_unit_to_company("scout", company, k, roles.scout,eROLE.Scout, , , , , "Scout Armour");
}

if (company_unit2 = "assault") then repeat(assault) {
k += 1;
man_size += 1;
add_unit_to_company("marine", company, k, roles.assault,eROLE.Assault, "", "", "", "default", "");
add_unit_to_company("marine", company, k, roles.assault,eROLE.Assault);
}

if (company_unit3 = "devastator") then repeat(devastator) {
k += 1;
man_size += 1;
var _wep1 = wep1[defaults_slot, eROLE.Devastator];
if (wep1[defaults_slot, eROLE.Devastator] == "Heavy Ranged") {
_wep1 = choose("Multi-Melta", "Lascannon", "Missile Launcher", "Heavy Bolter");
}
add_unit_to_company("marine", company, k, roles.devastator, eROLE.Devastator, _wep1, "","", "default", "");

add_unit_to_company("marine", company, k, roles.devastator, eROLE.Devastator);
}
}

Expand Down Expand Up @@ -3384,7 +3381,7 @@ function add_veh_to_company(name, company, slot, wep1, wep2, wep3, upgrade, acce
/// each item slot can be "" or "default" or a named item. "" will assign items from the available item pool.
/// Use "" if you want to set weapons and gear via squad layouts.
/// "default" will set it to the value in the default slot for the given role, see `load_default_gear`
function add_unit_to_company(ttrpg_name, company, slot, role_name, role_id, wep1, wep2, gear, mobi, armour){
function add_unit_to_company(ttrpg_name, company, slot, role_name, role_id, wep1="default", wep2="default", gear="default", mobi="default", armour="default"){
obj_ini.TTRPG[company][slot] = new TTRPG_stats("chapter", company, slot, ttrpg_name);
obj_ini.race[company][slot] = 1;
obj_ini.loc[company][slot] = obj_ini.home_name;
Expand Down
6 changes: 3 additions & 3 deletions scripts/scr_livery_setup/scr_livery_setup.gml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function scr_livery_setup(){
}else{
draw_text(444,252,string_hash_to_newline("Color swap shader#did not compile"));
}
var liv_string = $"Full Livery \n{livery_picker.role_set == 0? "Defualt" :role[100][livery_picker.role_set]}";
var liv_string = $"Full Livery \n{livery_picker.role_set == 0? "default" :role[100][livery_picker.role_set]}";
draw_text(160, 100, liv_string);

draw_set_color(38144);
Expand Down Expand Up @@ -283,7 +283,7 @@ function scr_livery_setup(){
lens_color:lens_color,
weapon_color:weapon_color
}
livery_picker.set_defualt_armour(struct_cols, col_special);
livery_picker.set_default_armour(struct_cols, col_special);
}
draw_text_transformed(cur_button.cords[0]+30,cur_button.cords[1]+4,cur_button.text,0.4,0.4,0);
}
Expand Down Expand Up @@ -537,7 +537,7 @@ function scr_livery_setup(){
}
}
if (livery_picker.role_set!=0){
if (point_and_click(draw_unit_buttons([20, 50], $"Return to defualt Livery"))){
if (point_and_click(draw_unit_buttons([20, 50], $"Return to default Livery"))){
full_liveries[livery_picker.role_set] = DeepCloneStruct(livery_picker.map_colour);
livery_picker.map_colour = full_liveries[0];
livery_picker.role_set = 0;
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_load/scr_load.gml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function scr_load(save_part, save_id) {


// obj_ini
//TODO allow methods to be passed as teh defualt to return_json_from_ini to optomise load speed
//TODO allow methods to be passed as teh default to return_json_from_ini to optomise load speed
var livery_picker = new ColourItem(0,0);
livery_picker.scr_unit_draw_data();
obj_ini.full_liveries = return_json_from_ini("Ini", "full_liveries",array_create(21,DeepCloneStruct(livery_picker.map_colour)));
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_marine_struct/scr_marine_struct.gml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ global.base_stats = { //tempory stats subject to change by anyone that wishes to
skills: {
weapons:{
"bolter":3, "chainsword":3, "ccw":3, "bolt_pistol":3}},
start_gear:{"armour":"Power Armour", "wep1":"Bolter", "wep2":"Chainsword"},
start_gear:{"armour":"Power Armour", "wep1":"Chainsword", "wep2":"Chainsword"},
base_group : "astartes",
},
"scout":{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function get_player_ships(location="", name=""){
return _ships;
}

function new_player_ship_defualts(){
function new_player_ship_defaults(){
with (obj_ini){
array_push(ship, "");
array_push(ship_uid,0);
Expand Down Expand Up @@ -246,7 +246,7 @@ function loose_ship_to_warp_event(){

function new_player_ship(type, start_loc="home", new_name=""){
var ship_names="",index=0;
var index = new_player_ship_defualts();
var index = new_player_ship_defaults();

for(var k=0; k<=200; k++){
if (new_name==""){
Expand Down
Loading

0 comments on commit ebbbbd4

Please sign in to comment.