Papyrus noob here.
I have an NPC that needs to have its faction ranks updated when a certain quest stage is reached via dialogue. Unfortunately, after scouring Google, the CK wiki and this forum, I remain without a clue. I think that my problem is just not knowing which event to use in the NPC's script, or maybe my entire approach is wrong.
My latest failure is as follows:
Event OnInit() RegisterForSingleUpdate(1.0)EndEventEvent OnUpdate() Bool bUpdate = true If (BobQuest.GetStage() >= 50) Bob.SetFactionRank(PotentialFollowerFaction, 0) Bob.SetFactionRank(CurrentFollowerFaction, 0) Bob.SetFactionRank(PotentialMarriageFaction, 0) Bob.SetRelationshipRank(Game.GetPlayer(), 3) bUpdate = false UnregisterForUpdate() EndIf If bUpdate RegisterForSingleUpdate(1.0) EndIfEndEvent
The listed factions are set to -1 on the NPC, because I don't want the "Follow me" or marriage dialogue available until stage 50 of the quest. I also want the NPC to automatically become a follower at the end of the conversation, without the player having to initiate conversation again, hence (CurrentFollowerFaction, 0). Whether this works, I do not know.
It's all moot for the moment, because I don't know how to tell the actor script to run the above If routine and set the necessary faction ranks. If anyone has an idea, or if I am totally out of the ballpark in my thinking here, I'd appreciate the help.
Thanks.