soaren Posted November 1, 2010 Share Posted November 1, 2010 1. As stated in the title: I am making a custom class. There are many instances of this class in my mod. How can I make them all have different faces (better yet, how can I make the computer randomize them for me)? 2. Also, my town is going to be attacked by waves of raiders, I want all the noncombatants (townspeople) to run into the tents, how would I go about doing that? 3. I have two guards standing guard on both sides of a doorway, how can I make it so they don't all immediately begin talking to the other guard, and stare straight in front of themselves? Extra Credit: How can I make waves of enemy spawns? Something like every 15 seconds or after the previous spawn is killed, another one is spawned for a specified time? Your help is greatly appreciated. If my mod ever makes it to the nexus, I will have a readme included with the mod with the names of all the people on the forums who helped me. Thanks Soaren Link to comment Share on other sites More sharing options...
Tubal Posted November 1, 2010 Share Posted November 1, 2010 1) What you do is you create a number of NPC's with different faces/races/genders, put them in a leveled list, and use that list as a template on other NPC's. Look at how regular raiders/gangers are constructed.Here is an example of how I've done it. Putting the NPC's in an ESM was necessary in Fo3 to avoid mismatched head/body skinstones, but I haven't actually checked if it still is for NV. 2) + extra credit, You're going to need some way of controlling the attack. A quest script is the most obvious method. There are many many ways of going about it however, so it's hard to give general tips. Other than "learn scripting" of course. :)Is the number of attacks finite, or do you want them to go on forever? The first is much easier to solve if you're unused to scripting. The other isn't terribly hard, but requires a bit more knowledge and planning. 3) There might possibly be a flag for conversations when you make AI packages. I know there is one for "No head tracking". Experiment. Link to comment Share on other sites More sharing options...
soaren Posted November 2, 2010 Author Share Posted November 2, 2010 1. Just made seperate instances with different faces. Avoids all that scripting. 2. Figured that out by screwing around with packages. 3. Still can't solve this one. Could use a few script pointers for my extra credit question: float timer = 5.0 // 5 mins? is time represented in script in minutes or milliseconds? while ( timer > 0.0 ) // This is what i need help with. How do I tell the game to spawn an enemy every 15 seconds or so? And what would I use as a marker for where // the enemy is suppost to spawn? // Would I use an xmarkerheading with a script attatched? if ( timer == 0 )end script // whatever the script end syntax is, I don't know off the top of my head, could probably look it up. ============================== This is the bottleneck in my mod. Anyone that can help me finish this basic script will have my gratitude. Can't really continue without this. Thanks Soaren aka Devlin Link to comment Share on other sites More sharing options...
Tubal Posted November 3, 2010 Share Posted November 3, 2010 I did a test mod once where I had two sides rushing at each other constantly with a very easy implementation. Every creature had a script attached with an onDeath block. The onDeath contained just an instruction to spawn a new identical actor at a named xmarker, MarkForDeletion, and Disable, in that order (disable ends the script so it has to be last). The creatures packages only told them to Travel to the opposing sides xmarker.They'd meet in the middle and I could check what happened.The MarkForDeletion ensured that my save wasn't filled with disabled creatures. Timers are often set up with GetSecondsPassed. I'm at work, and the web filter blocks the GECK wiki, so you'll have to find it yourself. :) float timer begin gamemode if timer < 5 set timer to timer + GetSecondsPassed else ;5 seconds have passed, do something special set timer to 0 endif end You could put the spawning of new actors in a quest script, and just spawn enemies at one or several xmarkers every X seconds. Link to comment Share on other sites More sharing options...
soaren Posted November 3, 2010 Author Share Posted November 3, 2010 Ace, thanks a lot. =) I did see the GECK wiki on timers, unfortunately it said nothing about how to set spawns on the timer, or even what to use to mark where the spawns.... spawn. Link to comment Share on other sites More sharing options...
Tubal Posted November 6, 2010 Share Posted November 6, 2010 I changed my example to the one found on the wiki, since I remembered its function slightly wrong. :) The wiki is mostly a reference site (although it has some examples), so you'll have to figure out yourself how to make things work the way you want. They can't have examples for everything after all.I used to check vanilla scripts if there was something I could borrow before I got used to it. Link to comment Share on other sites More sharing options...
Recommended Posts