Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Extra vehicles from json now works #362

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
8 changes: 4 additions & 4 deletions ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon7.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon8.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon9.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy_icons.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy10.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy11.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy12.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
Expand All @@ -184,6 +183,7 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy6.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy7.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy8.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy_icons.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"instructions.txt","CopyToMask":9223372036854775807,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"symbol1.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"symbol2.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
Expand Down Expand Up @@ -397,10 +397,10 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"eldar.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"genestealercult.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"hulk.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"sector.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"space_marine.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"star.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
Expand Down Expand Up @@ -1447,6 +1447,6 @@
],
"templateType": null,
"TextureGroups": [
{"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,},
{"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","customOptions":"","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,},
],
}
1 change: 0 additions & 1 deletion datafiles/main/chapters/1.JSON
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@
"ninth": 0,
"tenth": 0
},
// * Not working yet
"extra_vehicles": {
"rhino": 0,
"whirlwind": 0,
Expand Down
3 changes: 3 additions & 0 deletions datafiles/main/chapters/template.JSON
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@
"ninth": 0,
"tenth": 0
},
/**
* All vehicles are added to the 10th company at the start of the game
*/
"extra_vehicles": {
"rhino": 0,
"whirlwind": 0,
Expand Down
69 changes: 69 additions & 0 deletions scripts/scr_initialize_custom/scr_initialize_custom.gml
Original file line number Diff line number Diff line change
Expand Up @@ -3195,6 +3195,75 @@ function scr_initialize_custom() {
scr_add_item(e_name, e_qty);
}
}
if(struct_exists(obj_creation, "extra_vehicles")){
var _slot = 1;
while(obj_ini.veh_role[10][_slot] != ""){ // try not to overwrite existing vehicles
_slot++;
if(_slot > 500){ // no crash pls
break;
}
}
if (_slot < 500){
if(struct_exists(obj_creation.extra_vehicles, "rhino")){
if(real(obj_creation.extra_vehicles.rhino) > 0){
repeat(real(obj_creation.extra_vehicles.rhino)){
add_veh_to_company("Rhino", 10, _slot, "Storm Bolter","HK Missile","","","Dozer Blades");
_slot++;
man_size += 10;
}
}
}
if(struct_exists(obj_creation.extra_vehicles, "whirlwind")){
if(real(obj_creation.extra_vehicles.whirlwind) > 0){
repeat(real(obj_creation.extra_vehicles.whirlwind)){
add_veh_to_company("Whirlwind", 10, _slot, "Whirlwind Missiles", "HK Missile", "","","");
_slot++;
man_size += 10;
}
}
}
if(struct_exists(obj_creation.extra_vehicles, "predator")){
if(real(obj_creation.extra_vehicles.predator) > 0){
repeat(real(obj_creation.extra_vehicles.predator)){
if (!floor(_slot % 2) == 1) {
add_veh_to_company("Predator", 10, _slot, "Twin Linked Lascannon Turret", "Lascannon Sponsons", "HK Missile", "","Searchlight");
}
if (floor(_slot % 2) == 1) {
add_veh_to_company("Predator", 10, _slot, "Autocannon Turret", "Heavy Bolter Sponsons", "Storm Bolter", "","Dozer Blades");
}
man_size += 10;
_slot++;
}
}
}
if(struct_exists(obj_creation.extra_vehicles, "land_raider")){
if(real(obj_creation.extra_vehicles.land_raider) > 0){
repeat(real(obj_creation.extra_vehicles.land_raider)){
if (floor(_slot % 4) == 1) || (floor(_slot % 4) == 2) {
add_veh_to_company("Land Raider", 10, _slot, "Twin Linked Heavy Bolter Mount", "Twin Linked Lascannon Sponsons", "HK Missile", "Heavy Armour", "Searchlight")
}
if (floor(_slot % 4) == 3) {
add_veh_to_company("Land Raider", 10, _slot, "Twin Linked Assault Cannon Mount", "Hurricane Bolter Sponsons", "Storm Bolter", "Heavy Armour", "Frag Assault Launchers")
}
if (floor(_slot % 4) == 0) {
add_veh_to_company("Land Raider", 10, _slot, "Twin Linked Assault Cannon Mount", "Flamestorm Cannon Sponsons", "Storm Bolter", "Heavy Armour", "Frag Assault Launchers")
}
_slot++;
man_size += 10;
}
}
}
if(struct_exists(obj_creation.extra_vehicles, "land_speeder")){
if(real(obj_creation.extra_vehicles.land_speeder) > 0){
repeat(real(obj_creation.extra_vehicles.land_speeder)){
add_veh_to_company("Land Speeder", 10, _slot, "Heavy Bolter", "", "","","");
}
_slot++;
man_size += 10;
}
}
}
}

if(scr_has_disadv("Sieged")){
scr_add_item("Narthecium", 4);
Expand Down
Loading