Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Creating a Perk


KennEH
 Share

Recommended Posts

This is my very first code I've made from my own study on forums and the CK wiki. I'm stuck, pretty sure it something simple that I missed, but my code won't compile at all. Any help at all would be appreciated.

What I'm trying to do is remake the Fists of Steel perk. I want to use the current Heavy Amor rating, as a percent, take that value and from the currently equipped gauntlets and add that to unarmoured combat. For example 30 Heavy Armor on Gauntlets with a rating of 12 armour would produce 3.6 bonus damage. 12 * (30/100) = 3.6


Scriptname FistsOfSteel extends Perk

{Fist of Steel Perk Reamke}


; Heavy Armour for damage boost percentage

int HeAr = Game.GetPlayer().GetActorValue("HeavyArmor") as int


; Obtain the armor rating of the player's currently equipped gauntlets

Armor Gauntlets = Game.GetPlayer().GetWornForm(0x00000008) as Armor

int AR = Gauntlets.GetArmorRating() as int


; Equation to amplify damage

Float Function Boost (int AR, int HeAr) Global

return AR * (HeAr/100)

EndFunction


; Amplify damage

Game.GetPlayer().ModActorValue("UnarmedDamage", +boost)

Edited by KennEH
Link to comment
Share on other sites

So it was a dumb question afer all. I figured since it was a perk thus needing points in it, events were uneeded. Well I got the scrpit to compile but now it does nothing.


Scriptname FistsOfSteel extends Perk  

{Fist of Steel Perk Reamke}


Event Oninit()

; Heavy Armour for damage boost percentage

int HeAr = Game.GetPlayer().GetActorValue("HeavyArmor") as int


; Obtain the armor rating of the player's currently equipped gauntlets

Armor Gauntlets = Game.GetPlayer().GetWornForm(0x00000008) as Armor

int AR = Gauntlets.GetArmorRating() as int

EndEvent


; Equation to amplify damage

int boost

int Function Boost (int AR, int HeAr)

return AR * (HeAr/100)

EndFunction


; Amplify damage

Event OnEquipped(armor Gauntlets)

Game.GetPlayer().ModActorValue("UnarmedDamage", boost)

EndEvent

I'm pretty sure I messed up at the end. Calling gauntlets will refer to the Gaunlets equiped, right? Also I am unsure how to add values with ModActorValue. Putting a "+" before boost created an error.

Link to comment
Share on other sites

Okay so I think I'm getting closer to what I want, but still not working.


Scriptname FistsOfSteel extends Perk  

{Fist of Steel Perk Reamke}


Event Oninit()

    ; Heavy Armour for damage boost percentage

    int HeAr = Game.GetPlayer().GetActorValue("HeavyArmor") as int


    ; Obtain the armor rating of the player currently equipped gauntlets

    Armor Gauntlets = Game.GetPlayer().GetWornForm(0x00000008) as Armor

    int AR = Gauntlets.GetArmorRating() as int


    Float UD = game.getplayer().getav("UnarmedDamage")

EndEvent


; Equation to amplify damage

Float boost

Float Function Boost (int AR, int HeAr, Float UD)

    return AR * (HeAr/100) + UD

EndFunction


; Replaces Unarmed Damage with new value

Event OnObjectEquipped(armor gauntlets)

    if gauntlets as armor

        Game.GetPlayer().ModActorValue("UnarmedDamage", boost)

    endif

EndEvent

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...