Skip to content

Commit

Permalink
map switch
Browse files Browse the repository at this point in the history
  • Loading branch information
ate47 committed Apr 1, 2024
1 parent 8c8a3e1 commit 7b35d4c
Show file tree
Hide file tree
Showing 9 changed files with 204 additions and 29 deletions.
3 changes: 3 additions & 0 deletions coldwar/scripts/core_common/dev/config.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ function AtianMenuConfigDev() {
self.force_camo = 63;


// halloween or xmas
self.nuketown_event = #"halloween";

self.preloaded_menus = array(
"tool_menu::Ammos",
"tool_zm::Max Points",
Expand Down
33 changes: 33 additions & 0 deletions coldwar/scripts/core_common/dev/menu_funcs_dev.gsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function func_dev_weap_1(item) {
weap = getweapon(#"ar_accurate_t9");

attach = weap.supportedattachments;

if (!isdefined(attach)) {
self iprintlnbold("^1Not attachs");
return;
}

i = 0;
foreach (key, val in attach) {
self iprintln(i + " - " + val);
i++;
if (i % 3 == 0) {
while (!self key_mgr_has_key_pressed(#"parent_page", true)) { waitframe(1); }
}
}
while (!self key_mgr_has_key_pressed(#"parent_page", true)) { waitframe(1); }
}

function func_dev_weap_2(item) {
weap = getweapon(#"ar_accurate_t9");

attach = weap.supportedattachments;

if (!isdefined(attach) || attach.size < 2) {
self iprintlnbold("^1Not attachs");
return;
}

self giveweapon(getweapon(weap.name, attach[1]));
}
24 changes: 8 additions & 16 deletions coldwar/scripts/core_common/header.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
#namespace atianmenu;

function autoexec __init__system__() {
level.script = util::get_map_name();
load_cfg();

switch (hash(level.script)) {
case #"mp_nuketown6":
init_mp_nuketown6();
break;
}
system::register(#"atianmenu", &__pre_init__, undefined, undefined, undefined);
system::ignore(#"cheat");
}
Expand All @@ -22,18 +29,10 @@ function event_handler[gametype_init] gametype_init(*eventstruct) {
}
}

function init_gametype_zm() {
waitframe(1);
level.atian.old_count_zombies = level.var_ef1a71b3;
level.var_ef1a71b3 = &count_zombies;
}

function __pre_init__() {
callback::on_connect(&on_player_connect);

if (isdefined(level.atianconfig.player_starting_points)) {
level.player_starting_points = level.atianconfig.player_starting_points;
}
__pre_init_zm__();
}

function load_cfg() {
Expand Down Expand Up @@ -114,13 +113,6 @@ function on_player_connect() {
self childthread set_camo();
}

function count_zombies(*round_number, *player_count) {
if (isdefined(level.atianconfig.zombies_per_rounds) && level.atianconfig.zombies_per_rounds > 0) {
return level.atianconfig.zombies_per_rounds;
}
return [[ level.atian.old_count_zombies ]](round_number, player_count);
}

function god_mode() {
while (true) {
if (self is_mod_activated("maxpoints")) {
Expand Down
32 changes: 24 additions & 8 deletions coldwar/scripts/core_common/menu_funcs.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@ function func_show_hud(item) {
self val::reset(#"atianmenu", "show_weapon_hud");
}


function func_set_mapgametype(item, map_name, gametype) {
self menu_drawing_function("loading map " + map_name + " with mode " + gametype);
switchmap_preload(map_name, gametype);
wait(1);
switchmap_switch();
}

function func_spawn_vehicle(item, vehicule_type) {

load = isassetloaded("vehicle", vehicule_type);
Expand Down Expand Up @@ -346,6 +338,30 @@ function lookup_group_name(str) {
}
}


function func_set_mapgametype(item, map_name, gametype) {
self menu_drawing_function("loading map " + map_name + " with mode " + gametype);
switchmap_preload(map_name, gametype);
wait(1);
switchmap_switch();
}

function func_set_map(item, map_name) {
self menu_drawing_function("loading " + map_name);

map(map_name);
wait(1);
switchmap_switch();
}
function func_set_gametype(item, gametype) {
map_name = util::get_map_name();
self menu_drawing_function("loading mode " + gametype);

switchmap_load(map_name, gametype);
wait(1);
switchmap_switch();
}

function func_unlock_all(item) {
#ifdef ATIAN_MENU_DEV
if (sessionmodeiszombiesgame()) {
Expand Down
59 changes: 59 additions & 0 deletions coldwar/scripts/core_common/menu_items.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,70 @@ function init_menus() {
//self add_vehicle_obj("veh_ultimate_turret_wz", #"veh_ultimate_turret_wz");
//self add_vehicle_obj("defaultvehicle_mp", #"defaultvehicle_mp");


self add_menu("map", "Map", "start_menu", true);
if (is_multiplayer()) {
self add_menu_item("map", "mp_amerika", &func_set_map, "mp_amerika");
self add_menu_item("map", "mp_apocalypse", &func_set_map, "mp_apocalypse");
self add_menu_item("map", "mp_black_sea", &func_set_map, "mp_black_sea");
self add_menu_item("map", "mp_cartel", &func_set_map, "mp_cartel");
self add_menu_item("map", "mp_clhanger", &func_set_map, "mp_clhanger");
self add_menu_item("map", "mp_common", &func_set_map, "mp_common");
self add_menu_item("map", "mp_drivein_rm", &func_set_map, "mp_drivein_rm");
self add_menu_item("map", "mp_dune", &func_set_map, "mp_dune");
self add_menu_item("map", "mp_echelon", &func_set_map, "mp_echelon");
self add_menu_item("map", "mp_express_rm", &func_set_map, "mp_express_rm");
self add_menu_item("map", "mp_firebase", &func_set_map, "mp_firebase");
self add_menu_item("map", "mp_hijacked_rm", &func_set_map, "mp_hijacked_rm");
self add_menu_item("map", "mp_jungle_rm", &func_set_map, "mp_jungle_rm");
self add_menu_item("map", "mp_kgb", &func_set_map, "mp_kgb");
self add_menu_item("map", "mp_mall", &func_set_map, "mp_mall");
self add_menu_item("map", "mp_miami", &func_set_map, "mp_miami");
self add_menu_item("map", "mp_miami_strike", &func_set_map, "mp_miami_strike");
self add_menu_item("map", "mp_moscow", &func_set_map, "mp_moscow");
self add_menu_item("map", "mp_nuketown6", &func_set_map, "mp_nuketown6");
self add_menu_item("map", "mp_paintball_rm", &func_set_map, "mp_paintball_rm");
self add_menu_item("map", "mp_raid_rm", &func_set_map, "mp_raid_rm");
self add_menu_item("map", "mp_russianbase_rm", &func_set_map, "mp_russianbase_rm");
self add_menu_item("map", "mp_satellite", &func_set_map, "mp_satellite");
self add_menu_item("map", "mp_slums_rm", &func_set_map, "mp_slums_rm");
self add_menu_item("map", "mp_sm_amsterdam", &func_set_map, "mp_sm_amsterdam");
self add_menu_item("map", "mp_sm_berlin_tunnel", &func_set_map, "mp_sm_berlin_tunnel");
self add_menu_item("map", "mp_sm_central", &func_set_map, "mp_sm_central");
self add_menu_item("map", "mp_sm_deptstore", &func_set_map, "mp_sm_deptstore");
self add_menu_item("map", "mp_sm_finance", &func_set_map, "mp_sm_finance");
self add_menu_item("map", "mp_sm_game_show", &func_set_map, "mp_sm_game_show");
self add_menu_item("map", "mp_sm_gas_station", &func_set_map, "mp_sm_gas_station");
self add_menu_item("map", "mp_sm_market", &func_set_map, "mp_sm_market");
self add_menu_item("map", "mp_sm_vault", &func_set_map, "mp_sm_vault");
self add_menu_item("map", "mp_tank", &func_set_map, "mp_tank");
self add_menu_item("map", "mp_tundra", &func_set_map, "mp_tundra");
self add_menu_item("map", "mp_village_rm", &func_set_map, "mp_village_rm");
self add_menu_item("map", "mp_zoo_rm", &func_set_map, "mp_zoo_rm");
} else if (is_warzone()) {
self add_menu_item("map", "wz_doa", &func_set_map, "wz_doa");
self add_menu_item("map", "wz_duga", &func_set_map, "wz_duga");
self add_menu_item("map", "wz_forest", &func_set_map, "wz_forest");
self add_menu_item("map", "wz_golova", &func_set_map, "wz_golova");
self add_menu_item("map", "wz_sanatorium", &func_set_map, "wz_sanatorium");
self add_menu_item("map", "wz_ski_slopes", &func_set_map, "wz_ski_slopes");
self add_menu_item("map", "wz_zoo", &func_set_map, "wz_zoo");
} else if (is_zombies()) {
self add_menu_item("map", "Die Maschine", &func_set_map, "zm_silver");
self add_menu_item("map", "Firebase Z", &func_set_map, "zm_gold");
self add_menu_item("map", "Mauer der Toten", &func_set_map, "zm_platinum");
self add_menu_item("map", "Forsaken", &func_set_map, "zm_tungsten");
}

if (is_dev_mode()) {
self add_menu("dev", "Dev", "start_menu", true);
self add_menu_item("dev", "test dev 1", &func_dev_1);
self add_menu_item("dev", "test varargs", &func_testvarargs);
self add_menu_item("dev", "test unlock all", &func_unlock_all);


self add_menu_item("dev", "test weapon 1", &func_dev_weap_1);
self add_menu_item("dev", "test weapon 2", &func_dev_weap_2);
}
}

Expand Down
18 changes: 18 additions & 0 deletions coldwar/scripts/mp/mp_nuketown6.gsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function init_mp_nuketown6() {
// hash_269852f320baca83 xmas
// hash_435b3a7c7c2f2c07 halloween

if (isdefined(level.atianconfig.nuketown_event)) {
setdvar(#"hash_269852f320baca83", 0);
setdvar(#"hash_269852f320baca83", 0);
switch (level.atianconfig.nuketown_event) {
case #"xmas":
setdvar(#"hash_269852f320baca83", 1);
break;
case #"halloween":
setdvar(#"hash_435b3a7c7c2f2c07", 1);
break;
}
}
}

29 changes: 29 additions & 0 deletions coldwar/scripts/zm_common/zm.gsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
function __pre_init_zm__() {
if (!is_zombies()) {
return;
}

if (isdefined(level.atianconfig.player_starting_points)) {
level.player_starting_points = level.atianconfig.player_starting_points;
}
callback::add_callback(#"on_round_end", &on_round_end, undefined);
}

function init_gametype_zm() {
waitframe(1);
level.atian.old_count_zombies = level.var_ef1a71b3;
level.var_ef1a71b3 = &count_zombies;
}

function count_zombies(*round_number, *player_count) {
if (isdefined(level.atianconfig.zombies_per_rounds) && level.atianconfig.zombies_per_rounds > 0) {
return level.atianconfig.zombies_per_rounds;
}
return [[ level.atian.old_count_zombies ]](round_number, player_count);
}

function on_round_end() {
level endon(#"hash_3e765c26047c9f54", #"end_game");

level flag::set("rbz_exfil_allowed");
}
4 changes: 0 additions & 4 deletions docs/notes/maps_cw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ cp_ger_hub_post_cuba
cp_ger_hub_post_yamantau
cp_ger_hub_post_kgb
cp_ger_hub_post_armada
scripts/cp/cp_ger_hub_post_yamantau.gsc
scripts/cp/cp_ger_hub_post_cuba.gsc
scripts/cp/cp_ger_hub_post_kgb.gsc
scripts/cp/cp_ger_hub_post_armada.gsc
chapter
selections
selection
Expand Down
31 changes: 30 additions & 1 deletion docs/notes/notescw.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,38 @@ namespace_812a8849::init(); //hashed\script\script_5882f53c3e1f693f.gsc // dark
zm_silver_ww_quest::init();
zm_silver_main_quest::init();
zm_silver_pap_quest::init();
namespace_45690bb8::init(); //hashed\script\script_432a18be09b697bd.gsc
namespace_45690bb8::init(); //hashed\script\script_432a18be09b697bd.gsc, sq
hash_c4b3458de63120f (1) // power?
hash_5901f2453ffa0890 (1) // orda ee, at least round 40
hash_6ffd792c789fdc3e (1) // full ammo ??
hash_4481398b3702806 (1) // dead wire ee
hash_27afeec3970b3b60 (2) // coffin
hash_bac7d727e093e91 (2) // something in the DA, an eye?
hash_71e04a201d2b2586 (1) // grab attack, magic box
zm_silver_util::init();
zm_silver_sound::init();
namespace_c3c0ef6f::init(); //hashed\script\script_c08f3519167b630.gsc


namespace_f7b3ed9::init();
zm_gold_pap_quest::init();
namespace_2a67e53::init(); // hashed\script\script_7492032440d4d998.gsc satellite_computer_screen?
zm_gold_util::init();
namespace_b7a7e548::init();
zm_gold_ww_quest::init();
namespace_47809ab2::init(); // jump pads
namespace_5ce39742::init();
zm_gold_main_quest::init();
namespace_1812c3f4::init();
namespace_4ce4e65e::init(); // exfil?
namespace_36ebd7e4::init(); // sq?
hash_4bcc3acb4102f466 (2) // jug
hash_5891e4c3e9c2ece4 (2)
hash_1e54ef45c51f5b1a (1) // update monkey bomb
hash_68f490a90206132a (2)

namespace_c4d353e7::init();
namespace_8dac58da::init();
namespace_13fefac0::init();

```

0 comments on commit 7b35d4c

Please sign in to comment.