Jump to content

How would I go about scripting this NPC behavior?


Recommended Posts

Hello nexus forum. I'm currently working on a companion mod that has some rather unusual requirements for the companion NPC, and I'm not sure how I'd go about getting them to work, or even if some of them are possible.

 

The first thing I need to do is have the companion initiate a conversation when they are in the player's party and are carrying a specific item at a specific time of day at an interval based on the lunar phase. Not sure if that last part would require OBSE, but it's almost certainly possible, considering what Curse of Hircine accomplished.

 

After that, I need the companion to leave the player's company in a way that makes them very difficult to follow, but doesn't do anything that would cause their inventory to be lost. Currently I'm looking into making this companion Share and Recruit based, since Share and Recruit uses an item tag to designate a party member NPC, which dismisses them when removed.

 

The last thing I'm hoping to get from the behavior set is to make the NPC return to a meeting spot specified by the player (from a list of places, not arbitrarily determined).

 

If anyone with experience in this kind of stuff would care to explain how to do these things or suggest alternatives if they aren't possible, I'd be very grateful.

Link to comment
Share on other sites

You can use conditions to get the effects you need.

 

1. Give the companion a Find package targeted on the player with the necessary conditions: If they're following the player (Probably a quest variable you have somewhere), if they have the item (GetItemCount), and the time (Use the schedule section for this).

 

2. What do you mean? If you can't disable them, use MoveTo to an inaccessible cell.

 

3. Use a choice dialogue to give the player the choices. Each answer should set a quest variable to a different number. Then give the NPC a package for each with a condition that checks if the quest variable is at its corresponding number. For example, if the player chooses the second option, the Arcane University, then the variable should be set to 2, then the package that checks for it being 2 will run, making the NPC go to the location.

Link to comment
Share on other sites

You can use conditions to get the effects you need.

 

1. Give the companion a Find package targeted on the player with the necessary conditions: If they're following the player (Probably a quest variable you have somewhere), if they have the item (GetItemCount), and the time (Use the schedule section for this).

 

2. What do you mean? If you can't disable them, use MoveTo to an inaccessible cell.

 

3. Use a choice dialogue to give the player the choices. Each answer should set a quest variable to a different number. Then give the NPC a package for each with a condition that checks if the quest variable is at its corresponding number. For example, if the player chooses the second option, the Arcane University, then the variable should be set to 2, then the package that checks for it being 2 will run, making the NPC go to the location.

 

1: Ah, I see. Of course, I'd want to have the NPC dismissed and travel to the new cell even if they weren't following the player. I imagine I'd just skip straight to a move to package, without them having to find the player, right?

 

On 2: well, since the NPC might be share and recruit based, removing the Share and Recruit marker item would essentially dismiss them, and it's definitely possible to remove the tag via a conversation, if my understanding of the mod's readme and Oblivion in general is correct. They would then probably use an invisibility spell (like lucien lachance I imagine) , and be disabled (that wouldn't reset an NPC's inventory to the state it spawns in, correct?) or travel to an inaccessible cell as you said.

 

3: Ah, I see, tyvm.

Link to comment
Share on other sites

So can you just give them a condition to see if they have the marker and the quest is at the right point? If so, make the package tell them to leave. Then once they're in a cell not the same as the player, disable them or something similar (Maybe a trigger box if this is in a specific location). Make sure not to disable them straight from dialogue, it causes problems as I found.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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