From b8177f729105f45b10def10584801a8cd66c24bc Mon Sep 17 00:00:00 2001 From: qaate47 Date: Tue, 16 Apr 2024 22:24:30 +0200 Subject: [PATCH] cw zombies eyes, some errors, tests --- coldwar/scripts/core_common/dev/config.gsc | 19 ++- coldwar/scripts/core_common/header.gsc | 1 + coldwar/scripts/core_common/menu_funcs.gsc | 2 +- coldwar/scripts/core_common/menu_items.gsc | 20 +++ coldwar/scripts/zm_common/zm.gsc | 3 + coldwar/scripts/zm_common/zombie_eyes.gsc | 73 +++++++++++ docs/notes/errors.tsv | 25 ++++ docs/notes/funcs.csv | 4 +- docs/notes/notes.md | 15 +++ scripts/core_common/dev/dev.gsc | 145 ++++++++++++++++++++- scripts/core_common/main/headers.gsc | 1 + shell_scripts/compiler_pc.ps1 | 4 +- 12 files changed, 298 insertions(+), 14 deletions(-) create mode 100644 coldwar/scripts/zm_common/zombie_eyes.gsc diff --git a/coldwar/scripts/core_common/dev/config.gsc b/coldwar/scripts/core_common/dev/config.gsc index 0eb5e1d..2c7ee5e 100644 --- a/coldwar/scripts/core_common/dev/config.gsc +++ b/coldwar/scripts/core_common/dev/config.gsc @@ -1,7 +1,7 @@ #ifdef ATIAN_MENU_DEV function AtianMenuConfigDev() { // zombies per round - self.zombies_per_rounds = 99999; + self.zombies_per_rounds = 7; self.force_camo = 63; @@ -16,7 +16,22 @@ function AtianMenuConfigDev() { "tool_menu::Invulnerability" ); + self.zombies_eyes = #"random"; + // zm halloween - setgametypesetting(#"hash_4751990deae37e66", true); + //setgametypesetting(#"hash_4751990deae37e66", true); + + thread get_xp_multiplier_late(); +} + +function get_xp_multiplier_late() { + wait 10; + if (is_zombies()) { + level.var_3426461d = &get_xp_multiplier; + } +} + +function get_xp_multiplier() { + return 99999; } #endif \ No newline at end of file diff --git a/coldwar/scripts/core_common/header.gsc b/coldwar/scripts/core_common/header.gsc index 10cd69c..30064d0 100644 --- a/coldwar/scripts/core_common/header.gsc +++ b/coldwar/scripts/core_common/header.gsc @@ -7,6 +7,7 @@ #include scripts\core_common\values_shared; #include scripts\core_common\util_shared; #include scripts\core_common\player\player_stats; +#include scripts\core_common\spawner_shared; #namespace atianmenu; diff --git a/coldwar/scripts/core_common/menu_funcs.gsc b/coldwar/scripts/core_common/menu_funcs.gsc index 47d0cbf..f7fa69b 100644 --- a/coldwar/scripts/core_common/menu_funcs.gsc +++ b/coldwar/scripts/core_common/menu_funcs.gsc @@ -436,7 +436,7 @@ function func_unlock_all(item) { #endif } -func_3rdperson(item) { +function func_3rdperson(item) { if (!isdefined(self.thirdperson)) { self.thirdperson = false; } diff --git a/coldwar/scripts/core_common/menu_items.gsc b/coldwar/scripts/core_common/menu_items.gsc index 455b499..eaf7acb 100644 --- a/coldwar/scripts/core_common/menu_items.gsc +++ b/coldwar/scripts/core_common/menu_items.gsc @@ -25,6 +25,14 @@ function init_menus() { self add_menu_item("zombies_speed", "Super sprint", &func_zombies_speed, "super_sprint"); self add_menu_item("tool_zm", "Open doors", &func_zombie_open_sesame); + + self add_menu("zombies_eyes", "Zombies eyes", "tool_zm", true); + self add_menu_item("zombies_eyes", "Clear", &func_zm_set_zombies_eyes_color, #"clear"); + self add_menu_item("zombies_eyes", "Blue", &func_zm_set_zombies_eyes_color, #"blue"); + self add_menu_item("zombies_eyes", "Green", &func_zm_set_zombies_eyes_color, #"green"); + self add_menu_item("zombies_eyes", "Red", &func_zm_set_zombies_eyes_color, #"red"); + self add_menu_item("zombies_eyes", "Orange", &func_zm_set_zombies_eyes_color, #"orange"); + self add_menu_item("zombies_eyes", "Random", &func_zm_set_zombies_eyes_color, #"random"); } self add_menu("tool_weapon", "Guns", "start_menu", true); @@ -375,9 +383,21 @@ function init_menus() { self add_menu_item("dev", "test weapon 1", &func_dev_weap_1); self add_menu_item("dev", "test weapon 2", &func_dev_weap_2); + self add_menu_item("dev", "test ee", &func_test_ee); } } +function func_test_ee(item) { +#ifdef ATIAN_MENU_DEV + isee = @zm_utility::is_ee_enabled; + if (isdefined(isee)) { + self iprintln("ee: " + [[ isee ]]()); + } else { + self iprintln("ee: undefined"); + } +#endif +} + function add_vehicle_obj(title, vehicule_type) { if (!isassetloaded("vehicle", vehicule_type)) { return; // vehicle not loaded or already in the enum diff --git a/coldwar/scripts/zm_common/zm.gsc b/coldwar/scripts/zm_common/zm.gsc index 8a3899a..8b7e552 100644 --- a/coldwar/scripts/zm_common/zm.gsc +++ b/coldwar/scripts/zm_common/zm.gsc @@ -7,6 +7,7 @@ function __pre_init_zm__() { level.player_starting_points = level.atianconfig.player_starting_points; } callback::add_callback(#"on_round_end", &on_round_end, undefined); + spawner::add_archetype_spawn_function(#"zombie", &on_zm_zombie_spawn); } function init_gametype_zm() { @@ -24,6 +25,8 @@ function count_zombies(*round_number, *player_count) { function on_round_end() { level endon(#"hash_3e765c26047c9f54", #"end_game"); + + wait 10; level flag::set("rbz_exfil_allowed"); } \ No newline at end of file diff --git a/coldwar/scripts/zm_common/zombie_eyes.gsc b/coldwar/scripts/zm_common/zombie_eyes.gsc new file mode 100644 index 0000000..adf2e9a --- /dev/null +++ b/coldwar/scripts/zm_common/zombie_eyes.gsc @@ -0,0 +1,73 @@ +function on_zm_zombie_spawn() { + self.am_noted = 1; + if (isdefined(level.atianconfig.zombies_eyes)) { + color_id = zm_set_zombies_eyes_color_title(level.atianconfig.zombies_eyes); + // delay the call to bypass the default implementation + self thread zm_zombie_eye_glow_delay(color_id); + } +} + +function func_zm_set_zombies_eyes_color(item, color_id) { + zm_set_zombies_eyes_color(color_id); +} + +function zm_set_zombies_eyes_color(color_id) { + level.atianconfig.zombies_eyes = color_id; + + all_ai = getaiteamarray(#"world"); + if (isdefined(all_ai)) { + foreach (ai in all_ai) { + if (isalive(ai)) { + // set the zombies' color for the alive one + ai thread zm_zombie_eye_glow(color_id); + } + } + } +} + +function zm_zombie_eye_glow_rainbow(color_id) { + if (color_id == #"random") { + return randomintrange(1, 5); + } + return color_id; +} + +function zm_zombie_eye_glow_delay(color_id) { + self endon(#"death"); + if(isdefined(self.in_the_ground) && self.in_the_ground || (isdefined(self.in_the_ceiling) && self.in_the_ceiling)) { + while(!isdefined(self.create_eyes)) { + wait(0.1); + } + } else { + wait(0.5); + } + wait 0.1; + self zm_zombie_eye_glow(color_id); +} + +function zm_zombie_eye_glow(color_id) { + if(!isdefined(self) || !isactor(self)) { + return; + } + self clientfield::set("zombie_eye_glow", zm_zombie_eye_glow_rainbow(color_id)); +} + +function zm_set_zombies_eyes_color_title(color_title) { + if (!ishash(color_title)) { + color_title = hash(color_title); + } + switch (color_title) { + case #"blue": + return 2; + case #"green": + return 3; + case #"orange": + return 4; + case #"clear": + return 0; + case #"random": + return #"random"; + default: + return 1; + } +} diff --git a/docs/notes/errors.tsv b/docs/notes/errors.tsv index 59d8bc3..4462601 100644 --- a/docs/notes/errors.tsv +++ b/docs/notes/errors.tsv @@ -8,6 +8,7 @@ Baker 441 Proper Section 2346900383 not an object Baker 917 Brute Goodnight 4104994143 can't allocate more script variables Boy 108 Sapphire Sagittarius 766802866 Invalid fastfile header Boy 145 Destructive Tank 3304446514 not an entity +Boy 44 Blood Lamprey 3971544690 time cannot be negative Boy 601 Everest Tiger 312545010 not a vector Boy 856 Burner Eclipse 1015938482 not an entity Boy 986 Extreme Crossbones 3488519410 object is not an array, string, or vector @@ -30,6 +31,7 @@ Charlie 530 Cut Security 2036025092 formatting can only be used with player enti Charlie 555 Acid Jackpot 3812357892 script stack overflow (too many embedded function calls) Charlie 643 Ace Alligator 1167526340 invalid session mode Collar 543 Satellite Fort 1756043215 Usage: kill( , , , ) +Collar 738 Destructive Crocodile 1156941583 Invalid threat bias group Collar 772 Flying Shell 2378228303 invalid session mode David 180 Camouflaged Asset 2572009355 vector scale expecting vector David 246 Violet Axe 285416523 not an object @@ -44,6 +46,7 @@ Delta 320 Monster Tornado 179749049 cannot cast to bool Delta 515 United Mauler 3137736761 script stack overflow (too many embedded function calls) Delta 694 Fierce Fort 1752379961 param is not an object Delta 796 Nightshade Artillery 2274889209 Invalid type passed in from array into waittill parameter list +Delta 884 Aggressive Sunrise 3706227705 Invalid threat bias group Delta 899 Urban Claw 2955023929 not an object Dog 415 Dry Owl 409067247 No clientfield named found in set. East 1005 Found Badger 269518924 Ammo count must not be negative @@ -66,6 +69,7 @@ Fall 344 Camouflaged Cover 2655888797 endon must have at least one valid argumen Fall 388 Quick Conflict 1364331101 Object must be an array Fall 508 Solo Defense 1668598749 not an object Fall 52 Air Spear 2921226909 Can't register dvar +Fall 697 Defiant Owl 417653725 EXE_PATCH_STATSOVERFLOW Fall 78 Sub-zero Serpent 3098745181 invalid character index Foxtrot 14 Nuclear Cobra 209668787 RandomInt parm must be positive integer. Foxtrot 187 Aggressive Ordnance 2078816051 not a valid name for a clientfield set. @@ -82,6 +86,7 @@ Golf 643 Earth Specialist 2417691091 Execution Queue out of memory Hotel 151 Guerrilla Jackpot 3815761761 Error when loading fastfile Hotel 173 Tragic Goblin 3459949409 Failed to alloc client field - MAX_CLIENTFIELD_FIELDS_IN_SET=512 exceeded. Hotel 39 Weak Outlaw 4048135393 Can't find variable +Hotel 418 Grey Management 4229118753 Invalid threat bias group Hotel 460 United Goblin 3456527393 script stack overflow (too many embedded function calls) Hotel 511 Meridian Boar 114609313 USAGE: GetInfluencerPreset could not find influencer with name Hotel 621 Dry Greyhound 476151073 invalid session mode @@ -90,11 +95,14 @@ Ida 309 Barricaded Bandit 3210502050 not an object Ida 635 Rightful Elephant 467754466 Error registering client field. bCallbacksFor0WhenNew (CF_CALLBACK_ZERO_ON_NEW_ENT) is disallowed for CF_SCRIPTMOVERFIELDS. Ida 736 Quick Lamprey 3964856290 kill called on an entity with magic bullet shield (FL_DISABLE_DEATH) Ida 941 Gray Mustang 3894031202 Can't find gamedata/playeranim/playeranimtypes.txt +India 185 Operation Crocodile 1147874990 start time must be between 0 and 1 India 36 Skyline Overlord 2903034222 Invalid mode id India 441 Stealth Star 3857374126 caller is not an object India 579 Deadly Gemini 657813230 Error registering client field. bCallbacksFor0WhenNew (CF_CALLBACK_ZERO_ON_NEW_ENT) is disallowed for counter type clientfields. Due to it's treatment of the old and new val as a ring buffer, the counter type is not valid on a new snapshot, new ent, or demojump India 811 Max Thunder 530300974 divide by 0 Juliett 283 Apocalyptic Vulture 424587329 not a pathnode +Juliett 490 Quick Fury 2941436609 Invalid threat bias group +Juliett 510 Blazing Station 2797012161 distMax is less than distMin Juliett 791 Null Lantern 3678699265 not a pointer Juliett 859 Small Rookie 554833601 Can only do this call for node_turret June 426 Hurt Tactics 2489324310 cannot switch on type @@ -107,6 +115,8 @@ Kilo 717 Clockwork Refuge 4220857104 Cannot call IncrementClientField on a 'coun King 1002 Fast Linebacker 3059411687 Argument and parameter count mismatch for LUINotifyEvent King 220 Wartorn Fury 2940210599 Invalid Version Handling. Grab Bat !!! King 30 Tough Asset 2577695271 SetModel can only be called on a script mover +King 404 Sapphire Ice 3635717863 end time must be between 0 and 1 +King 593 Late Ant 1206320999 getClosestOrFarthestEntity: struct passed in doesn't have an origin Lima 486 Flat Apocalypse 3361905947 Pointer is not an entity Lima 495 Old Security 2033447003 not an array key Lima 510 Bogus Rescue 2235303131 not a player entity @@ -132,12 +142,16 @@ Nora 871 Orange Mirage 3255107847 LUINotifyEvent: entity must be a player entity North 272 Hannibal Defense 1670707254 linking error North 662 Military Plane 2104587190 Unknown client field set for clientfield North 78 Blood Wolf 12065142 invalid session mode +North 803 Swamp Conflict 1359849142 not an entity +North 928 Fake Fury 2940431926 Invalid threat bias group +North 96 Sleeper Demon 544902518 parameter does not exist November 116 Mythic Scorpio 750896894 Invalid bgCache type November 268 Wild Greyhound 475330046 Invalid dvar type November 417 Silver Sunrise 3692510654 Invalid type passed in from array into waittill parameter list November 588 Barren Carrier 1593720126 Can't register dvar November 670 Boiling Avalanche 829015102 not a pointer November 670 Boiling Avalanche 829015102 var isn't a field object +November 817 Tall Shell 2369974846 Invalid threat bias group November 990 Fake Operator 1480821566 Error registering client field. Attempted field size is not acceptable bit number range 1->32 Ocean 116 Confused Corps 1642120921 1st param should be a hash or a string Ocean 270 Grounded Infantry 1850691545 Debug Break @@ -150,6 +164,7 @@ Oscar 1009 Emerald Invasion 1908025062 parameter isn't a string Oscar 771 Central Zeus 3329708710 Unable to find default bitfield, dropping Papa 1018 Rocky Beastmaster 3030895505 Whitelist failure for title Papa 209 Grey Cadet 1544804945 script stack overflow (too many embedded function calls) +Papa 530 Invisible Hippo 989284113 model not cached by the linker Papa 656 Area Jaguar 1088278929 Raw file is not a file of the right type Papa 810 Right Case 2606724305 parameter does not exist Papa 859 Fierce Python 1047729873 exitlevel already called @@ -167,6 +182,7 @@ Quebec 387 Poison Goodnight 4106063796 key value provided for array is not valid Quebec 529 Knockout Headquarters 1804370036 Failed to verify file type Quebec 794 Bog Fleet 1697447028 Can't use wait with profiler Quebec 873 Midnight Operator 1487510644 Could not load gsc object +Quebec 919 Hidden Dawn 4077883892 Param can't be higher than 7 Quebec 965 Dangerous Jackpot 3810601716 undefined param Queen 114 Rocky Medal 1957162421 Can't find bgCache entry Queen 116 Classic Rattlesnake 124438261 not a script function pointer @@ -177,6 +193,7 @@ Queen 235 Wicked Libra 732489269 Non-player entity passed to UploadStats() Queen 254 Unfriendly Python 1053986869 GScr_UseBuildKitWeaponModel: called with weapon 'none' Queen 427 Apocalyptic Treasure 4182670005 invalid session mode Queen 47 Sick Eagle 325402485 script stack overflow (too many embedded function calls) +Queen 513 Ultraviolet Buffalo 1304594933 unable to spawn entity Queen 577 Weak Manuever 1967731701 Invalid type passed in from array into waittill parameter list Queen 964 Shellshocked Rank 2185211445 Can't register dvar Roger 304 Hurt Honey 3797948576 not an object @@ -187,6 +204,7 @@ Roger 630 Shadow Zombie 899599904 first arg to waittill_timeout must evaluate to Roger 753 Fake Outlaw 4047738848 Invalid opcode (Recovery) Roger 850 Grey Whisper 3524483616 Ammo count must not be negative Roger 853 Lone Platoon 2122198496 The sound globals have been overwritten +Romeo 215 Early Stockade 2481266032 can't cast parameter to string Romeo 459 Battle Traffic 2838301872 Gesture table key can't have the higher bit set Romeo 534 Axiom Asset 2579736624 Incorrect number of parameters. Romeo 569 Clipped Squad 2448966512 string too long @@ -202,6 +220,7 @@ Sail 506 Blink Alligator 1167129573 key does not internally belong to generic en Sail 543 Earth Whisper 3524990949 not an array key Sail 630 Nuclear Bug 2894056997 DEV: CL_SetCGameTime: !cl->snap.valid Sail 692 Sapphire Avalanche 833940261 divide by 0 +Sail 946 Due Outlander 3922439973 ArraySort: array can only contain entities or structs or vectors Sierra 190 Knight Thunder 530250396 Source Damage vector is invalid. Sierra 54 Found Treasure 4178589916 Model was not cached by the linker. South 1020 Calm Potato 2538360978 caller is not an object @@ -228,6 +247,7 @@ Summer 620 Split Legend 2734491973 Error need at least one argument for LUINotif Summer 738 Barracuda Pattern 2782299909 script stack overflow (too many embedded function calls) Summer 986 Rare Operator 1480037573 Invalid canonical name hash Tango 516 Advanced Tactics 2498210007 -- can only be used with integer type +Tango 534 Blind Asset 2572593175 unable to spawn entity Tango 8 Knight Taurus 647662103 parameter can't be cast to a string Tango 882 Aurora Invasion 1909233687 Optional argument must be a vector type Tommy 439 Tin Highway 3592841213 cannot directly set the origin on AI. Use the teleport command instead. @@ -243,6 +263,7 @@ Union 344 Blue Headquarters 1795335576 not an object Union 701 Sick Eclipse 1013305560 Pointer types passed into waittill expressions must evaluate as arrays Union 908 Evil Giant 876169112 key value provided for struct is not valid Union 958 Mad Retreat 2253722136 CamAnimScripted can only be called on a player. +Vic 335 Small Pattern 2769479381 Invalid threat bias group Vic 366 Crystal Lion 249068885 Failed to allocate from state pool Vic 415 Aggressive Pisces 619241173 Failed to allocate from element pool Vic 504 Pale Fury 2942156629 not an array @@ -251,6 +272,7 @@ Vic 820 Nitro Goodnight 4103906837 Entity is not an item. Vic 983 Extreme Traffic 2851002517 param is not an object Vice 344 Spotted Doppelganger 4252738993 script stack overflow (too many embedded function calls) Vice 400 Tall Dove 222443377 Pointer types passed into waittill_timeout expressions must evaluate as arrays +Vice 535 TD Rookie 562750257 ArraySort can only be called on an Entity which is of type Entity, Path Node, Vehicle Node, or Tacpoint. Vice 697 Metal Service 2355618801 Gesture table key can't have the higher bit set Vice 70 Grim Storm 1402557361 bad opcode Vice 804 Axiom Conquest 3385008561 cannot set field on type @@ -286,8 +308,10 @@ Yankee 687 Screech Snake 512306404 not a function pointer Yankee 780 Bad Shell 2368908708 invalid session mode Yankee 913 Evil Libra 725202020 caller is not an object Yankee 921 Gothic Navy 2055356644 entity is not a script_brushmodel, script_model, script_origin, probe, or light +Yorker 54 Violet Zombie 889403597 SpawnCollision: Collision model name is not valid Yorker 553 Broken Lion 243367053 The setHintStringForPlayer command can only change prompts for players. Yorker 721 Nickel Platoon 2116335949 function called with too many parameters +Yorker 902 Small Doppelganger 4245873293 not a path node Young 100 Skyline Pavement 3607664937 first arg to endon_callback must evaluate to a function value Young 137 Blind Lantern 3679846953 LUINotifyEvent: entity must be a player entity Young 598 Patient Command 1601358697 param is not an object @@ -297,6 +321,7 @@ Zebra 32 Grizzly Lizard 377246011 invalid session mode Zebra 84 World Bayonet 1524410875 Execution Queue out of memory Zebra 909 Aurora Wave 3654063291 ScrEvent map is full, unable to register new event Zed 105 Riptide Volley 2517242050 parameter does not exist +Zed 170 Extreme Gorilla 367932162 ArraySort: array contains more than 4096 entities Zed 251 Silent Scorpio 753495682 RandomIntRange's second parameter must be greater than the first. Zed 453 Kinetic Devil 1211376898 DEV: Could not load level fastfile for level Zed 606 Tin Refuge 4213634562 precacheLeaderboards must be called before any wait statements in the gametype or level script diff --git a/docs/notes/funcs.csv b/docs/notes/funcs.csv index 0b5faa0..3fcf578 100644 --- a/docs/notes/funcs.csv +++ b/docs/notes/funcs.csv @@ -390,8 +390,8 @@ GSC-Function-49b9ae0,recordent,1,1,1,BlackOps4.exe+330A630,nulled GSC-Function-49b9ae0,recorderplayback,0,0,1,BlackOps4.exe+330A680,nulled GSC-Function-49b9ae0,print,1,7fffffff,1,BlackOps4.exe+3397C50,nulled GSC-Function-49b9ae0,println,1,7fffffff,1,BlackOps4.exe+3397C60,nulled -GSC-Function-49b9ae0,profileprintln,1,7fffffff,0,BlackOps4.exe+3397C70, -GSC-Function-49b9ae0,printtoprightln,1,3,0,BlackOps4.exe+3397C80, +GSC-Function-49b9ae0,profileprintln,1,7fffffff,0,BlackOps4.exe+3397C70,nulled +GSC-Function-49b9ae0,printtoprightln,1,3,0,BlackOps4.exe+3397C80,nulled GSC-Function-49b9ae0,iprintln,1,7fffffff,0,BlackOps4.exe+3397C90, GSC-Function-49b9ae0,iprintlnbold,1,7fffffff,0,BlackOps4.exe+3397CF0, GSC-Function-49b9ae0,print3d,2,6,1,BlackOps4.exe+3397D50,nulled diff --git a/docs/notes/notes.md b/docs/notes/notes.md index 53f9ec5..72ed9a7 100644 --- a/docs/notes/notes.md +++ b/docs/notes/notes.md @@ -1306,4 +1306,19 @@ music zm_frontend Animtree = sub_2755AB0 + +DVAR_NONE = 0, +DVAR_ARCHIVE = 1 << 0, // 0x1 +DVAR_USERINFO = 1 << 1, // 0x2 +DVAR_SERVERINFO = 1 << 2, // 0x4 +DVAR_SYSTEMINFO = 1 << 3, // 0x8 +DVAR_LATCH = 1 << 4, // 0x10 +DVAR_ROM = 1 << 5, // 0x20 +DVAR_SAVED = 1 << 6, // 0x40 +DVAR_INIT = 1 << 7, // 0x80 +DVAR_CHEAT = 1 << 8, // 0x100 +//DVAR_UNKNOWN = 1 << 9, // 0x200 +DVAR_EXTERNAL = 1 << 10, // 0x400 +//DVAR_UNKNOWN3x = 1 << 11-13, // 0x800-> // 0x2000 +DVAR_SESSIONMODE = 1 << 15 // 0x8000 ``` \ No newline at end of file diff --git a/scripts/core_common/dev/dev.gsc b/scripts/core_common/dev/dev.gsc index 2e9efeb..33b0504 100644 --- a/scripts/core_common/dev/dev.gsc +++ b/scripts/core_common/dev/dev.gsc @@ -109,16 +109,147 @@ debugln(str_line) { } func_dev_method1(item) { + setdvar(#"party_minplayers", 1); + setdvar(#"bot_difficulty", 3); + setdvar(#"bot_maxAllies", 9); + setdvar(#"bot_maxAxis", 9); + setdvar(#"bot_maxFree", 17); + setdvar(#"lobby_forceLAN", 1); + setdvar(#"lobbyDedicatedSearchSkip", 1); + setdvar(#"lobbySearchSkip", 1); +} +compute_weapon_xp() { + levels = []; -#ifdef ATIAN_COD_TOOL - //ACTSLookup(4222); - z = 2 == []; -#endif - return undefined; + if (sessionmodeiszombiesgame()) { + prefix = "zm"; + } else if (sessionmodeismultiplayergame()) { + prefix = "mp"; + } else { + return levels; + } + + tablename = #"gamedata/weapons/" + prefix + "/" + prefix + "_gunlevels.csv"; + + rows = tablelookuprowcount(tablename); + columns = tablelookupcolumncount(tablename); + + if (!isdefined(rows) || !isdefined(columns) || rows * columns == 0) { + return levels; // empty + } + + for (row = 0; row < rows; row++) { + xp = tablelookupcolumnforrow(tablename, row, 2); + name = tablelookupcolumnforrow(tablename, row, 3); + + wp = getweapon(name); + + if (!isdefined(wp)) { + continue; + } + + cls = util::getweaponclass(wp); + + if (!isdefined(levels[cls])) { + levels[cls] = []; + } + levels[cls][wp] = xp; + } + + return levels; } +function lookup_group_name(str) { + if (!ishash(str)) { + return str; + } + switch (str) { + case #"weapon_assault": return "weapon_assault"; + case #"weapon_smg": return "weapon_smg"; + case #"weapon_tactical": return "weapon_tactical"; + case #"weapon_lmg": return "weapon_lmg"; + case #"weapon_sniper": return "weapon_sniper"; + case #"weapon_pistol": return "weapon_pistol"; + case #"weapon_launcher": return "weapon_launcher"; + case #"weapon_cqb": return "weapon_cqb"; + case #"weapon_knife": return "weapon_knife"; + case #"weapon_special": return "weapon_special"; + case #"group": return "group"; + case #"common": return "common"; + case #"global": return "global"; + default: return "" + str; + } +} + + func_dev_method2(item) { - //self clientfield::set("" + #"atianmenu_testfield", 1); - return undefined; +#ifdef ATIAN_MENU_DEV + if (sessionmodeiszombiesgame()) { + prefix = "zm"; + files = 6; + } else if (sessionmodeismultiplayergame()) { + prefix = "mp"; + files = 6; + } else if (sessionmodeiswarzonegame()) { + prefix = "wz"; + files = 0; + } else if (sessionmodeiscampaigngame()) { + prefix = "cp"; + files = 1; + } else { + self menu_drawing_secondary("^1Can't find mode"); + return; + } + + levels = compute_weapon_xp(); + weapon_groups = array(#"weapon_assault", #"weapon_smg", #"weapon_tactical", #"weapon_lmg", #"weapon_sniper", #"weapon_pistol", #"weapon_launcher", #"weapon_cqb", #"weapon_knife", #"weapon_special"); + // attachment + + for (tableid = 1; tableid <= files; tableid++) { + tablename = #"gamedata/stats/" + prefix + "/statsmilestones" + tableid + ".csv"; + rows = tablelookuprowcount(tablename); + columns = tablelookupcolumncount(tablename); + + if (!isdefined(rows) || !isdefined(columns) || rows * columns == 0) { + continue; // empty + } + + + for (row = 0; row < rows; row++) { + lvl = tablelookupcolumnforrow(tablename, row, 1); + value = tablelookupcolumnforrow(tablename, row, 2); + group = tablelookupcolumnforrow(tablename, row, 3); + name = tablelookupcolumnforrow(tablename, row, 4); + + self menu_drawing_function(lookup_group_name(group) + "/" + name); + + switch (group) { + case #"global": + self stats::function_dad108fa(name, value); + break; + case #"group": + foreach (grpname, wps in levels) { + foreach (weapon, xplvl in wps) { + self stats::function_e24eec31(weapon, name, value); + break; + } + wait 0.01; + } + break; + default: + if (isdefined(levels[group])) { + foreach (weapon, xplvl in levels[group]) { + self stats::set_stat(#"hash_60e21f66eb3a1f18", weapon.name, #"xp", xplvl); + self stats::function_e24eec31(weapon, name, value); + wait 0.01; + } + } + break; + } + wait 0.1; + } + uploadstats(self); + } +#endif } func_dev_method3(item) { return undefined; diff --git a/scripts/core_common/main/headers.gsc b/scripts/core_common/main/headers.gsc index 59f7c3b..dc4995f 100644 --- a/scripts/core_common/main/headers.gsc +++ b/scripts/core_common/main/headers.gsc @@ -11,6 +11,7 @@ #include scripts\core_common\flag_shared; #include scripts\core_common\bots\bot; #include scripts\core_common\player\player_role; +#include scripts\core_common\player\player_stats; #include scripts\core_common\values_shared; #include scripts\core_common\spawner_shared; #include scripts\core_common\flagsys_shared; diff --git a/shell_scripts/compiler_pc.ps1 b/shell_scripts/compiler_pc.ps1 index e30425c..38c39b1 100644 --- a/shell_scripts/compiler_pc.ps1 +++ b/shell_scripts/compiler_pc.ps1 @@ -14,8 +14,8 @@ try { debugcompiler.exe $arg --noupdate ` "-Cplatform=PC" ` - "-Cclient=false" "-Cdll=true" "-Cdll.lazylink=true" "-Cdll.builtins=true" "-Cdll.detours=true" ` - "-DATIAN_MENU_DEV" "-DSHIELD_GSC_DEPLOY" #"-DATIAN_MENU_LOOKUP_BIG" + "-DATIAN_MENU_DEV" #"-DSHIELD_GSC_DEPLOY" #"-DATIAN_MENU_LOOKUP_BIG" + #"-Cclient=false" "-Cdll=true" "-Cdll.lazylink=true" "-Cdll.builtins=true" "-Cdll.detours=true" ` if (!$?) { Write-Error "Error when compiling";