[INC] GHW Spawnlist Generator

For scripting examples for learning how to use AMXX.
User avatar
Archive-Poster
Posts: 1229
Gender:
United States of America

[INC] GHW Spawnlist Generator

Post by Archive-Poster »

  • This script simply fills in a floating point array with random origins for player spawns. The player spawns are all tested to be assured that the spawns are valid (inside of the map). This process takes a while and test results for some maps on my home PC are listed below.
  • This process is meant to be run simply once per map which means whoever uses this script should create a way to save and load the origins.
  • An example of how this script can be used is attached (it is fully functional and requires AMXX 1.8+ (Ham Sandwich)).
  • A test plugin that I used to test the methods and bad spawns is also attached.
  • This can also be used to create random power-up/item/rune/etc. spawn locations (Change min/max size in .inc file)

Code: Select all

/* GHW Spawnlist Generator - v1.0
*
* by GHW_Chronic
*   06/2008 - 08/2008
*
* This file is provided as is (no warranties).
*
*
*
*
*	//This fills in the array (Float:origins[MAX_ORIGINS][3])
*	//Methods: 1=Normal 2=Extensive 3=Exhaustive
*	//num_origins - number of origins to find (Max is MAX_ORIGINS)
*	genspawnlist(method,num_origins)
*
*	//This checks to see if a player is inside the map (Some maps may give broken random spawn points)
*	In_Map(id)
*
*	//This stops the current search
*	save_locations()
*
*
*	Tests (Windows - AMD 64-bit 2.6 Ghz Dual-Core Processor):
*
*	Map		Method		# Found		Time (sec)	# Broken
*	de_dust2	1		27		60		0
*	de_dust2	2		30		93		0
*	de_dust2	3		30		97		0
*	de_train	1		20		60		1
*	de_train	2		30		70		0
*	de_train	3		30		120		0
*	de_nuke	1		30		41		0
*	de_nuke	2		30		65		0
*	de_nuke	3		30		122		0
*
*
*
*/

//Number of origins to find
#define MAX_ORIGINS	30
Methods
  • #1 - Normal - Searches 2,500,000,000 units3 with a 60 second timeout
  • #2 - Extensive - Searches 16,000,000,000 units3 with a 120 second timeout
  • #3 - Exhaustive - Searches 24,000,000,000 units3 with a 300 second timeout
  • Normal works for most maps yet sometimes Extensive can give better results. Exhaustive seems to give the best results however it takes on average 2-3 times longer than Normal.
Attachments
GHW_SLG-cs_assault1.jpg
GHW_SLG-cs_assault1.jpg (26.61 KiB) Viewed 241 times
GHW_SLG-cs_assault2.jpg
GHW_SLG-cs_assault2.jpg (36.58 KiB) Viewed 241 times
GHW_SLG-de_dust2.jpg
GHW_SLG-de_dust2.jpg (52.24 KiB) Viewed 241 times
GHW_spawnlist.zip
(119.7 KiB) Downloaded 34 times

Who is online

Users browsing this forum: No registered users and 0 guests