Myst42 Posted October 18, 2021 Posted October 18, 2021 Just wanted to ask what people use in their scripts to detect if a follower is a follower. I'm not much of a follower user so I dont really have that many, much less knowing what scripts people have used on them. Is there like a standard thing that triggers when a follower begins/stops following? Like a global variable, or a setting somewhere (that is compatible with follower overhauls) Or anything that could help me monitor/detect a change in the follower's status from NPC sto actual follower? Thanks.
Heroine HoneyCrotch Posted October 18, 2021 Posted October 18, 2021 28 minutes ago, Myst42 said: standard thing that triggers when a follower begins/stops following? current follower faction 0 npc is following current follower faction -1 they stop following typically follower come with that faction along with potential follower faction and npc needs a relationship rank of at least 1.
Seijin8 Posted October 18, 2021 Posted October 18, 2021 49 minutes ago, Heroine HoneyCrotch said: current follower faction 0 npc is following current follower faction -1 they stop following typically follower come with that faction along with potential follower faction and npc needs a relationship rank of at least 1. 1 hour ago, Myst42 said: Just wanted to ask what people use in their scripts to detect if a follower is a follower. If you are scripting, may want to use "IsInFaction()" instead of looking for 0/-1 as there's no guarantee of other follower mods not using different positive integers for their followers. Test it, but I'm fairly certain a (-1) will read as not in faction.
AndrewLRG Posted October 18, 2021 Posted October 18, 2021 As far as I know vanilla Skyrim does not send any events when an NPC becomes a follower. Modmakers usually scan area around player for actors with follower related factions. For example, Chesko's Campfire uses a cloak detection spell that triggers on nearby actors with CurrentHireling Faction, while Deviously Cursed Loot occasionally scans entire cell player is in and checks each actor for CurrentFollowerFaction.
Myst42 Posted October 19, 2021 Author Posted October 19, 2021 2 hours ago, Seijin8 said: If you are scripting, may want to use "IsInFaction()" instead of looking for 0/-1 as there's no guarantee of other follower mods not using different positive integers for their followers. Test it, but I'm fairly certain a (-1) will read as not in faction. Wanted to make it as a monitoring gimmick... I'm hoping a permanent ability perhaps could use an activation condition for IsInFaction() == 1 Has given me good results in the past for things that toggle on and off using the game engine without bothering papyrus... Still will probably have to test as you say. if that doesnt work... then I'm probably back to looping script updates. EDIT: Well what do you know... it think it just works... It was just an initial test but debug function seems to indicate that the given ability does in fact trigger when the NPC becomes a follower, and ends when they stop following. structure is magic effect (script-permanent) then spell has magic effect with condition GetInFaction (CurrentFollower) == 1. All done via CK, of course, the effect can contain all the scripting I want, but the game engine handles the toggling of it. Hope the good results persist.
Myst42 Posted October 19, 2021 Author Posted October 19, 2021 Seizing the thread... One more question in case anybody knows. How does one go about changing NPC outfits? I dont mean just as the follower overhauls that allow to change by dropping them on their inventory, I mean as the outfit ID value on the NPC (ActorBase reference) I found a SetOutfit function on te ActorBase script but I havent tested it yet, and I'm afraid it will probably be bugged or require something extra to see the changes in game, like a cell load or disable/enable or something about refreshing them
Heroine HoneyCrotch Posted October 19, 2021 Posted October 19, 2021 I have used "setoutfit" on naked women, did it through dialogue and it wrks instantly. Not sure what would happen if npc is not naked,
Myst42 Posted October 19, 2021 Author Posted October 19, 2021 4 hours ago, Heroine HoneyCrotch said: I have used "setoutfit" on naked women, did it through dialogue and it wrks instantly. Not sure what would happen if npc is not naked, Yeah, it worked but not at 100 perfection For starters, needed disable/enable to see the changes Also the previous worn outfit didn't disappear from the inventory, it's still there as extra items, so I'm guessing I'll have to do a cleaning function.
Heroine HoneyCrotch Posted October 19, 2021 Posted October 19, 2021 5 hours ago, Myst42 said: , so I'm guessing I'll have to do a cleaning function. oh yeah, This is where I gave up. I had wanted npc nude so i gave them empty outfit but stuff would remain in inventory, which created problems. The setoutfit always worked for me when I used it but I was using on it npcs I had added, and they came nude. Sounds like a fun mod your wrkng on!
Seijin8 Posted October 19, 2021 Posted October 19, 2021 6 hours ago, Myst42 said: Yeah, it worked but not at 100 perfection For starters, needed disable/enable to see the changes Create a "nude" outfit (nothing in it) and set that in between. SetOutfit(NudeOTFT) SetOutfit(NewOTFT) Should deal with it. Been a while but I think the nude outfit also clears the inventory of the old outfit, too. (Might be misremembering)
Myst42 Posted October 20, 2021 Author Posted October 20, 2021 2 hours ago, Heroine HoneyCrotch said: oh yeah, This is where I gave up. I had wanted npc nude so i gave them empty outfit but stuff would remain in inventory, which created problems. The setoutfit always worked for me when I used it but I was using on it npcs I had added, and they came nude. Sounds like a fun mod your wrkng on! Found a way around it as basically, setting new outfit adds a bunch of stuff but the previous outfit pieces remain. So... did a While loop to scan the outfit for pieces and then just used RemoveItem on them. As one removes items from unused outfits, the NPC equips and shows the new outfit. 44 minutes ago, Seijin8 said: Create a "nude" outfit (nothing in it) and set that in between. Didn't got to test this... tried unequipall but then the new putfit wouldn't be equipped either untill something like a cell change. Either way, seems that all is working now, thank you all for your suggestions and thoughts, it was very helpful ?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.