Skip to content
3 changes: 2 additions & 1 deletion ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@
{"id":{"name":"spr_data_slate_back","path":"sprites/spr_data_slate_back/spr_data_slate_back.yy",},},
{"id":{"name":"spr_data_slate_border","path":"sprites/spr_data_slate_border/spr_data_slate_border.yy",},},
{"id":{"name":"spr_data_slate","path":"sprites/spr_data_slate/spr_data_slate.yy",},},
{"id":{"name":"spr_death_watch_pauldron","path":"sprites/spr_death_watch_pauldron/spr_death_watch_pauldron.yy",},},
{"id":{"name":"spr_def_fortress","path":"sprites/spr_def_fortress/spr_def_fortress.yy",},},
{"id":{"name":"spr_def_mine","path":"sprites/spr_def_mine/spr_def_mine.yy",},},
{"id":{"name":"spr_def_platform","path":"sprites/spr_def_platform/spr_def_platform.yy",},},
Expand Down Expand Up @@ -1688,4 +1689,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,},
],
}
}
13 changes: 13 additions & 0 deletions datafiles/main/chapters/7.JSON
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,19 @@
/** Add extra starting items ["Item Name", Number to add] */
"full_liveries":[
{ "left_pauldron" : [ "icon",{ "icon" : "ultramarines", "colour" : 34, "type" : 2 } ], "right_pauldron" : 34, "is_changed" : 1, "left_leg_lower" : 34, "left_leg_upper" : 34, "left_leg_knee" : 34, "right_leg_lower" : 34, "right_leg_upper" : 34, "right_leg_knee" : 34, "metallic_trim" : 12, "left_chest" : 34, "right_chest" : 34, "left_thorax" : 0, "right_thorax" : 0, "left_hand" : 34, "right_hand" : 34, "left_head" : 34, "right_head" : 34, "left_muzzle" : 34, "right_muzzle" : 34, "eye_lense" : 9, "right_backpack" : 34, "left_backpack" : 34, "weapon_primary" : 9, "weapon_secondary" : 9, "company_marks" : 0, "company_marks_loc" : 0, "left_arm" : 34, "right_arm" : 34, "left_trim" : 12, "right_trim" : 12 },
],
"company_liveries" : [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
],
"extra_equipment": [
// [
Expand Down
60 changes: 57 additions & 3 deletions objects/obj_creation/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* * obj_creation is used as part of the main menu new game and chapter creation logic
* It contains data and logic for setting up custom chapters as well as populating the new game menu with data for pre-existing chapters.
*/
Expand Down Expand Up @@ -113,6 +113,7 @@ use_chapter_object = false;
livery_picker = new ColourItem(100,230);
livery_picker.scr_unit_draw_data();
full_liveries = "";
company_liveries = "";
complex_livery=false;
complex_selection = "sgt";
complex_depth_selection = 0;
Expand Down Expand Up @@ -303,20 +304,73 @@ buttons = {
str1 : "Runic",
font : fnt_40k_14b,
},
], "Chapter Visual Styles")
], "Chapter Visual Styles"),
company_options_toggle : new UnitButtonObject({
tooltip : "toggle between chapter or role settings",
label : "Company Settings",
company_view : false,
}),
company_liveries_choice : new radio_set([
{
str1 : "HQ",
font : fnt_40k_14b
},
{
str1 : "I",
font : fnt_40k_14b,
},
{
str1 : "II",
font : fnt_40k_14b
},
{
str1 : "III",
font : fnt_40k_14b
},
{
str1 : "IV",
font : fnt_40k_14b
},
{
str1 : "V",
font : fnt_40k_14b
},
{
str1 : "VI",
font : fnt_40k_14b
},
{
str1 : "VII",
font : fnt_40k_14b
},
{
str1 : "VIII",
font : fnt_40k_14b
},
{
str1 : "IX",
font : fnt_40k_14b
},
{
str1 : "X",
font : fnt_40k_14b
},
], "Companies"),
}

with (buttons){
home_spawn_loc_options.current_selection = 1;
home_planets.current_selection = 1;
home_warp.current_selection = 1;
recruit_home_relationship.current_selection = 1;
company_liveries_choice.current_selection = 1;
}

text_bars = {
battle_cry : new TextBarArea(920,118, 540),
battle_cry : new TextBarArea(920,118, 450),
admiral : new TextBarArea(890,685, 580,true),
}

scrollbar_engaged=0;

text_selected="none";
Expand Down
5 changes: 5 additions & 0 deletions objects/obj_creation/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ if (array_length(col)>0){
color_to_weapon = "";
}
}
if (company_liveries == ""){
livery_picker.scr_unit_draw_data(-1);
company_liveries = array_create(11,variable_clone(livery_picker.map_colour));
}

