Jump to content

Add permant perk to player.


ghosu

Recommended Posts

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 by ghosu
Link to comment
Share on other sites

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 by acidzebra
Link to comment
Share on other sites

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

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 by ghosu
Link to comment
Share on other sites

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 by acidzebra
Link to comment
Share on other sites

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 by acidzebra
Link to comment
Share on other sites

  • Recently Browsing   0 members

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