Jump to content

Complex Scripting for a newbie..


lucius111

Recommended Posts

I'm throwing around the idea of a mod that replaces the guards in towns with another set, similar to how the civil war quests will change it depending on how who what town. How complicated would a script be, wherein the player completes a quest, say to kill something, puts down 50k gold, and the guards in the town selected at the start of the quest are replaced? Would anyone be willing to help me with this?
Link to comment
Share on other sites

If you want all the guards belonging to the same ActorBase change the outfit, use this: SetOutfit. Theonly problem is that the outfit will be changed the next time the guards are loaded.

 

If you only want some particular NPCs to change armor, you can use a combo of EquipItem and UnequipItem or UnEquipItemSlot.

 

Everything would be trigger by a quest stage.

 

Would I be able to trigger an NPC swap or a race change to a unique race? Guards only. I'm not that good with scripting, barely any experience. XD

Link to comment
Share on other sites

If you want all the guards belonging to the same ActorBase change the outfit, use this: SetOutfit. Theonly problem is that the outfit will be changed the next time the guards are loaded.

 

If you only want some particular NPCs to change armor, you can use a combo of EquipItem and UnequipItem or UnEquipItemSlot.

 

Everything would be trigger by a quest stage.

 

Just having a quick look at the quest scripts, you should be able to switch outfits instantly, otherwise changing back from being a werewold wouldn't be possible:

 

C03RampageQuest.psc:

 

    ; put Aela back to normal
;     Debug.Trace("C03 Rampage: Setting race " + NordRace + " on " + Aela.GetActorReference())
   Aela.GetActorReference().SetRace(NordRace)
   AelaLycanStash.RemoveAllItems(Aela.GetActorReference())
   Aela.GetActorReference().SetOutfit(AelaOutfit)

 

Edit:

 

A snippet from CWMission04Script.psc:

 

function PrisonerGearUp(Actor Prisoner)
;CALLED by CWMission04PrisonerGearUp PACKAGE's On End result script

; 	CWScript.Log("CWMission04Script", "PrisonerGearUp( " + Prisoner + ")")

;	debug.MessageBox(Prisoner + " is gearing up")

Prisoner.SetFactionRank(CWMission04PrisonerFreedFaction, 1)

if Prisoner.IsInFaction(CWs.CWImperialFaction)
	Prisoner.SetOutfit(CWMission04OutfitImperial)
	Prisoner.AddItem(CWs.CWSoldierImperialGear)
Else
	Prisoner.SetOutfit(CWMission04OutfitSons)
	Prisoner.AddItem(CWs.CWSoldierSonsGear)
EndIf

followState = 1

prisoner.EvaluatePackage()

EndFunction

 

Edit: another script, "defaultAliaschangeOutfit.psc" will make the alias change outfit when he leaves or enteres a location.

Edited by steve40
Link to comment
Share on other sites

Yeah, I'm finding that the wiki is riddled with errors, and there are a lot of myths going around about what works and what doesn't. Some of the stuff is obsolete as bugs get fixed. I've also had to update some of their script examples as they had errors, poor logic or were not very streamlined.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...