How do you make the AI follow an Alias instead of a NPC refe

Post » Tue Jun 19, 2012 6:36 pm

I need to make a follow package so an NPC will follow another NPC. It works if I set the AI to follow the reference, but if that NPC dies, it will respawn as a different reference. So the follow package will no longer work. A solution would be to make the AI package follow an Alias (which exists) instead. However, when I set the TargetToFollow, the Alias option is greyed out. If its greyed out, it must be because its context sensitive. So there must be a way to make it active. Can anyone help
User avatar
yessenia hermosillo
 
Posts: 3545
Joined: Sat Aug 18, 2007 1:31 pm

Post » Tue Jun 19, 2012 2:44 pm

Is your package attached to a quest?
Aliases belong to quests, and to select one, a package must have an "Owner Quest", selectable on top of the Package window. The package will be able to use aliases from that quest (and that quest only).
User avatar
Eileen Müller
 
Posts: 3366
Joined: Fri Apr 13, 2007 9:06 am

Post » Tue Jun 19, 2012 8:15 pm

Is your package attached to a quest?
Aliases belong to quests, and to select one, a package must have an "Owner Quest", selectable on top of the Package window. The package will be able to use aliases from that quest (and that quest only).
Great!!!! Thanks.
User avatar
LuCY sCoTT
 
Posts: 3410
Joined: Sun Feb 04, 2007 8:29 am

Post » Tue Jun 19, 2012 10:38 pm

Is your package attached to a quest? Aliases belong to quests, and to select one, a package must have an "Owner Quest", selectable on top of the Package window. The package will be able to use aliases from that quest (and that quest only).

Came across one snag. The NPC belonging to my quest needs to follow the NPC belonging to another vanilla quest. In game it didn't work and while I was loading the esp in CK, it said it couldn't find it. The CK can find the alias while your using it though. I guess I could make an alias in my quest and point at the same NPC but just keep it empty so the other vanilla quest is unaffected. Would that work without affecting the vanilla quest. Just need a target to follow. EDIT has to be specific reference too
User avatar
neen
 
Posts: 3517
Joined: Sun Nov 26, 2006 1:19 pm

Post » Tue Jun 19, 2012 9:40 pm

Didn't work at all for some reason, even when I have the alias in the same quest. So the vanilla quest alias and the alias in my quest have the same specific reference. I get a complaint from the CK when loading the esp again about the template. So I even made my quest own the template too. No luck. Also noticed the template doesn't have ability to use aliases even when owned by a quest.

MasterFile: Unable to find package Target Ref (000000) on
ownwer object "NPCFOLLOWNPCPackageTemplate
User avatar
Facebook me
 
Posts: 3442
Joined: Wed Nov 08, 2006 8:05 am

Post » Wed Jun 20, 2012 12:11 am

Still stuck :confused:

Is there something I'm doing wrong? Something seems to be blocking access as it odd that the package can "see" the alias, but not the Template. I'm trying two different approaches.

1) Make the AI package (+ template) on the NPC in my quest use the alias in a vanilla quest. Or
2) Make a new alias in my quest point to the NPC (Specific Ref) I trying to follow, and make the AI follow that instead. So that NPC has two alias.

Neither of the above work.

So is there some alternative workaround or a better way to set up an alias in (2).
User avatar
Siobhan Wallis-McRobert
 
Posts: 3449
Joined: Fri Dec 08, 2006 4:09 pm

Post » Tue Jun 19, 2012 9:09 pm

Well, if you don't need to extend with any other functionality, I would make the "Owner Quest" of the package the VANILLA QUEST, that way the AI Package wil lbe able to access that specific NPC alias.
You should then be able to assign the package to your new NPC with no problems (I hope).

Otherwise, if you need your new quest to be the Owner Quest, then you'll need to create a new alias.
You can get a referencealias to basically copy another quest's alias:
Select "External Alias Reference", select the vanilla quest, and the name of the alias in the vanilla quest. You now have a quest alias that directly mirrors a vanilla quest alias.
Also make sure "Allow Reserved" is checked.


Finally, note that aliases are ONLY filled when the quest STARTS. They are not updated afterwards except through direct script commands.
So when you are testing, make sure you are starting a new game!
User avatar
Budgie
 
Posts: 3518
Joined: Sat Oct 14, 2006 2:26 pm

Post » Tue Jun 19, 2012 10:57 pm

