Random Items


Ok, so they arn't quite random, but truely random items means you could end up with a level where there a many many chain guns and no bullets. (extreme but possible)

What this tut allows is for a file with a few items in it (plain text file) to be loaded into a level. There is not an editor for these files, use notepad (or vi if ou want to :). The config file has the same name as the map its for, with the extension .rif (i.e. base1.bsp has the file base1.rif). Take a look at the item placement tutorial for a list of items you can have placed. Theres a example file at the bottom. All of the config files (with the extension .rif) have to be in a directory "config" within your mod directory.

This is using a fair amount of code from both eLiTe's and WarZones tuts (assimilation #2 for WarZone and the item placement for eLiTe's ) Thanks guys, you made my life so much easier.


This is a really easy one to add. Add the file randspawn.c to your project/makefile.

add #include "randspawn.h" to the top of g_spawn.c

add the code below to the end of SpawnEntities in g_spawn.c, just after the line PlayerTrail_Init ();

	if (load_random_items())
		gi.dprintf("Random items Loaded :) \n");

Create a directory called "config" within your mod directory. Make a few rif files (the description was given at the top, if you don't understand it, look at the example file below)


Thats it. You're done. Happy?. Get fragging :)


Resources


Back to the tutorial page
Mail me


  Hosted Site