angryglock Posted March 31, 2015 Share Posted March 31, 2015 I've built a mod that allows +30% damage with Dragonbone Weapons against dragons (including Alduin) and dragon priests. I based the mechanism partially on the Silver Weapon vs Undead system. In case you don't know how silver weapons are handled by the engine it works like this: Silver Weapons all have a simple script attached to them. When you equip it it adds a hidden perk (SilverPerk) that gives weapons with Material Silver a flat +20 pt damage against undead, vampires, etc. The perk has conditions looking for the material type and enemy type. When the weapon is unequipped removes the hidden perk. The way I've done it is I created a hidden perk (DragonbonePerk) with +30% (so it scales) but I'm not going to use a script on the weapon. If I did add a script to every vanilla dragonbone weapon it would result in compatibility problems with tons of mods. So my thought is to simply add the perk to the player full time. I'd let the player find a book or do a quest or something that when adds the hidden perk. That way I don't have to alter any perk trees or weapons and any weapon from any mod that has material dragonbone will get the benefit of the perk. Does anyone know of a problem with this approach of using a permanent perk and not one that is removed and added via an attached script? I wonder about it since Bethesda used a script attached to the weapon to add and remove the perk dynamically. Why go through that trouble when a simple hidden perk added to the player by default or even a non-hidden perk from the perk tree would do? Is there the possibility of some game lag since the perk would be checked against every weapon used to see if its material matches? If that were the case then most perks would be a problem since many have conditions that must be reconciled with every attack. Thanks for any thought you'd care to share. My modding skills are not as honed as many on these boards but I figure if I'm not a great modder I can at least be a careful modder and not break anyone's game with my mistakes. Link to comment Share on other sites More sharing options...
ArronDominion Posted April 1, 2015 Share Posted April 1, 2015 (edited) The way Bethesda does it is very efficient on the end user's machine. All they are doing is running the script when you equip a Silver Sword or un-equip a Silver Sword. With your method, you are required to check and see if the Actor has the following:1) If the Actor does have the perk perform a series of if-elseif-else checks to see if the newly equipped weapon is of the right material (You will need a property for each Dragonbone weapon in the game, and this perk will not work for custom Dragonbone weapons) The perhaps slight performance hit (most players will not experience a performance hit if you run this event OnObjectEquipped and OnObjectUnequipped). In other words, I wouldn't worry about the script performance unless you get reports of lag. Your approach is definitely the compatibility-friendly approach. You can simulate the weapon add and remove perk approach by using the above events within your Player actor script. Edited April 1, 2015 by Arron Dominion Link to comment Share on other sites More sharing options...
angryglock Posted April 1, 2015 Author Share Posted April 1, 2015 Thanks for the help. I may not have explained it well. There is no script. It's just a hidden perk. The perk just looks for "HasKeyword DLC1WeapMaterialDragonbone". So it work with any weapon that has that keyword. I tested it on a a lot of weapons both vanilla and mod added. Testing was easy. I just set it to +1000% and one-shotted a bunch of dragons to make sure the perk was working. Then removed the perk and hit them again for normal damage. I also hit non-dragons for normal damage. The high value setting was faster than checking HP on a NO-AI dragon after a hit and doing the math. Though I did that as well to make sure the correct setting x1.30 dam was working as intended. The only time a script will come into play is when you get the perk initially. I put it on a book for testing but I think a quest reward will be better. Maybe learning a new fighting technique or as a dragon wall type reward at the end of a dungeon. My perk works the same way the SilverPerk works. My only change is I give the perk to the player permanently instead of using an on/off script attached to the weapon like the silver swords have. The more I study it, I don't see any performance issues. Many perks are much more complex in their condition checks. My setting are below. The Target is set to Dragons, Alduin and Dragon Priests. One problem I have is the Dragonbone weapons won't have the flavor text like silver swords do ("Extra damage against undead"). I don't see how Bethesda adds that text to silver swords. Normally the flavor text comes from the MGEF description. But since the SilverPerk is a perk it has no method to add a flavor text to a weapon. It's not a part of the script either. It's a mystery. http://i.imgur.com/zbFiZso.jpg Link to comment Share on other sites More sharing options...
ArronDominion Posted April 2, 2015 Share Posted April 2, 2015 Ahh thanks for clearing it up. Didn't sounds like performance issues would be a concern, and certainly not with the way you are doing it. I decided to look at the actual SilverSword weapon entry and it uses the description field for the flavor text, meaning you would have to edit the Dragonbone weapons if you wanted the description. Link to comment Share on other sites More sharing options...
kryptopyr Posted April 2, 2015 Share Posted April 2, 2015 Simply adding the perk to the player is definitely the better route. A few things worth knowing about the silver swords:1) the vanilla script is actually bugged. If you dual-wield silver swords and unequip one of the two, then the perk will be removed and you won't get the damage bonus for the remaining silver sword. USKP has since edited the script so that it is no longer removed when the player unequips a silver weapon. Essentially, in order to fix the bug caused by the script, they changed it to be a constant perk, just like you're proposing to do.2) USKP also removed the description on the silver weapons. This isn't really a bug, but what happens when you add a description to the weapon record is that it will overwrite any added enchantments. In order to be able to see any enchantments placed on the weapon, you should avoid adding a description. For this reason, and the compatibility issues you mention, I would avoid adding a description to the actual weapons. Why did Bethesda choose to add the script to the weapon rather than just give the player the perk? I suspect that it was done so that any NPCs would also receive the bonus when they equipped a silver weapon. As it is, perks can't be applied to NPCs in this way, but this and several other similar scripts/effects suggest that not everyone at Bethesda was aware of this limitation. Obviously I don't know what the actual reason was, but that's my guess. Link to comment Share on other sites More sharing options...
angryglock Posted April 3, 2015 Author Share Posted April 3, 2015 Thanks, fellows. I have no plans to edit the weapon records. I want no conflicts nor patches needed for such a simple and minor mod.I decided at the start that no weapon edits even if it meant no flavor text. I did not know that USKP removed the description and I just realized I have that as a master in my test bed mod. So mystery solved. Thanks, kryptopyr. I'm glad to know that my approach is sound. Kryptopyr, many of your mods are essential for my game so thanks for your efforts! Next restart I'm going to try out your new race mod and try to reconcile it with EnaiSiaion's mod. Link to comment Share on other sites More sharing options...
Recommended Posts