Skevitj Posted May 16, 2010 Share Posted May 16, 2010 This idea is inspired by mods like Arcane Infusion, which makes it so your weapon's on-hit enchantment changes effects to match your current spell. The idea is to actively split the enchantment based on the spell effect range and weapon type. In english: An example is that with a sword equipped, the touch parts of the current player spell are placed on the weapon, and removed from the player spell, then after this, the remaining target parts are switched to touch (you aren't going to be casting target when you're hitting them, well thats the idea). So a spell consisting of weakness to fire on touch and fire damage on target will result in your sword having the weakness to fire enchant on hit and the player pressing cast will cast the fire damage on touch. For a staff, the touch effects are moved to the staff and changed to target, while the remaining target effects in the spell are left as target. (same reasoning as for touch -> sword). So the same spell as before will result on the staff casting weakness to fire on target and the player casting fire damage on target. The benefits of an enchantment like this is it allows a single spell to have dual purpose; giving a changeable enchant, while not rendering the player's spellcasting redundant, short of rapidly switching spells. Implementation problems like the change in magicka cost and dealing with the switch of a spell or weapon (the original spell is regenerated on a switch, while the weapon is left empty) are easy enough to solve, in theory at least. I'm far from a scripting genius, but i've had some success with implementing a toned down version of this idea (1 touch effect and 1 target effect, no safety checks or contingency). I managed to achieve this using 2 dummy enchants and a script on the weapon of interest. One enchant contained a dummy hostile effect, the other a non-hostile one. (Where's the setenchanthostile function? come on obse, people use staves for more than killing things, unless setspellhostile works for staff enchants?) The main thing stopping me from finishing it is the time I have available, and my ability to diagnose and fix the millions of CTD bugs that come from the lack of safety checks I put into the code (the biggest problem is switching your spell while the previous spell has active effects running, ensuring the correct hostility settings is another implementation annoyance). If someone could pick this up and run with it, iou1. If no-one does though, keep posting ideas and coding sugestions and in a few weeks I should have the time to code this up properly. The main point I want this mod to work around is the use of a script on the weapon of interest. Arcane Infusion uses a quest to manage the enchant, no script on the weapon, allowing for the enchant to be placed on multiple weapons (1 at a time only). I believe however that the quest method can't be made extendible, it will work for one weapon at a time, but not more. Using a script on the weapon, it can be made to work for all weapons and wielders, using the cloneform and setscript commands. I am aware that setscript is considered a beta function, but even assuming setscript is removed, it leaves us in no worse a position than Arcane Infusion with regards to the number of possible enchants running simultaneously. Link to comment Share on other sites More sharing options...
Dracula420 Posted May 17, 2010 Share Posted May 17, 2010 Have you tried Conduit Magic? it works a little like what you want and might be a good place to start. it lets you enchant on the fly and switch the enchantment on the weapon any time. Link to comment Share on other sites More sharing options...
Skevitj Posted May 17, 2010 Author Share Posted May 17, 2010 Have you tried Conduit Magic? it works a little like what you want and might be a good place to start. it lets you enchant on the fly and switch the enchantment on the weapon any time. The idea is pretty much spot on, but I'm already using those mods for a base. Some of the scripting in my quick-made version actually came from that mod. The reason I posted this idea was to get some additional coding ideas on the best way to expand those mods to actively decompose and regenerate spells, but mostly how to properly do the needed error checking (there's a truck load of ctd bugs in all of the mods like this). AI and Conduit just use the whole of the spell (AI dynamically changes it with the players spell, which is what I am aiming for, hence why Conduit didn't get a mention in the opening post), I was after using the touch parts for enchanting, while the target parts are used for casting. Haven't decided what to do with self effects, but as noted in the Conduit readme, oblivion wasn't made to handle self effects like that, so it's probably better to just temporarily remove them. Sorry if you spent your time looking for mods for me (apreciated though), but this wasn't a mod hunt, it's an (coding) ideas hunt. This just seemed like the most appropriate thread to post it under. EDIT: +1 Dracula... Damn i'ts good to be posting on a forum where the resonses are prompt, and more importantly not filled with mindless rambling, maybey i've been looking in the wrong places, but there's way too few of them arouond these days. Link to comment Share on other sites More sharing options...
Recommended Posts