TimBob12 Posted May 16, 2011 Author Posted May 16, 2011 That's how I thought it should work but I never got round to test it. I have the script ready I just need to test it which I'll do tomorrow as its getting late and I have an exam tomorrow. I will also test hararks method if I get round to it
newbiemodder Posted May 17, 2011 Posted May 17, 2011 This is my script #include "populate" void main() { Populate(15, 8, 121, -10, 103, "522_man1"); Populate(15, 8, 121, -10, 103, "522_man2"); Populate(15, 8, 121, -10, 103, "522_man3"); Populate(15, 8, 121, -10, 103, "522_fem1"); Populate(15, 8, 121, -10, 103, "522_fem2"); Populate(15, 8, 121, -10, 103, "522_fem3"); } Doesn't work. I even changed the coords above to a much smaller area and no go Seems to compile fine....beginning to think that this some crazy glitch that sometimes happens when modding. Edit, I used the debugging technique from the tutorials and the script is being read onenter...so...
harark1 Posted May 17, 2011 Posted May 17, 2011 No idea but this populate function does seem to have a few glitches. I've noticed something but i wasn't sure if it was my doing until today. It seems not to obey the number of each charcter put in, i put 3 of a charcter that has an ithorian model in the script, in game I counted 5 ithorians and only one charcter type has the ithorian model. Little confused but its timbob's scripting hopefully he knows.
harark1 Posted May 19, 2011 Posted May 19, 2011 Timbob we have a probelm!!!! Using the same script I posted earlier, note I had not changed it, suddenly this happened
JebusJM Posted May 20, 2011 Posted May 20, 2011 Just to clarify, you didn't put multiple copies of the script in the Override did you?
harark1 Posted May 20, 2011 Posted May 20, 2011 Uh, hmm good question that is a stupid thing I would do. Let me check. Edit: nope just once.
TimBob12 Posted May 21, 2011 Author Posted May 21, 2011 I will be frankly honest... I haven't a clue why this is happening. Harak1 can you open up populate.nss in your overide and PM Me what it says please so I can make a few checks. Thanks.
TimBob12 Posted June 14, 2011 Author Posted June 14, 2011 Hasn't but in theory it should work with no problems although some users have experienced problems that only some people seem to get. It works for like 80% of people. I just haven't had the time to confirm for K1. Should work fine though.
harIII Posted June 16, 2011 Posted June 16, 2011 OMG, why haven't I seen this!?! Timbob to put it clearly YOU ARE A GOD!!! Instant download
Nick Vader Posted June 17, 2011 Posted June 17, 2011 TimBob my characters seem to be spawning at random numbers, and I can't tell why! I used this script as my OnEnter script: #include "populate" void main() { Populate( 3, -62, -26, -80, -76, "gmember"); Populate( 3, -62, -26, -80, -76, "gmember2"); Populate( 3, -62, -26, -80, -76, "gmember3"); ActionStartConversation(GetFirstPC(),"guardtalk"); //this line has nothing to do with your script, by the way... }
harark1 Posted June 17, 2011 Posted June 17, 2011 What do you mean by random numbers? Random numbers of charcters?
UltimateHK47 Posted December 4, 2011 Posted December 4, 2011 //Feel free to use this script in any mod //Feel free to modify this script but please ask me before / if you distribute it. #include "k_inc_generic" #include "k_inc_utility" #include "populate" int RandomInt(int iMax=1, int iMin=0) //Created by bead-v. Thank You { int Malo = iMin; if(iMin>iMax) Malo=iMax; int iRandom = Malo + Random(abs(iMax-iMin)); return iRandom; } void Populate(int Amount, int xMin, int xMax, int yMin, int yMax, string Tag) { int AutoInc = 0; while(AutoInc<Amount) { AutoInc++; int x = RandomInt(xMax, xMin); int y = RandomInt(yMax, yMin); float z = 0.0; int Orient = Random(360); float x1 = IntToFloat(x); float y1 = IntToFloat(y); float Orient1 = IntToFloat(Orient); object NPC = CreateObject(OBJECT_TYPE_CREATURE, Tag, Location(Vector(x1,y1,z), Orient1)); } } //Created by TimBob12 I really dont get it. So where do i replace my coordinates, xmin, ymin ect. Do i replace those with my coordinates. And for amount do i put the amount of people i want to spawn and copy it over amount? Where else do i have to put numbers im lost but i need this or ill be mapping nearly 100 people!!!!!!!
darth-ackbar Posted January 7, 2012 Posted January 7, 2012 I've tried doing this with multiple populate lines: Populate(5, 6, 9, 12, 15, Tag1); Populate(7, 5, 12, 14, 19, Tag2); And put the script in the OnEnter function. Whenever I try to use it, the game crashes. I'm guessing that this is due to the amount of processing power it uses, so is there a better way to do this?
Fallen Guardian Posted October 6, 2012 Posted October 6, 2012 I tried using the populate function without success... but, looking at the populate.nss script, I figured out why. I was using an Obsidian UTC, which meant that the tag and template were different. So, when I specified the UTC's tag instead of its template the creature would never spawn, because the CreateObject function used within populate.nss' code requires the template of a creature to spawn it. So the example was a bit misleading, but, still an excellent function.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.