Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. How change the zombies spawn points! Help GSC

How change the zombies spawn points! Help GSC

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
2 Posts 2 Posters 350 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined Offline
    undefined Offline
    Erickgames_HD
    wrote on Aug 27, 2021, 5:09 AM last edited by Erickgames_HD Aug 27, 2021, 8:13 AM
    #1

    Does someone know how to add a spawn point for the zombies to spawn in and possibly make all the zombies spawn from these spawn points ONLY (ignore default spawn points) via GSC?

    undefined 1 Reply Last reply Aug 27, 2021, 5:32 AM
    1
    • undefined Offline
      undefined Offline
      JezuzLizard Plutonium Staff
      replied to Erickgames_HD on Aug 27, 2021, 5:32 AM last edited by
      #2

      Erickgames_HD

      I wrote some code to do something similar for adding spawns:

      
      _register_zombie_spawn( spawner_zone, coordinates, angles, location_script_noteworthy )
      {
      	riser_location_struct = spawnStruct();
      	riser_location_struct.script_string = "find_flesh";
      	riser_location_struct.targetname = spawner_zone;
      	riser_location_struct.origin = coordinates;
      	riser_location_struct.angles = angles;
      	riser_location_struct.script_noteworthy = location_script_noteworthy;
      	riser_location_struct.is_blocked = false;
      	size_of_riser_locations = level.struct_class_names[ "targetname" ][ spawner_zone ].size;
      	level.struct_class_names[ "targetname" ][ spawner_zone ][ size_of_riser_locations ] = riser_location_struct;
      }
      
      add_zombie_spawns()
      {
      	if ( level.csrmRoom == "gen5" )
      	{
      		_register_zombie_spawn( "zone_nml_farm_spawners", ( -2880, -384, 160.25 ), ( 0, 45, 0 ), "riser_location" );
      		_register_zombie_spawn( "zone_nml_farm_spawners", ( -2304.13, -492.192, 172.125 ), ( 0, 45, 0 ), "riser_location" );
      	}
      	if ( level.csrmRoom == "showers" )
      	{
      		//level.struct_class_names[ "targetname" ][ "cellblock_shower_spawners" ] = [];
      		_register_zombie_spawn( "spawner_shower", ( 1723.62, 10579.6, 1152.13 ), ( 0, 45, 0 ), "riser_location" );
      	}
      }
      

      Timing is important with this function. You need to allocate the new spawns before the game uses them officially. I recommend using _load.gsc to do so.

      Deleting all the spawns is fairly simple:

      zones = getArrayKeys( level.zones );
      foreach ( zone in zones )
      {
      	if ( isDefined( level.struct_class_names[ "targetname" ][ zone + "_spawners" ] ) )
      	{
      		level.struct_class_names[ "targetname" ][ zone + "_spawners" ] = [];
      	}
      }
      

      This can only be done after the structs have been intialized and after the zones are initialized as well.

      1 Reply Last reply
      1

      2/2

      Aug 27, 2021, 5:32 AM

      • Login

      • Don't have an account? Register

      • Login or register to search.
      1 / 1
      • First post
        2/2
        Last post
      0
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Donate