Jump to content

Photo

Writing a custom script

script armor clothing npc follower vilja

  • Please log in to reply
2 replies to this topic

#1
captainsakae

captainsakae

    Stranger

  • Members
  • Pip
  • 4 posts

Hello, long time player, first time poster.

I am attempting to add a script to an NPC I've made that functions similar to the script the Vilja companion has- one that gives you a dialouge option to tell your NPC follower to wear armor or clothing.

That's it. Simple, right? Well, I've spent weeks pouring through the Vilja mod and trying to read through its scripts and have had no luck duplicating the same results. What I've gathered for how it works:

-A new faction is set up that tells if the NPC follower is currently wearing armor (rank 0) or wearing clothing (rank 1)

-talking to the NPC brings up a dialouge option that (if in rank 0) tells the NPC to wear clothing OR (if in rank 1) tells the NPC to wear armor

-this triggers a script that tells the NPC to equip armor or clothing (0 armor rated items), depending on the current rank of the faction. The rank is then switched accordingly after the items have been changed.

 

I've been at this for weeks now, like I've said, with no result. I think I've got most everything laid out correctly in the creation kit (factions, quests, etc) but I can't get the dialouge to trigger, and I think that my script is bogus. Not being any type of a key script writer, I tried to copy the Vilja script... but it seems that that has failed. I would re-write the script myself but all attempts at that have failed as well.

 

So, I come asking for help on how to write this script. Or, I was wondering if it would be easier to set up as a .esp file, something that applies to all followers.

I'm at my wit's end here- help!



#2
VectorPlexus

VectorPlexus

    Old hand

  • Account closed
  • PipPipPip
  • 912 posts

Hello, long time player, first time poster.

I am attempting to add a script to an NPC I've made that functions similar to the script the Vilja companion has- one that gives you a dialouge option to tell your NPC follower to wear armor or clothing.

That's it. Simple, right? Well, I've spent weeks pouring through the Vilja mod and trying to read through its scripts and have had no luck duplicating the same results. What I've gathered for how it works:

-A new faction is set up that tells if the NPC follower is currently wearing armor (rank 0) or wearing clothing (rank 1)

-talking to the NPC brings up a dialouge option that (if in rank 0) tells the NPC to wear clothing OR (if in rank 1) tells the NPC to wear armor

-this triggers a script that tells the NPC to equip armor or clothing (0 armor rated items), depending on the current rank of the faction. The rank is then switched accordingly after the items have been changed.

 

I've been at this for weeks now, like I've said, with no result. I think I've got most everything laid out correctly in the creation kit (factions, quests, etc) but I can't get the dialouge to trigger, and I think that my script is bogus. Not being any type of a key script writer, I tried to copy the Vilja script... but it seems that that has failed. I would re-write the script myself but all attempts at that have failed as well.

 

So, I come asking for help on how to write this script. Or, I was wondering if it would be easier to set up as a .esp file, something that applies to all followers.

I'm at my wit's end here- help!

 

You just need to setup a quest, no need for stages, just check "start game enabled". no need for setting up a faction (unless you want to save that NPC wardrobe of choice), you can use keywords, to check what type of armor is using ("armorclothing" and "armorcuirass"). setup the dialogue options with conditions by using these same keywords. Do remember that mods with dialogue quests need to have a SEQ file in order to show properly (at least in the first save you load after enabling the mod). Also, having a script issue and not showing the script, nor giving any error msg, its like trying to put a thread on a needle with your eyes closed and expecting someone that is blind-folded to give you directions so you can fit it through. Finally, you always need an ESP for scripts to be able to run, could you maybe specify what is your doubt?



#3
captainsakae

captainsakae

    Stranger

  • Members
  • Pip
  • 4 posts

Hello, long time player, first time poster.

I am attempting to add a script to an NPC I've made that functions similar to the script the Vilja companion has- one that gives you a dialouge option to tell your NPC follower to wear armor or clothing.

That's it. Simple, right? Well, I've spent weeks pouring through the Vilja mod and trying to read through its scripts and have had no luck duplicating the same results. What I've gathered for how it works:

-A new faction is set up that tells if the NPC follower is currently wearing armor (rank 0) or wearing clothing (rank 1)

-talking to the NPC brings up a dialouge option that (if in rank 0) tells the NPC to wear clothing OR (if in rank 1) tells the NPC to wear armor

-this triggers a script that tells the NPC to equip armor or clothing (0 armor rated items), depending on the current rank of the faction. The rank is then switched accordingly after the items have been changed.

 

I've been at this for weeks now, like I've said, with no result. I think I've got most everything laid out correctly in the creation kit (factions, quests, etc) but I can't get the dialouge to trigger, and I think that my script is bogus. Not being any type of a key script writer, I tried to copy the Vilja script... but it seems that that has failed. I would re-write the script myself but all attempts at that have failed as well.

 

So, I come asking for help on how to write this script. Or, I was wondering if it would be easier to set up as a .esp file, something that applies to all followers.

I'm at my wit's end here- help!

 

You just need to setup a quest, no need for stages, just check "start game enabled". no need for setting up a faction (unless you want to save that NPC wardrobe of choice), you can use keywords, to check what type of armor is using ("armorclothing" and "armorcuirass"). setup the dialogue options with conditions by using these same keywords. Do remember that mods with dialogue quests need to have a SEQ file in order to show properly (at least in the first save you load after enabling the mod). Also, having a script issue and not showing the script, nor giving any error msg, its like trying to put a thread on a needle with your eyes closed and expecting someone that is blind-folded to give you directions so you can fit it through. Finally, you always need an ESP for scripts to be able to run, could you maybe specify what is your doubt?

Thanks for getting back to me!

...I am gathering that this is all way over my head and I should stop messing around in the creation kit before I break something...

...guess I should take my idea to the "I have an idea for a mod" board and hope for the best.....







Also tagged with one or more of these keywords: script, armor, clothing, npc, follower, vilja

Page loaded in: 1.083 seconds