ghosu Posted November 11, 2012 Share Posted November 11, 2012 (edited) Hello I've run into a problem since i'm no big CK buff...with my Flintlock Rifle Mod. When the player equips a rifle with bayonet the game shall add a bleeding dmg effect to the weapon.I copied the Perk from the Targe of the Blooded, condition changed to getequipped WEAPONNAME. Now i want to add it to the player...in my last version i simply added the perk to the player form's spell list, but if someone else uses my mod the game seems to overwrite the user's player form with mine, changes body, race and whatever...so the game no simply adds my spell list edit (added the perk) but saves all settings from my whole form. Now i'm trying to add a script like the SilverPerk directly to my weapon...not working yet, any ideas?Or other method to add the perk to the player when he equips a rifle with bayonet?I mean it could be a permanent perk that only works when condition (geteqipped weaponXXX) is fullfilled but i need a way to add the perk to the player. greetings Edited November 11, 2012 by ghosu Link to comment Share on other sites More sharing options...
acidzebra Posted November 11, 2012 Share Posted November 11, 2012 (edited) i simply added the perk to the player form's spell list, I think you were on the right track with the blooded perk, but it's actually the shield (dunTargeOfTheBloodedShield) which gets tested by the perk getequipped armor test and you shouldn't have modified the player, I think. Or at least not directly - add a script to the weapon with an OnEquip event block stating Game.GetPlayer().AddPerk(YourPerk), perhaps?(and a corresponding OnUnequip event block with removeperk) I know the above works because I've done it before with magical equipment. I'm still trying to figure out how it works for that blooded shield. The NPC has the spell in her spell list, where does it get transferred to the player.... hmmm.... Something like this as a script on your rifle maybe Scriptname RifleBlooded extends ObjectReference Perk Property RifleBloodPerk Auto Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() Game.GetPlayer().AddPerk(RifleBloodPerk ) endIf endEvent Event OnUnEquipped(Actor akActor) if akActor == Game.GetPlayer() Game.GetPlayer().RemovePerk(RifleBloodPerk ) endIf endEvent Ha ha, better have Steve validate it :P (this checks specifically if the player equips it, if you want it for everyone remove the ifs) Edited November 11, 2012 by acidzebra Link to comment Share on other sites More sharing options...
ghosu Posted November 11, 2012 Author Share Posted November 11, 2012 Jeah i copied dunTargeOfTheBloodedPerk and changed the condition to activate it from the shield to my rifle...that wasn't the problem, perk worked. The question is, how to add it to the player...as you say, modifying the player form is no good idea :D Link to comment Share on other sites More sharing options...
ghosu Posted November 11, 2012 Author Share Posted November 11, 2012 Well ok thx...i've never used/added/edited a script before so it might take a while until i get this working...report back later :D Link to comment Share on other sites More sharing options...
acidzebra Posted November 11, 2012 Share Posted November 11, 2012 I sent you a PM with basic instructions. If we could get some of the more experienced scripters to tell us if this is sound code (I know it compiles) that would be nice... Link to comment Share on other sites More sharing options...
ghosu Posted November 11, 2012 Author Share Posted November 11, 2012 (edited) Jeah thx, this is what i've got so far...and the perk itself is just the perk from the bloodedtarge - without any conditions in it, just the link to the effect. http://666kb.com/i/c8w8i10ryoxg9d3qb.jpg http://666kb.com/i/c8w8k7k3srofi065f.jpg But somehow it's not working...yet :D Edited November 11, 2012 by ghosu Link to comment Share on other sites More sharing options...
acidzebra Posted November 11, 2012 Share Posted November 11, 2012 (edited) Can you add 2 lines of debug.notification("perk added") directly below the addperk line and debug.notification("perk removed") directly below the removeperk line so we know the script is firing properly on equip and unequip? Edited November 11, 2012 by acidzebra Link to comment Share on other sites More sharing options...
ghosu Posted November 11, 2012 Author Share Posted November 11, 2012 (edited) Did so but i get no msg ingame when i equip/unequip http://666kb.com/i/c8w8r2wxagkjhpjqb.jpg Edited November 11, 2012 by ghosu Link to comment Share on other sites More sharing options...
acidzebra Posted November 11, 2012 Share Posted November 11, 2012 (edited) s***, forgot to point it at the rifle. Scriptname riflescript extends ObjectReference Perk Property RifleBloodPerk Auto Weapon property Rifle Auto Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() Game.GetPlayer().AddPerk(RifleBloodPerk ) endIf endEvent Event OnUnEquipped(Actor akActor) if akActor == Game.GetPlayer() Game.GetPlayer().RemovePerk(RifleBloodPerk ) endIf endEvent See that weapon property line I added? Like before where you linked the script perk property to the actual perk, link the weapon property to the actual weapon. I have used a similar script on a teleport ring successfully, but that used "armor property" instead of "weapon property". I'm assuming it will work the same though. edit: no wait, I only used that property to unequip the teleportring after the jump. Edited November 11, 2012 by acidzebra Link to comment Share on other sites More sharing options...
ghosu Posted November 11, 2012 Author Share Posted November 11, 2012 Hm...still not working. http://666kb.com/i/c8w96bjtsowbwjuhv.jpg Script vs Ghosu - 10:0 :D Link to comment Share on other sites More sharing options...
Recommended Posts