Delzaron Posted April 12, 2016 Posted April 12, 2016 Hi I meet a complex problem. As you know, I begin some little mods. Thye will be DLC of other mods (Madness Mountain for FTD, Witch and Beast for AFS). For madness moutain for example, I need to detect a NPC and some factions... for example, if FTD esp is detected, shul tar become the quest giver, and player receive the insmouth slave faction. If not, somebody else become the quest giver, and player will not receive that faction. Like tis : If "From the Deeps" is detected, questgiver.forcerefto("Shul Tar") Like Simple slavery act for detecting incomes. Thanks in advance.
Guest Posted April 12, 2016 Posted April 12, 2016 You can do that by using some lines of code, and by knowing the IDs of the actors you want. Something like Actor questGiver Actor Property alternateQeustGiver Auto ; "Fill that with an actor that is available" Function ...() if Game.GetModByName("From the Deeps.esp")!=-1 questGiver = Game.getFormFromFile(0xABCDEF, "From the Deeps.esp") as Actor ; "Be sure to have the exact ID (6 Hexa chars) for the actor" else questGiver = alternateQuestGiver endIf EndFunction
Delzaron Posted April 14, 2016 Author Posted April 14, 2016 You can do that by using some lines of code, and by knowing the IDs of the actors you want. Something like Actor questGiver Actor Property alternateQeustGiver Auto ; "Fill that with an actor that is available" Function ...() if Game.GetModByName("From the Deeps.esp")!=-1 questGiver = Game.getFormFromFile(0xABCDEF, "From the Deeps.esp") as Actor ; "Be sure to have the exact ID (6 Hexa chars) for the actor" else questGiver = alternateQuestGiver endIf EndFunction So, I could use the same way for factions ? For example, if I wish to detect AFSForswornFriendFaction or aFTDDagonSlaveFaction ?
WraithSlayer Posted April 14, 2016 Posted April 14, 2016 So, I could use the same way for factions ? For example, if I wish to detect AFSForswornFriendFaction or aFTDDagonSlaveFaction ? Yes, you can extract literally any kind of form with Game.getFormFromFile(), you just have to cast it with as Faction instead of as Actor, and have the questGiver variable be of type Faction. Once you have the faction loaded into a variable, its just a matter of using IsInFaction() on the actor you want to check. You can even extract entire quests with this method, allowing you to get data from or manipulate other mods without any master dependency.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.