if (full_liveries == ""){
var struct_cols = {
main_color :main_color,
Expand Down
2 changes: 1 addition & 1 deletion objects/obj_garbage_collector/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if (gc_timer > 0) {
gc_timer -= 1;
// show_debug_message($"obj_garbage_collector: gc_timer = {gc_timer}");
} else {
gc_timer = 50; // Default is every frame, so de-facto 1;
gc_timer = 25; // Default is every frame, so de-facto 1;
gc_collect();

wait_and_execute(0, function(){
Expand Down
12 changes: 11 additions & 1 deletion objects/obj_ini/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ serialize = function(){
y,
custom_advisors,
full_liveries: full_liveries,
company_liveries : company_liveries,
complex_livery_data: complex_livery_data,
squad_types: squad_types,
artifact_struct: artifact_struct_trimmed,
Expand All @@ -169,7 +170,7 @@ serialize = function(){
}

deserialize = function(save_data){
var exclusions = ["complex_livery_data", "full_liveries", "squad_types", "marine_structs", "squad_structs"]; // skip automatic setting of certain vars, handle explicitly later
var exclusions = ["complex_livery_data", "full_liveries","company_liveries", "squad_types", "marine_structs", "squad_structs"]; // skip automatic setting of certain vars, handle explicitly later

// Automatic var setting
var all_names = struct_get_names(save_data);
Expand Down Expand Up @@ -198,6 +199,15 @@ deserialize = function(save_data){
variable_struct_set(obj_ini, "full_liveries", array_create(21,variable_clone(livery_picker.map_colour)));
}

livery_picker.scr_unit_draw_data(-1);
if(struct_exists(save_data, "company_liveries")){
variable_struct_set(obj_ini, "company_liveries", save_data.company_liveries)
} else {
variable_struct_set(obj_ini, "company_liveries", array_create(11,variable_clone(livery_picker.map_colour)));
}

livery_picker.scr_unit_draw_data();

if(struct_exists(save_data, "complex_livery_data")){
variable_struct_set(obj_ini, "complex_livery_data", save_data.complex_livery_data);
}
Expand Down
10 changes: 9 additions & 1 deletion scripts/scr_ComplexSet/scr_ComplexSet.gml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,15 @@ function ComplexSet(unit) constructor{
continue;
}
}
}
}
if (struct_exists(_mod, "chapter")){
var chap_name = instance_exists(obj_creation) ?obj_creation.chapter_name : global.chapter_name;
if (chap_name!=_mod.chapter){
if (!check_exception("chapter")){
continue;
}
}
}
var _overides = "none";
if (struct_exists(_mod, "overides")){
_overides = _mod.overides;
Expand Down
7 changes: 6 additions & 1 deletion scripts/scr_buttons/scr_buttons.gml
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ function radio_set(options_array, title)constructor{
y_gap = 5;
x1 = 0;
y1 = 0;
changed = false;
max_width = 0;
max_height = 0;
for (var i=0;i<array_length(options_array);i++){
Expand All @@ -448,7 +449,8 @@ function radio_set(options_array, title)constructor{
static update = item_data_updater;
static draw = function(){
draw_text(x1, y1, title);

changed = false;
var _start_current_selection = current_selection;
var _prev_x = x1;
var _prev_y = y1+string_height(title)+10;
var items_on_row = 0;
Expand Down Expand Up @@ -477,6 +479,9 @@ function radio_set(options_array, title)constructor{
}
}
}
if (_start_current_selection != current_selection){
changed = true;
}
}
}

Expand Down
24 changes: 22 additions & 2 deletions scripts/scr_chapter_new/scr_chapter_new.gml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function ChapterData() constructor {
discipline = "librarius"; // todo convert to enum

full_liveries = "";
company_liveries = "";
complex_livery_data = complex_livery_default();


Expand Down Expand Up @@ -193,6 +194,8 @@ function scr_chapter_new(argument0) {

full_liveries = ""; // until chapter objects are in full use kicks off livery propogation

company_liveries = "";

// argument0 = chapter
obj_creation.use_chapter_object = false; // for the new json testing
var chapter_id = eCHAPTERS.UNKNOWN;
Expand Down Expand Up @@ -325,6 +328,7 @@ function scr_chapter_new(argument0) {

obj_creation.buttons.culture_styles.set(chapter_object.culture_styles);
obj_creation.full_liveries = chapter_object.full_liveries;
obj_creation.company_liveries = chapter_object.company_liveries;
obj_creation.complex_livery_data = chapter_object.complex_livery_data;
if (obj_creation.full_liveries!=""){
obj_creation.livery_picker.map_colour = full_liveries[0];
Expand Down Expand Up @@ -380,9 +384,25 @@ function scr_chapter_new(argument0) {
lens_color:lens_color,
weapon_color:weapon_color
}
livery_picker = new ColourItem(100,230);
if (company_liveries == ""){
livery_picker.scr_unit_draw_data(-1);
company_liveries = array_create(11,variable_clone(livery_picker.map_colour));
} else {
livery_picker.scr_unit_draw_data(-1);
var _all_maps = struct_get_names(livery_picker.map_colour);
for (var i=0;i<array_length(company_liveries);i++){
var _comp_data = company_liveries[i];
for (var s=0;s<array_length(_all_maps);s++){
var _name = _all_maps[s];
if !(struct_exists(_comp_data,_name )){
_comp_data[$ _name] = livery_picker.map_colour[$ _name];
}
}
}
}
livery_picker.scr_unit_draw_data();
if (full_liveries==""){

livery_picker = new ColourItem(100,230);
livery_picker.scr_unit_draw_data();
livery_picker.set_default_armour(struct_cols,col_special);
full_liveries = array_create(21,variable_clone(livery_picker.map_colour));
Expand Down
4 changes: 4 additions & 0 deletions scripts/scr_chapter_random/scr_chapter_random.gml
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ function scr_chapter_random(argument0) {
weapon_color:weapon_color
}
obj_creation.livery_picker = new ColourItem(100,230);

obj_creation.livery_picker.scr_unit_draw_data(-1);
obj_creation.company_liveries = array_create(11,variable_clone(obj_creation.livery_picker.map_colour));

obj_creation.livery_picker.scr_unit_draw_data();
obj_creation.livery_picker.set_default_armour(struct_cols,col_special);
obj_creation.full_liveries = array_create(21,variable_clone(obj_creation.livery_picker.map_colour));
Expand Down
Loading