Jump to content

"Waiting" followers


Recommended Posts

I've recently come back to playing Morrowind after several years. I'm using a lot of old mods that I still have from back in the day in order to play with extra companions/followers. In particular I'm using a couple of mods that allow me to "recruit" virtually any random NPC and get them to follow me. I'm not much of a modder, but my understanding is that when "recruited" such NPCs are simply set to AIFollow; and then when asked to "wait" somewhere, they are then set to AIWander (usually AIWander 0 0 0: ensuring the NPC remains in the very spot he is left in).

 

Now, here's the thing... all those years ago, I distinctly remember being able to order such NPC followers to wait somewhere and basically act as guards. I remember because I was using Hlormaren as my base back then, and spent a considerable amount of time painstakingly positioning dozens of these pseudo "guards" to hold various stations around the stronghold. If I then became engaged in combat in the vicinity, my "waiting" NPC followers would jump to my defence, and once the enemy was defeated they would return to their positions where I had initially made them wait (by the entrances, at the foot of the stairs, manning the walls etc).

 

My frustration now is: I just don't recall how I got them to act that way! They don't anymore. I'm pretty sure I'm playing with the same mods that I used to, but "waiting" followers don't care if I'm being attacked. They don't engage in combat. They just stand where they were told to wait. They will only fight if ordered to follow again. And of course once ordered to follow, they wont return to where they were previously ordered to wait.

 

I might have edited a mod/script all those years ago, and/or used console commands. But it's been so long, I can't for the life of me remember exactly. I've been searching the internet for days now, trying to find a mod, or even just some information to point me in the right direction on what to edit. But no luck. I'm at my wits end since I know it's possible to get these random, non-guard class NPCs to still defend the player character even when "waiting". I just don't remember how lol.

 

There might be an easy answer to this, but as I said, I'm not much of a modder. I'm hoping someone more knowledgable might be able to weigh in with some information. Many thanks.

Link to comment
Share on other sites

I'd try something like this:
open the in game console, type
TDT
this should toggle debug text so you can see player coordinates.
put player in the spot near the NPC where you want the npc to stay, then take note of player X, Y, Z coordinates
now click the NPC so you can see the NPC id on console header, then type (replace X Y Z with proper coordinates)
aiescort player 0 X Y Z
in theory the NPC should defend player when attacked

(type TDT again when done)

Edited by abot
Link to comment
Share on other sites

Thanks for the reply. Unfortunately that doesn't seem to work. The NPC will proceed to the location (and only if you follow it there), but then will not fight for you afterwards. A "GetCurrentAIPackage" command on the NPC once it arrives at the desired location returns -1. So the NPC leaves AIEscort mode once it reaches the coordinates apparently.

 

Incidentally, I was looking through scripts of various mods in hopes of stirring something from my memory, and I came across this from the "Vampire Embrace" mod:

begin emb_combattargethit
	; Called from a sticky combat script when hit and we have verified it really
	; is the players target.
	; This can only get called once per player strike so is completely MODAL and safe
	; It gets called when the players swish ends so theres a safe time gap befor it could
	; be called again.

	short state
	float timer
	if ( state == 1 )
		set state to 2
		aiwander 0 0 0 0								; prevent them from getting weapon out again to protect you by being in aifollow. Musnt be on the same frame as the previous aifollow
		; The stopcombat must be done on different frame from the previous aifollow for the aifollow to prevent them from walking back to position
		stopcombat										; put their weapon away as it gets in the way when close to them
		equip emb_reequip_weapon				;
		removeitem emb_reequip_weapon 1		;
		playgroup idle 1								;
		set timer to 0
	endif
	if ( state == 2 )
		set timer to ( timer + getsecondspassed )
		if ( timer < 0.5 )			; give it time to put the weapons away befor emb_theembrace does any playgroups
			return
		endif
		set emb_infotheembrace to 4
		startscript emb_theembrace
		set state to 0
		stopscript emb_combattargethit
		return
	endif


	if ( gethealth > 0 )				; may not need this test but i do it anyway
		if ( getfatigue < 10 )						; punched out person
			disableplayercontrols					; Stop the player ruining my stopcombat attempts. Enabled in emb_theembrace or later
			modcurrentfatigue 1000					; Make sure they arnt unconcious or animations cause a problem
			if ( getspell emb_mem_genericnpc == 0 )		; dont change hello on generics
				sethello 0									; So they dont say an annoying hello when i stop the combat and start to drink. Its safe to do here and emb_theembrace/emb_theconversion also set it to 0
			endif
			; dont use stopcombat first as it makes them walk back to where they were
			aifollow player 0 0 0 0					; This halts the combat without them walking back
			set state to 1								;	Also ensures MCA compatibility for victims but that wasnt why i put it here
			return
;		elseif ( gethealth < 10 )					; JAMMED also allow weapons as a dangerous way to weaken them enough to embrace them
;			set emb_infotheembrace to 4
;			startscript emb_theembrace
		endif
	endif

Could be wrong, but the modder's notes here seem to imply that his NPCs were behaving in the way that I want them to behave? In particular after setting the AIWander 0 0 0 0 he notes "; The stopcombat must be done on different frame from the previous aifollow for the aifollow to prevent them from walking back to position". In this case however, for this particular mod, the behaviour was unwanted and thus prevented. Like I mentioned, I'm not a modder, so most of the script goes over my head. But perhaps it holds the answer for someone who understands it? Or I might just be misreading it.

Edited by zeldasen
Link to comment
Share on other sites

I'd try
AiEscort player 0 0 0 0

then, that could be not stopped as already done when the NPC is near his original starting coordinates. It may work from the console, but ideally it should be added to the NPC AI packages from the NPC AI form in the construction set.

aifollow is not something you want IMO, they will follow you with it

Edited by abot
Link to comment
Share on other sites

Thanks, but AiEscort is really not what I'm looking for. I want the NPC to stay in one place and then return to that same place even after being drawn away from it during combat. It's true that AiEscort 0 0 0 0 will make an NPC fight for the player, but the NPC will not stay in one place. AiEscort makes NPCs move away if the player comes near them.

 

As for using the construction set: I can actually achieve the behaviour I want by adding an AiFollow package under an AiWander package. Doing this makes NPCs fight for you but not follow you, so they will remain in one place and after any combat will return to wherever they were initially waiting. But as I said, I'm trying to get newly acquired followers to be able to do this, so I would need to do it either through dialogue options or console commands in-game (not the CS).

 

Anyway, thanks again for the reply. I guess my search continues.

Link to comment
Share on other sites

Why not from the CS? if you can enter a command from the console, most of the times you can use it in a script. Some commands behave a bit differently in console, but you should be able to use most of AI commands. If you already know what console commands work for you, try using them from a script.
You can start a global targeted script from the dialog result, it will have as implicit target the NPC you are talking to. You can find more details on targeted global scripts in Morrowind Scripting For Dummies 9

Edited by abot
Link to comment
Share on other sites

The method I mentioned is not a command, it's just adding a second AiPackage to an NPC in the CS (so that the NPC has two AiPackages: AiWander first and AiFollow second). Is it possible to do this via scripting? Morrowind Scripting For Dummies does not appear to address this.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...