nerdofprey Posted September 4, 2017 Share Posted September 4, 2017 I posted about this a few days ago in the "quick questions, quick answers" thread but no quick answer has materialized... I'm updating a follower mod and I'm trying to add more situational chatter lines, and I'm tearing my hair out trying to set dialogue conditions that don't seem to exist. All I want is for my character to react to nearby things. I'll start with a specific example: I want her to say a line of dialogue if she sees a werewolf. So far I've found conditions functions for:- Her target being a werewolf (GetIsRace, run on target)Problem: An NPC doesn't necessarily "target" any nearby actors with any reliability. In testing, this has not worked at all.- Seeing a specific werewolf (GetLineOfSight, specific reference in a specific cell)Problem: Even if I went through and painstakingly added every existing werewolf reference ID as a possible condition, it wouldn't work on random spawns, mod-added werewolves, or anything else that wasn't already manually placed in the vanilla game world.- X amount of dead werewolves in the cellProblem: I want her to react to ALIVE werewolves! This is not the first stumbling block of this nature I've run into. I tried making random chatter that fires if children are nearby, if bees are nearby... and the list goes on. But the game does not seem to be set up for NPC's to react to the presence of like... categories of things. Almost every condition function is geared toward specific references, and the precious few that go by base ID's just don't seem to align with what I'm trying to do. I'm hoping there's some condition function I've overlooked that does exactly this. Failing that, I'm hoping there is some kind of workaround or "cheat" to accomplish roughly the same thing. I've heard Inigo react to spiders and Vilja react to bandits, so I know something like this is possible... but I think those are set up as combat dialogue? Combat doesn't cover every situation I'd like to explore. Like my character is not likely to enter combat with children... Link to comment Share on other sites More sharing options...
foamyesque Posted September 5, 2017 Share Posted September 5, 2017 The most flexible way to find stuff in Skyrim is with quest aliases, which you can then feed into dialogue conditions. It may mean splitting your dialogue among two or more quests. Link to comment Share on other sites More sharing options...
Tasheni Posted September 5, 2017 Share Posted September 5, 2017 Neither GetLineOfSight or running a condition on target is working for me. Reaction to a specific race or faction is possible if you use GetRace or GetFaction on combat target in the Detections Tab under NormalToAlert or better AlertToCombat. Link to comment Share on other sites More sharing options...
nerdofprey Posted September 5, 2017 Author Share Posted September 5, 2017 The AlertToCombat thing is basically the workaround I'm using for my werewolf dialogue... It does allow NPC's to react to different creatures/races in combat situations, but non-combat has been a real challenge. I'm not afraid of adding quests; this mod already has four of them set up. I'm curious how you would go about using an alias in this way, though. Like if a person/creatuire/object is in the cell, it fills an alias, then the NPC reacts to the alias? That definitely sounds like it could work, but I have limited experience dealing with aliases, and I'm not sure exactly how to set up a quest to make this work. Link to comment Share on other sites More sharing options...
foamyesque Posted September 6, 2017 Share Posted September 6, 2017 The AlertToCombat thing is basically the workaround I'm using for my werewolf dialogue... It does allow NPC's to react to different creatures/races in combat situations, but non-combat has been a real challenge. I'm not afraid of adding quests; this mod already has four of them set up. I'm curious how you would go about using an alias in this way, though. Like if a person/creatuire/object is in the cell, it fills an alias, then the NPC reacts to the alias? That definitely sounds like it could work, but I have limited experience dealing with aliases, and I'm not sure exactly how to set up a quest to make this work. Essentially, search quests work by having an external thing start them when they would be appropriate. You then have some set of aliases (set to optional -- very important!) that have conditions that match what you want to look for, and generally set to look for things within the loaded area (and, optionally, closest to the player). For example, if you wanted to get a collection of ten NPCs within a certain radius of your follower, but who are not your follower, you can define those conditions in their 'match by conditions' box. HasKeyword, GetDistance, GetIsID respectively, and set up ten aliases. If there are less than ten NPCs, the remaining aliases will remain empty. Those quest aliases can then be used in dialogue conditions to further provide appropriate comments if the person in them is a werewolf etc. You'd also likely want to set some kind of cooldown timer through a global variable or similar method so that you don't get ten comments happening all at once. A tricky bit is judging how often to trigger the search quest, since the aliases only get filled on start. Obvious candidates would be in an OnCellLoad, possibly some kind of OnUpdate / RegisterForSingleUpdate chain at a convenient interval, and if you're up for SKSE some stuff with the Sleep/Wait menu and OnMenuOpen/OnMenuClose events to check for waiting or sleeping. Link to comment Share on other sites More sharing options...
nerdofprey Posted September 6, 2017 Author Share Posted September 6, 2017 That is good info, thanks. I feel like there's a lot of interesting stuff that could be done that way, but I'd worry a little about overloading my mod with scripted events. I wonder if it would work to set the quest to activate based on this "invisible tracker" method. It would just need to be applied to my NPC instead of the player, which would be easier anyway. Link to comment Share on other sites More sharing options...
foamyesque Posted September 6, 2017 Share Posted September 6, 2017 (edited) That is good info, thanks. I feel like there's a lot of interesting stuff that could be done that way, but I'd worry a little about overloading my mod with scripted events. I wonder if it would work to set the quest to activate based on this "invisible tracker" method. It would just need to be applied to my NPC instead of the player, which would be easier anyway. You could use OnCellAttach and OnAttachedToCell directly, through a quest alias in another quest (I would suggest whatever quest you're using to manage your follower), if you're using it on the NPC. The tracker method outlined above is a means to figure out when the player changes cells (OnCellLoad won't catch a player changing cells if both cells are loaded. This allegedly can include going through loading doors, though I personally have not seen it happen). It's not needed with ordinary NPCs. As far as overloading with scripted events, well, it's possible, but I have had a search quest that was set to retrigger as soon as it was filled and reported back, which was roughly every eighth of a second, and it operated pretty smoothly. That's far faster than your needs, so you could probably just have it retrigger after, oh, a couple of minutes, say, if nothing else has retriggered it before then, without any worries. Edited September 6, 2017 by foamyesque Link to comment Share on other sites More sharing options...
nerdofprey Posted September 7, 2017 Author Share Posted September 7, 2017 Thanks again, this is good info. I'm a little confused about cell "attachment" but I'm reading up, and hopefully I'll figure it out. This seems like a lot of effort to put in to have a werewolf joke in my mod, but it also seems worthwhile to figure it out because it would be a good base for making a lot of interesting stuff happen. Link to comment Share on other sites More sharing options...
Recommended Posts