Jump to content

A supposedly simple (only a few lines) script isn't working.


Prismuth

Recommended Posts

I want the circlet to boost some skill rates a bit, the cuirass to resist magic a bit, the gauntlets to raise the power of healing, and the greaves... less sure about them. I want them to remain enchantable though. Put on circlet, get raised skill gain rate, take off, it goes back to normal.

Edited by Prismuth
Link to comment
Share on other sites

No luck still... u.u

 

I did try to look at mods that do similar things (not exact effects, just do stuff without enchantments), but one of them had a script I couldn't actually seem to look at, and the other does it with a quest somehow, and that seemed difficult to figure out and convert to.

Edited by Prismuth
Link to comment
Share on other sites

Do you want this to work for NPC's too or just the player? If it's just the player, one thing you can do is instead of attaching the script to the equipment, attach it to the player instead, then use an OnObjectEquipped event to check for the items being equipped. If they get equipped, apply the perk, etc.

 

It's a little more complex if you want it to work for NPC's too. You can either attach it directly to the NPC (could cause compatibility issues with other mods that edit the same NPCs) or you can make a cloak effect that adds the perk to NPCs, which would check if those items are equipped, etc.

Link to comment
Share on other sites

You don't really need a script on every piece of equipment. You can give the perk to the player a lot of ways. Once the player has the perk, it's a matter of conditions.

 

If you are using a unique form ID, then you can just use the GetEquipped condition. Should work for the three effects that you have described.

 

The perk should have three entries:

 

1st entry: Modify Skill Use

Condition: GetEquipped YourCircletFormID == 1

2nd entry: Mod Spell Magnitude

Condition on the Subject tab: GetEquipped YourGauntletFormID == 1

Condition on the Spell tab: epMagic_SpellHasKeyword MagicRestoreHealth == 1

 

3rd entry: An ability with the AbResistMagic magic effect set to the magnitude of your preference

Condition: GetEquipped YourCuirassFormID == 1

Link to comment
Share on other sites

With the getequipped, can I set it so it will respond to any one of 10-12 things? Since the armor comes in lots of colors. Are spells needed with this method?

 

And it looked like my friend tried GetEquipped and it didn't work properly. "Okay, as a test, I made a perk where one perk entry is +1000 armor rating when the keyword I made for the breastplate is activated, and another entry in the same perk for +666 armor rating that activates with GetEquipped tied to the circlet. When I equip the breastplate first, the circlet has the +1000 and the +666 and the other pieces have the +1000, and when I equip the circlet first, everything else gets the +666 bonus."

Edited by Prismuth
Link to comment
Share on other sites

If you are using multiple form IDs then you can give those pieces a keyword and use WornHasKeyword instead.

 

e.g. give all circlets the keyword SuperFastTrainingCirclet and use the condition WornHasKeyword SuperFastTrainingCirclet == 1

 

I don't really understand that part of legolas181's post. GetEquipped definitely works.

Edited by lofgren
Link to comment
Share on other sites

The problem I seemed to have was with the script staying active for more than just the intended piece. Say I have the effect set to activate from equipping the circlet, equipping other armor pieces would work as normal before equipping the circlet, but once the circlet's effect was activated, any other armor piece equipped to different slots while the circlet was equipped would also gain the effect. It's like they were somehow trying to run the script, and since the GetEquipped condition was true for as long as the circlet was equipped, it would stack the effect onto arm, chest, and leg armor that was equipped too.

 

OukaHosokawa, I did attempt an OnObjectEquipped event in the script for triggering the perk that corresponds to each armor piece, but I couldn't figure out how the CK wanted the syntax to be. Could you post a sample of how that would look?

Edited by legolas181
Link to comment
Share on other sites

  • Recently Browsing   0 members

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