Jump to content

Need simple scripting help!


BloodrageEngage

Recommended Posts

Hi, I am semi new to making mods and very new to scripting. I have a weapon mod I am working on and need to add three hidden perks I have made to a weapon on equip and remove them on un-equip.

I was going to use the SilverSwordScript as a template, but need a little clarification.

 

 

 

Scriptname SilverSwordScript extends ObjectReference

Perk Property SilverPerk auto
Event OnEquipped(Actor akActor)
akActor.AddPerk(SilverPerk)
EndEvent
Event OnUnEquipped(Actor akActor)
akActor.RemovePerk(SilverPerk)
EndEvent

 

So I would assume I need to do something like this for this part.

 

Event OnEquipped(Actor akActor)
akActor.AddPerk(Perk1)
akActor.AddPerk(Perk2)
akActor.AddPerk(Perk3)
EndEvent
Event OnUnEquipped(Actor akActor)
akActor.RemovePerk(Perk1)
akActor.RemovePerk(Perk2)
akActor.RemovePerk(Perk3)

EndEvent

 

 

 

"Scriptname SilverSwordScript" would obviously be changed to the name of my script. What I am unsure about is the "Perk Property SilverPerk auto." What does that do and would I just do something like this?

 

 

 

Perk Property Perk1 auto

Perk Property Perk2 auto

Perk Property Perk3 auto

 

 

 

Or would I need to do separate scripts? Or just simply combine the perks into one perk? *shrugs*

 

Any help would be greatly appreciated, and sorry if my post format is weird, I dont use forums too much and didnt want to muck up my post with lines of script. :smile:

Link to comment
Share on other sites

The perk property is entered into the script when you open up the 'properties' section of a script, it allows you to set a type such as 'Perk' or 'Spell' and give it a name which will be what appears in your script, which you can use to call on those objects. So if you add a property to your script, a perk, and call it "perk 1' it'll appear as Perk Property Perk1 auto then open up the properties window again and click on that property, hit 'edit value' and it'll give you a drop down of all the perks in the game, find yours and select it, hit ok. So whenever you want to manipulate that perk in your script, just use the name "perk1". Hope this helped a bit, I am a novice scripter so not the best source of info, I suggest checking out the tutes here or the CK wiki (though that can be somewhat vague)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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