Skip to content

Commit

Permalink
cw master spawners test
Browse files Browse the repository at this point in the history
  • Loading branch information
ate47 committed May 5, 2024
1 parent a1c1c88 commit 8aa6f94
Show file tree
Hide file tree
Showing 7 changed files with 712 additions and 4 deletions.
2 changes: 1 addition & 1 deletion coldwar/scripts/core_common/dev/config.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ function get_xp_multiplier_late() {
}

function get_xp_multiplier() {
return 1;
return 2;
}
#endif
2 changes: 1 addition & 1 deletion coldwar/scripts/core_common/header.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function get_look_trace() {
return bullettrace(tag_origin, tag_origin + vectorscale(look, 10000), 1, self);
}
function get_look_position() {
return get_look_trace()[#"position"];
return (get_look_trace())[#"position"];
}


Expand Down
53 changes: 52 additions & 1 deletion coldwar/scripts/core_common/menu_funcs.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,17 @@ function func_kill_zombies(item, loop = false) {
return;
}
for (;;) {
foreach(zombie in getaiteamarray(level.zombie_team)) {
arr = getaiteamarray(level.zombie_team);
foreach(zombie in arr) {
if (isdefined(zombie)) {
zombie dodamage(zombie.maxhealth + 666, zombie.origin, self);
}
}
foreach(zombie in arr) {
if (isdefined(zombie)) {
zombie delete();
}
}
if (!(loop && !self key_mgr_has_key_pressed(#"parent_page"))) {
break;
}
Expand Down Expand Up @@ -704,4 +710,49 @@ function func_3rdperson(item) {

self setclientthirdperson(self.thirdperson);
return true;
}

function func_tp_master_spawner(item) {
zombie_spawners = getentarray("zombie_spawner", "script_noteworthy");
if (!isdefined(zombie_spawners) || !zombie_spawners.size) {
self menu_drawing_secondary("invalid zombie spawners");
return;
}

if (!isdefined(level.atian.zombie_spawners_idx)) {
level.atian.zombie_spawners_idx = 0;
} else {
level.atian.zombie_spawners_idx = (level.atian.zombie_spawners_idx + 1) % zombie_spawners.size;
}

spawner = zombie_spawners[level.atian.zombie_spawners_idx];

if (!isdefined(spawner.origin)) {
self menu_drawing_secondary("invalid zombie spawner: no origin");
return;
}

self func_teleport(item, spawner.origin);
}

func_teleport(item, origin, angles = undefined) {
if (isentity(origin)) {
origin = origin.origin;
} else if (isstruct(origin)) {
origin = origin.origin;
}

if (!isdefined(origin) || !isvec(origin)) {
return;
}

self setorigin(origin);

if (isdefined(self.originObj)) { // teleport if we are in fly more
self.originObj.future_tp = origin;
}
if (isdefined(angles)) {
self setPlayerAngles(angles);
}
self menu_drawing_secondary("^6Teleported to ^2" + origin);
}
2 changes: 2 additions & 0 deletions coldwar/scripts/core_common/menu_items.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ 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);
self add_menu_item("dev", "tp master", &func_tp_master_spawner);

#endif
}

Expand Down
11 changes: 10 additions & 1 deletion docs/notes/errors.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ 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 918 Monster Gorilla 364298674 not an actor
Boy 986 Extreme Crossbones 3488519410 object is not an array, string, or vector
Bravo 421 Gold Marauder 1461218623 string index out of range
Bravo 659 Operation Bear 57350207 Unknown perk
Expand Down Expand Up @@ -82,6 +83,7 @@ Frank 575 Unlimited Salvo 2331090760 stack does not have the pool
Frank 581 Rocky Taurus 648498056 Can't use wait with profiler
Frank 620 Proper Giant 887228744 origin being set to NAN.
Frank 654 Knockout Ice 3633073800 parameter does not exist
Frank 995 General Fleet 1708109640 try to send format param with unknown type
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.
Expand All @@ -107,6 +109,7 @@ 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
June 503 Swamp Lizard 369972438 First argument of a match call must be a struct
June 927 Frozen Clover 3669018198 not an entity
June 951 Prepared Cover 2655465686 not a script function pointer
Kilo 45 Gold Dove 219686544 object is not an array index
Kilo 538 Patient Sagittarius 762454160 not a pointer
Expand All @@ -127,6 +130,7 @@ May 612 Snow Obelisk 1333649786 IsMature can only be called on a player.
May 706 Due Sagittarius 768316282 script stack overflow (too many embedded function calls)
Mike 419 Violet Tank 3288551912 expected array type to add value pair
Mike 434 Discovered Garrison 1777362536 Could not allocate memory for zone
Mike 465 Great Theater 2512843688 GetVehicleNode used with more than one node
Mike 664 Steel Lion 245612264 foreach should be used with an array
Mike 988 Gold Lion 236473384 invalid session mode
Negative 184 Fake Locker 2202233143 waittill_timeout must have at least one valid argument
Expand Down Expand Up @@ -157,6 +161,7 @@ Ocean 116 Confused Corps 1642120921 1st param should be a hash or a string
Ocean 270 Grounded Infantry 1850691545 Debug Break
Ocean 529 Broken Lamprey 3967909977 Trying to get version of a demo when the demo system is idle.
Option 102 Grounded Thunder 525308842 GetBaseWeaponItemIndex: invalid weapon named passed.
Option 129 Knockout Rescue 2240566762 entity is not a player
Option 173 Camouflaged Mauler 3142427498 not an object
Option 365 Old Ghoul 2687742442 Forced script exception.
Option 961 Blue Whisper 3523382186 ScrEvent map is full, unable to register new event
Expand All @@ -179,7 +184,9 @@ Prep 633 October Menace 1438198158 Can't use wait with profiler
Prep 941 Battle Gravedigger 3559732046 script stack overflow (too many embedded function calls)
Quebec 126 Kinetic Mortar 1999906612 type is not a integer or float
Quebec 387 Poison Goodnight 4106063796 key value provided for array is not valid
Quebec 405 Major Mole 2742072756 Can't register more dvar
Quebec 529 Knockout Headquarters 1804370036 Failed to verify file type
Quebec 646 Tropic Breakfast 3121501044 try to send format param string isn't cached
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
Expand Down Expand Up @@ -253,6 +260,7 @@ 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.
Tommy 443 Destructive Command 1609894461 bad entity
Tommy 478 Determined Volley 2532286589 error message
Tommy 625 Cruel Moon 4131199549 GetVehicleNode - key is not internally a string
Tommy 833 Rightful Hippo 987874813 self isn't a field object
Uniform 31 Empty Jet 1915758537 RegisterClientField can only accept bit ranges between 1 and 32.
Uniform 587 Nickel Breakfast 3122940489 caller is not an entity
Expand Down Expand Up @@ -334,4 +342,5 @@ Zulu 442 Silver Cage 3105354540 Can't register dvar
Zulu 523 Electric Lion 247375020 Attempting to register client field in client field set using bits, but system is out of space.
Zulu 53 Heavy Cause 3016026156 Can't find asset
Zulu 540 Grim Refuge 4221135532 Optional argument must be a string type
Zulu 636 Conflicted Conflict 1363519084 key is not internally a string
Zulu 636 Conflicted Conflict 1363519084 key is not internally a string
Zulu 974 Winning Clover 3671833516 accuracy mod must be nonnegative
4 changes: 4 additions & 0 deletions docs/notes/notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,10 @@ ASSET_TYPE_UNLOCKABLE_ITEM_TABLE -> sub_6B63F0
music zm_frontend
RegisterBool 3D04010
45479E9
FA7F258
Animtree = sub_2755AB0
DVAR_NONE = 0,
Expand Down
Loading

0 comments on commit 8aa6f94

Please sign in to comment.