Creating a patrol

Post » Sat May 28, 2011 12:08 pm

I am makeing a mod that gives you a "Command" Terminal to more or less command an army. How do I make a patrol and them dismiss them? If I use the Enable / Disable commands they won't keep restarting at the start of their patrol they will just reappear at the point at which they were disabled, Right? SO I was wondering. Would a disable work for when I dismissed the patrol and then when I want to "Re - Hire" them I use a, NPCID moveto AREAID, then use the enable command?

Would that work?

Cheers,

Shadowform.
User avatar
Big Homie
 
Posts: 3479
Joined: Sun Sep 16, 2007 3:31 pm

Post » Sat May 28, 2011 7:18 am

Short answer: Yeah, just enabling/disabling might not make them start at the starting point first. ResetAI might fix that...

A patrol path is a bunch of XMarker objects linked together in a chain. When setting up the patrol AI package that works with those, the XMarker reference that you specify as the 'starting point' (by putting it's reference in that dropdown box) will be the one they head to and start using first. If you want them to magically appear when you hire them and start patrolling at the starting XMarker, disable them when you dismiss them. Then when you hire them, move them to that starting XMarker point ( npcREF.MoveTo XmarkerREF 0 0 0 ), then enable them, then call a REF.ResetAI on each one of them... that should make them start the package over like it was new and immediately start at the starting XMarker right in front of them.

If you want to skip enabling/disabling and just have them to travel from wherever they're at and start at the starting point when they each get there, use the terminal script to change the value of a quest variable that you set up, and have that variable value be the condition which enables their patrol package (and disallows their previous package). When they change packages they should head right to the starting point and begin patrolling. Forcing that with a REF.ResetAI after you change the quest variable might be a decent idea, but might not be necessary.
User avatar
Causon-Chambers
 
Posts: 3503
Joined: Sun Oct 15, 2006 11:47 pm


Return to Fallout 3