Jump to content

Can an enchantment be made from the ground up with scripts?


Recommended Posts

I'm scripting a growth weapon and it will gain an enchantment at later levels. I see there's SetEnchantment in the OBSE functions, but nothing looks like a direct path to making a dynamic enchantment. Does anyone know how to dynamically make and/or adjust enchantments with scripts?

Link to comment
Share on other sites

Sounds very much possible.

A good way would probably be creating an enchantment using the CSE and then using OBSE commands to add/remove effects to this enchantment and/or change their magnitudes.
There's many functions for this under the Magic section of the OBSE commands, with functions like AddFullEffectItem, SetNthEffectItemMagnitude, etc.
https://obse.silverlock.org/obse_command_doc.html

That script would likely need to be always running, I don't think the scripted changes to the enchantment would be saved to the savegame, but the empty enchantment (which the script modifies) itself will be if it is created using the CSE, though it should be possible to create a new dynamic enchantment using OBSE itself, but that just sounds like unnecessary extra work. That you would need to test though, I'm not sure about that.

Edited by mixxa77
Link to comment
Share on other sites

The functions aren't quite named what I thought they'd be, explaining why I only found SetEnchantment and RemoveEnchantment. They also don't appear to be all grouped together conveniently, but you've given me something to Ctrl+F for, which is far better than what I had before.

 

The enchantment modifications not being saved is something I already worked around while modifying the base weapon's stats: I make the stats a function of the weapon's internal level, and set them accordingly on GetGameLoaded and level up.

Edited by VencGanence
Link to comment
Share on other sites

I've gotten around to adding the enchantment code to my script and you were spot on with what's needed.

 

An empty enchantment in the CS, with auto-calc off.

AddFullEffectItem [ench char code] [magnitude:int] [area:int] [duration:int] [0:self | 1:touch | 2:ranged] [enchantmentID]

SetNthEffectItemMagnitude/Area/Duration/Range [int] [enchantmentID] [effect index, starting at 0]

SetEnchantmentCost [int] [enchantmentID]

SetObjectCharge [int] [objectID]

 

This is to hopefully help others googling the same or similar problem.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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