Well, if you don't need to extend with any other functionality, I would make the "Owner Quest" of the package the VANILLA QUEST, that way the AI Package will be able to access that specific NPC alias.
You should then be able to assign the package to your new NPC with no problems (I hope).
Tried this,but while the package will detect the aliases, the template remains greyed out - even if it too is owned by either quest. All I need is a target to follow, so both aliases run at the same time.

Otherwise, if you need your new quest to be the Owner Quest, then you'll need to create a new alias.
You can get a referencealias to basically copy another quest's alias:
Select "External Alias Reference", select the vanilla quest, and the name of the alias in the vanilla quest. You now have a quest alias that directly mirrors a vanilla quest alias.
Also make sure "Allow Reserved" is checked.
Tried this too, and again the Template has the same problem, no matter which quest owns it. It stays greyed out. I would have thought the template gets overwritten but its seems this is not always the case. Could it be a bug? The "Allow reserved" is also greyed out when quest enabled is checked.

Finally, note that aliases are ONLY filled when the quest STARTS. They are not updated afterwards except through direct script commands.
So when you are testing, make sure you are starting a new game!

I can't really ask users of this mod to restart their game. They would quickly hit the unsubscribe button. I already lost some when I accidently uploaded a BSA with scripts missing. :blush: Any idea what the script command is? I came across this when the player horse dies and respawns

MySelf = GetActorReference() [Actor property associated with the NPC reference]
Alias_NPCRef.ForceRefTo(MySelf) [ReferenceAlias property associated with the alias to be followed in the vanilla quest]
so I could add an aditional line,
Alias_FollowTargetNPCRef.ForceRefTo(MySelf) [ RefAlias property associated with the alias in my quest]

Although I can't see how that would fix the problem with the AI Template, where the it always remains greyed out regardless of which quest owns it. I think this is the main problem.

The Two NPCs involved is the Whiterun Player horse (stables quest) and another horse in my quest. All I'm trying to do is get my horse to follow the players horse, when neither is being ridden. Sounds elementry on first glance but its not as straight forward as following the player.
User avatar
courtnay
 
Posts: 3412
Joined: Sun Nov 05, 2006 8:49 pm

Post » Tue Jun 19, 2012 11:10 pm

I don't quite understand, I think ...
May I ask why you are creating an AI Package Template?
Couldn't you just use the existing Follow template??
So all you'd need to do is change the target of the follow in your package?
EDIT: It sounds like you are having problems with the package TEMPLATE, not the package itself, and I can't understand why you are making one at all ...


Anyway, with the quests: when you add a new quest in a mod, it will run properly for all your users. However, while you are TESTING and making modifications to the quest, you may need to go back to a clean save (before you added the quest) or started a new game altogether, to see your changes take effect. The problem is that for your testing, you have ALREADY added the quest, and some traces of older versions may remain (such as the aliases not being filled). Users of your mod will not have to deal with older versions of the quest already being present in their saved games. Although you should if possible plan ahead to having to PATCH your new quest later, if there are any bugs.
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Tue Jun 19, 2012 6:07 pm

I don't quite understand, I think ...
May I ask why you are creating an AI Package Template?
Couldn't you just use the existing Follow template??
So all you'd need to do is change the target of the follow in your package?
EDIT: It sounds like you are having problems with the package TEMPLATE, not the package itself, and I can't understand why you are making one at all ...
Even though I set the package "target" to follow the players horse, it didn't work. It was only when I made a copy of the template and made the TargetToFollow public, and changed that from player to the players horse, that it worked. So I'm setting both now.

This was before realising that if the player horse dies, the follow package on the other horse would no longer work due to respawning with a new ID. Cue aliases and further headaches. :blink:

Anyway, with the quests: when you add a new quest in a mod, it will run properly for all your users. However, while you are TESTING and making modifications to the quest, you may need to go back to a clean save (before you added the quest) or started a new game altogether, to see your changes take effect. The problem is that for your testing, you have ALREADY added the quest, and some traces of older versions may remain (such as the aliases not being filled). Users of your mod will not have to deal with older versions of the quest already being present in their saved games. Although you should if possible plan ahead to having to PATCH your new quest later, if there are any bugs.

Ah see what you mean. No, I do have a special unmodded save. I still can't get this alias thing to work, so I'm taking the scripting route. Cipscis said I need to use GetAlias. It's frustrating that the alias settings doesn't work on its own between vanilla quests and mine.
User avatar
phillip crookes
 
Posts: 3420
Joined: Wed Jun 27, 2007 1:39 pm


Return to V - Skyrim