View Full Version : Populate Function

04-02-2011, 04:18 PM
Discussion Thread - http://www.lucasforums.com/showthread.php?t=207029
Populate Function


Available from same download link

This Populate function allows you to get four co-ordinates and randomly spawn any number of NPCs. It was designed to ease the process of creating modules. All information is included in the README.

This saves you having to create individual entries in the .git file. I think this should save a lot of time in Total Conversion Mods as people do not have to spend a lot of time populating areas. A few versions of this function spawning different NPCs and its done.

The screenshots are from SOTE posted with permission from HarIII

Thank you to everyone that helped but especially:

Darth Insidious
Varsity Puppet

Installation and Use

You need to place the "populate.nss" script in your K2 Override. (This will probably work with K1 but I cannot confirm that). To use the function add the line

#include "populate"

at the beginning of your script.

Then you will need to lay an imaginary square over the area where you want to spawn in. Then find the co-ordinates of the four corners using D3's Whereami armband. Write down what you get and work out the smallest X value and the largest X Value and then do the same with the Y Co-ordinates. Then include this in the main function of your script.

Populate(Amount, xMin, xMax, yMin, yMax, Tag);

Amount = The number of NPCs of the specified tag to spawn.
xMin = The smallest X value
xMax = The largest X Value
yMin = The smallest Y Value
yMax = The largest Y Value
Tag = The tag of the NPC you want to spawn.






Download Link - http://deadlystream.com/forum/files/file/45-populate-function/