Jump to content

Script question.


Thorham

Recommended Posts

Hi,

 

Does anyone know how to set armor keywords such as ArmorClothing, ClothingRich, etc, from inside a script? I can't find anything in the documentation, except about how to read those keywords. Very frustrating.

 

Is there a way, or is it simply impossible?

Link to comment
Share on other sites

At this time, you cannot change any keyword assignments via papyrus scripting.

That doesn't sound good :(

 

What are you trying to accomplish?

I've made a mod that adds armor pieces to the game that can clone other armors. Example: When you have Clone Armor equipped and then equip Steel Armor, Clone Armor is normally unequipped and now has the properties of Steel Armor. This can be repeated at will. The idea is to get something similar to RPGs where equipped armor doesn't show on the player character.

 

One problem is that if a cloned armor doesn't have, for example, the ArmorHeavy keyword, it won't get the effect from the Juggernaut perk (makes no sense, seeing how there's a weight class property :rolleyes:).

 

I sure hope this can be soved somehow :(

Link to comment
Share on other sites

I'm going keep the questions to myself for right now as I think they answers will only confuse me further. I understand the idea of what you want to do: visually hide armor with something else. I just don't see how you are achieving it.

 

If keywords are your hold up, can you not put ALL armor keywords on your base clone armor and then use scripting to deny certain stats/actions etc depending upon whatever other armor was cloned?

Link to comment
Share on other sites

I understand the idea of what you want to do: visually hide armor with something else. I just don't see how you are achieving it.

The armor I've added has a script assigned to it with an OnUnEquipped event. When that armor is unequipped it checks if anything is equipped in the armor slot, if so, it copies the properties from that newly equipped armor:

 

Scriptname ThorhamsCloneArmor extends ObjectReference

Armor Property clone Auto
int Property slotmask Auto

Armor item

Event OnUnEquipped(Actor akActor)
   If (akActor == Game.GetPlayer())
       item = akActor.GetWornForm(slotmask) as Armor

       if (item)
           akActor.ModActorValue("CarryWeight", -clone.GetWeight())

           clone.SetArmorRating(item.GetArmorRating())
           clone.SetWeightClass(item.GetWeightClass())
           clone.SetWeight(item.GetWeight())
           clone.SetEnchantment(item.GetEnchantment())
           clone.SetName("clone "+item.GetName())
           clone.SetSlotMask(item.GetSlotMask())
           
           akActor.ModActorValue("CarryWeight", item.GetWeight())
       endif

   endif
EndEvent

 

If keywords are your hold up, can you not put ALL armor keywords on your base clone armor and then use scripting to deny certain stats/actions etc depending upon whatever other armor was cloned?

That complicates things. For example, how is an NPC going to react when the cloned armor is a cuirass and clothing at the same time? Or the perks for heavy and light armor. This sure ain't pretty :( Maybe having three versions of the armor pieces (one for each wight class) is a good solution.

Link to comment
Share on other sites

Maybe make use of three different "templates", one for each weight class, and then have your armor automatically switch itself depending on the armor it clones. Same functionality, while keeping the UI and user experience clean.
Link to comment
Share on other sites

Maybe make use of three different "templates", one for each weight class, and then have your armor automatically switch itself depending on the armor it clones. Same functionality, while keeping the UI and user experience clean.

Templates aren't a bad idea, thanks :thumbsup: The only problem that remains is with armors and clothing that have quest related keywords, but that probably doesn't affect a whole lot of items, so that might not be a big issue.

 

Isn't there a way to copy a whole item in one go, similar to what happens when you duplicate an item in the Creation Kit? I tried changing an armor in game, but all the instances of the item are changed as well. It's never easy, is it :rolleyes: You'd almost try remaking the whole game in Unity3D simply to be able to do everything you want :biggrin:

Link to comment
Share on other sites

In TES5Edit you can "Copy as new entry" from any plugin to any plugin. Probably the simplest way of accomplishing this.
Link to comment
Share on other sites

In TES5Edit you can "Copy as new entry" from any plugin to any plugin. Probably the simplest way of accomplishing this.

Of course, but then it won't be a mod anymore ;) The whole point is to be able to do everything from within the game.

Link to comment
Share on other sites

So have templates for each of the armor types. Then have some additional ones for specific quest related stuff. Not sure how many specific quest armors there are. Might be able to get by with one template for each armor type that has all the quest keywords on it and only use it when specific quest armors of that type are equipped.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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