youbetterwork Posted October 10, 2016 Share Posted October 10, 2016 I thought this would be easy... but no. I want to change a skill when I equip a weapon. http://i.imgur.com/BCqI6m2.jpg Scriptname da08buck extends ObjectReference Event OnEquipped(Actor akActor)If (akActor == Game.GetPlayer())Game.GetPlayer().ModActorValue("TwoHanded", 10.0)EndIfEndEventEvent OnUnequipped(Actor akActor)If (akActor == Game.GetPlayer())Game.GetPlayer().ModActorValue("TwoHanded", -10.0)EndIfEndEvent Doesn't work :( Link to comment Share on other sites More sharing options...
FrankFamily Posted October 10, 2016 Share Posted October 10, 2016 That script should work, do akActor.ModActorvalue... instead of calling getplayer() again. Or just remove the check completely, no problem with boosting an npc's skill.But you can just add a passive fortify ability and save a headache. Use a similar script to what you have but add/remove spell functions.If the enchantment is unique, add it though the equip ability on any of its magic effects, scriptless. Link to comment Share on other sites More sharing options...
youbetterwork Posted October 10, 2016 Author Share Posted October 10, 2016 (edited) It works! Thanks! Also, if I put it in "magic effects" you can see it under the magic applied to character tab. Edited October 10, 2016 by youbetterwork Link to comment Share on other sites More sharing options...
Johnnyb22 Posted October 11, 2016 Share Posted October 11, 2016 (edited) Greetings... I would like to give my thanks to the user "youbetterwork" that helped me to understand a bit better scripting. But it seems that I wasn't able to produce the same results as you guys. Although I add the exact same script as mentioned in the 1st post with the exact same method (aka: add a script to the Ebony Blade itself as show in pic) can't seem for the script to working ingame although the compiler actually worked...!!! I am beginning to think that something else is causing the issue... Since I started a fresh/clean mod just for the testing if that... Which I only add that script and nothing else. I will try again today afternoon by deleting everything and start from scratch.. Until then do you have any kind of idea what might be wrong here?! Ideas. A variable or different syntax method that will affect Ebony blade only. I have noticed here ("http://www.creationkit.com/index.php?title=Actor_Value") that a Value called Variable02 actually has something to do with Ebony blade.. I just mentioned that just in case has something to do with it. Other than that... Is there any other way to produce the same result but in different ways?! Like an active magic effect upon equipping (only) the Ebony blade or perhaps an enchantment that I will create (or already exist) that I can add in the sword?! What I did so far in the vanilla enchantment of the Ebony Blade is to increase slightly the Health Absorb enchantment per level of the kills that mephala wants and using the same principle I add stamina absorb too. Plus I made the sword non hostile to npc. So now am looking to add some points in the Two Handed skill line, and a Silence (no magic can be cast on target) effect for X amount of seconds.... Probably both needs scripting in which I am a total noob to it. Edited October 11, 2016 by Johnnyb22 Link to comment Share on other sites More sharing options...
FrankFamily Posted October 11, 2016 Share Posted October 11, 2016 A variable or different syntax method that will affect Ebony blade only all the above stuff is about boosting a skill while a specific weapon is equiped, how more ebony blade specific can it be exactly? Variable02 the fact that is has something to do doesn't mean much, i wouldn't tear my laptop's monitor apart to fix the tv even if one has something to do with the other. Like an active magic effect upon equipping (only) the Ebony blade read what i proposed in my comment, achievable in two ways, one scriptless. but even the op's script is meant to mimic a similar behaviour. silence effect you could do a massive magicka debuff Link to comment Share on other sites More sharing options...
Johnnyb22 Posted October 11, 2016 Share Posted October 11, 2016 (edited) @FrankFamily At first... Thanks for your reply. I see what you mean, though I can't understand the fact why with the same procedure the script doesn't even work to my game... I mean ok I am more than a noob to scripting but I just copy paste the damn thing.... So I can't understand what went wrong... The way your proposed for the scriptless method, although I tried to add the effect in the enchantment it didn't showed up.. I even created a unique one and still didn't showed up so I can add it to the enchantment effect... As far as for the scripting method its a bit difficult for me to understand scripting I guess... Though It seems logical when I read it I can't understand the syntax... For example Instead of thisEvent OnEquipped(Actor akActor)If (akActor == Game.GetPlayer())Game.GetPlayer().AddMagicEffect("TwoHanded", 10.0)EndIfEndEvent Will that work for example?? Or....... Event OnEquipped(Actor akActor)If (akActor == Game.GetPlayer())Game.GetPlayer().AddSpell("nameofspell")EndIfEndEvent Etc etc... :) Ps. Sorry to be a bugger x) Edited October 11, 2016 by Johnnyb22 Link to comment Share on other sites More sharing options...
FrankFamily Posted October 11, 2016 Share Posted October 11, 2016 To a passive effect running on self instead of target (fortify a skill of the wearer of the weapon) you can't add it through the weapon's enchantment directly since those run on the target receiving the hit. So, to add it you make an ability (spell) and link it on the equip ability slot (which is on the bottom of the magic effect window) of any of the unique offensive magic effects of the weapon's enchantment, that's why i meant with "add it though the equip ability on any of its magic effects" but it wasn't very explicative. What that does is that when the object holding the magic effect (though it's enchantment, even if it's offensive) is equipped it adds the ability, and removes it when unequipped. Addmagiceffect doesn't exist as a function, check here: http://www.creationkit.com/index.php?title=Category:Papyrus i'd recommend going through the beginner tutorials on the top-left of the page i linked to know the basics of how papyrus works, for example spells (any form basically) aren't referenced as "nameofspell" (in the op's script "twohanded" is a string which is the first parameter of the modactorvalue function, different thing) but instead making a property and linking it to the spell in ck, it's all in the tutorials. This one is also good: http://www.cipscis.com/skyrim/tutorials/beginners.aspx Link to comment Share on other sites More sharing options...
Recommended Posts