Byeoh Posted December 11, 2016 Share Posted December 11, 2016 I would like to make an NPC who is stationary with bound hands, and able to be freed, much like a Stormcloak prisoner whom is being escorted by the Imperials. I would also like to make it so that this is only possible during a certain stage of the quest, while also not allowing the player to give items to the NPC, unlike with the Stormcloak prisoner. After freeing the prisoner, I would like them to follower the player, until leaving the dungeon which they were inside, and then once making to the outside of the dungeon, to travel to a certain location on the map and then stay there. I took this script from the WE09 (Wilderness Encounter of the Stormcloak Soldier being escorted by the Imperials) quest, which I have been looking at, thinking about how I would modify it to get it to work, with no progress, as I am a novice to coding and do not know where to start and how to make this work. This is the script: Scriptname WEPrisonerAliasScript extends ReferenceAlias ;This script pops a message box when activating the prisoner;if player frees, adds captors, himself, and prisoner to factions to make people hate each other;You should make sure elsewhere that the captors have aggression high enough to attack their enemies Topic Property WESharedDialoguePrisonerSetFree Auto idle Property OffsetBoundStandingStart Autoidle Property OffsetStop Auto Message Property WEPrisonerMessageBox AutoFaction Property WEPrisonerFreedFaction Auto Faction Property WEPrisonerFreedCombatCaptorFaction AutoFaction Property WEPrisonerFreedCombatPrisonerFaction Auto ReferenceAlias Property Captor1 AutoReferenceAlias Property Captor2 AutoReferenceAlias Property Captor3 AutoReferenceAlias Property Captor4 AutoReferenceAlias Property Captor5 Auto bool bound = True int iDoNothing = 0int iSetFree = 1int iSetFreeShareItems = 2 Event OnLoad()if boundGetActorReference().playIdle(OffsetBoundStandingStart)EndIf EndEvent Event OnActivate(ObjectReference akActionRef) if GetActorReference().IsDead() || GetActorReference().IsinCombat(); debug.trace(self + "OnActivate() IsDead() or IsInCombat() so not showing message box") Elseif Bound == true ; debug.trace(self + "OnActivate() will call show message box") Actor ActorRef = GetActorReference() int result = WEPrisonerMessageBox.show() if result == iDoNothing;debug.Notification("DO NOTHING") elseif result == iSetFree;debug.Notification("SET FREE") FreePrisoner(ActorRef, OpenInventory = False) elseif result == iSetFreeShareItems;debug.Notification("SET FREE SHARE ITEMS") FreePrisoner(ActorRef, OpenInventory = True) EndIf EndIfEndEvent Event OnHit(objectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)if AkAggressor == game.getPlayer()Game.GetPlayer().AddToFaction(WEPrisonerFreedCombatPrisonerFaction)Captor1.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction)Captor2.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction)Captor3.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction)Captor4.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction)Captor5.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction)endifendEvent Function FreePrisoner(Actor ActorRef, bool playerIsLiberator= true, bool OpenInventory = False); debug.trace(self + "FreePrisoner(" + ActorRef + "," + playerIsLiberator + ", " + OpenInventory +")") ActorRef.AddToFaction(WEPrisonerFreedFaction)ActorRef.AddToFaction(WEPrisonerFreedCombatPrisonerFaction)ActorRef.EvaluatePackage()if playerIsLiberatorGame.GetPlayer().AddToFaction(WEPrisonerFreedCombatPrisonerFaction)EndIf if OpenInventoryActorRef.openInventory(True)EndIf ActorRef.Say(WESharedDialoguePrisonerSetFree)bound = False Captor1.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction)Captor2.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction)Captor3.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction)Captor4.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction)Captor5.TryToAddToFaction(WEPrisonerFreedCombatCaptorFaction) ActorRef.EvaluatePackage() EndFunction Function ClearFactions();call when quest shuts down; debug.trace(self + "FreePrisoner") Game.GetPlayer().RemoveFromFaction(WEPrisonerFreedCombatPrisonerFaction) TryToRemoveFromFaction(WEPrisonerFreedCombatCaptorFaction)Captor1.TryToRemoveFromFaction(WEPrisonerFreedCombatCaptorFaction)Captor2.TryToRemoveFromFaction(WEPrisonerFreedCombatCaptorFaction)Captor3.TryToRemoveFromFaction(WEPrisonerFreedCombatCaptorFaction)Captor4.TryToRemoveFromFaction(WEPrisonerFreedCombatCaptorFaction)Captor5.TryToRemoveFromFaction(WEPrisonerFreedCombatCaptorFaction) EndFunction Link to comment Share on other sites More sharing options...
Recommended Posts