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 376 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Erickgames_HDundefined Offline
    Erickgames_HDundefined Offline
    Erickgames_HD
    wrote on last edited by Erickgames_HD
    #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?

    JezuzLizardundefined 1 Reply Last reply
    1
    • Erickgames_HDundefined Erickgames_HD

      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?

      JezuzLizardundefined Offline
      JezuzLizardundefined Offline
      JezuzLizard
      Plutonium Staff
      wrote on 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
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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