Jump to content
Sign in to follow this  
Kendo 2

[Skyrim] Add an Item at Game Load

Recommended Posts

Here's the script.  As written, this script will add one Iron Cuirass as soon as the game loads.

K2_Add an Item at Game Load Script.txt

To use this:

Create a new quest and in the Quest Data tab check the boxes for Start Game Enable and Run Once.  Click OK and then open the quest again.

Go to the Quest Aliases Tab and right click for 'New Reference Alias'.  Name it Player and at 'Unique Actor' select Player.  Check the box for 'Reserves Reference' and then hit the Enter key on your keyboard.  That will close the tab.  Open the tab again.

In the field for 'Papyrus Scripts' click the 'Add' button and wait for everything to load.  This might take as long as a minute to finish.  Ignore the errors that will pop up, because they will.

Once everything loads you will see a dialogue window.  The first one will be (New Script).  Double click it.  Give it a name you can easily recognize and leave 'ReferenceAlias' alone.  You need that.  Click OK.

Now you should have the empty script listed.  Right click it and 'Open in Exterior Editor'.  Copy and paste the script I included into it and Save and Exit.

Right click the script again but this time go to 'Edit Source'.  Your script should be there.  Click File and Save and let it compile.  You should get no errors and see 'Compilation Completed'.

Click on the script to high-light it and click the 'Properties' button.  Both fields should be filled and the script should look like a blue cross with a yellow pencil next to it.  Remove the check mark next to 'Reserves Reference' you added earlier.  Hit Enter on your key board.  Click OK on the quest to close it.  Save the esp.

IF everything went as planned the vanilla game iron armor should be added to character at game load.  Best of luck to you, since this is modding Skyrim. :S

* replace everything I have in yellow with your own stuff.

____________________________________________________________________________________

;add/equip the player with the item when the mod is loaded.

Armor Property ArmorIronCuirass Auto
Quest Property GiveIronArmorQuest auto

Function TraceMe(string msg)
    Debug.Trace("GiveIronArmorQuest"+ msg)
EndFunction

Function GiveIronArmor()
    TraceMe("GiveIronArmor")
    ObjectReference selfref = self.GetReference()
    if selfref != None
    selfref.AddItem(ArmorIronCuirass, 1, false)
    Game.GetPlayer().EquipItem(ArmorIronCuirass, abSilent = true)
    endIf
EndFunction

Event OnInit()
    RegisterForSingleUpdate(1)    
EndEvent

Event OnUpdate()
    GotoState("Busy")
    GiveIronArmor()
    GotoState("")
EndEvent

State Busy
    Event OnInit()
    EndEvent

    Event OnReset()
    EndEvent

    Event OnPlayerLoadGame()
    EndEvent

    Event OnUpdate()
    EndEvent
EndState

____________________________________________________________________________________

  • Like 2

Share this post


Link to post
Share on other sites

NOTE:  If you don't want the item automatically equipped on the player then place a semicolon in front of the line:

Game.GetPlayer().EquipItem(ArmorIronCuirass, abSilent = true)

Make it look like this:

;Game.GetPlayer().EquipItem(ArmorIronCuirass, abSilent = true)

^_^

Share this post


Link to post
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.

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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By endgameaddiction
      This thread is designed to ask if a mod you are looking for already exists somewhere on the web.
       
    • By Doublezero
      Naughty Red Riding Hood 2 is a Havok enhanced clothing mod based on (you guessed it) Red Riding Hood.
      Special note: The hood uses Havok physics and may clip through the body. This is a work in progress. If this becomes an issue for you let me know and I'll upload a version without Havok.
      How to obtain:
      After you activated the mod and loaded your save file, save and reload and it should automatically be added to your inventory. This will only happen once.
      The clothing should be added to your inventory on load. You can also obtain the clothing with the console command "help NRRH2 0". Requirements:
          BodySlide / Outfit Studio - https://www.nexusmods.com/skyrim/mods/49015
          HDT HighHeels System  - http://www.nexusmods.com/skyrim/mods/36213/
          SKSE - https://skse.silverlock.org/
      Credits:
       Halofarm - for Pinup Poser. (The poses I use in the images) Besthesda - The maker of Skyrim and the Creation Kit Caliente  - The maker of BodySlide & Outfit Studio. Skyrim Script Extender Team  - The makers of SKSE. Kendo 2 - Add an Item at Game Load script.  
      Permissions:
      You're free to use this mod your own project. No need to ask me for permission. Have fun!
    • By Doublezero
      View File UUNP Naughty Red Riding Hood 2 (Havok Enhanced)
      Naughty Red Riding Hood 2 is a Havok enhanced clothing mod based on (you guessed it) Red Riding Hood.
      Special note: The hood uses Havok physics and may clip through the body. This is a work in progress. If this becomes an issue for you let me know and I'll upload a version without Havok.
      How to obtain:
      After you activated the mod and loaded your save file, save and reload and it should automatically be added to your inventory. This will only happen once.
      The clothing should be added to your inventory on load. You can also obtain the clothing with the console command "help NRRH2 0". Requirements:
          BodySlide / Outfit Studio - https://www.nexusmods.com/skyrim/mods/49015
          HDT HighHeels System  - http://www.nexusmods.com/skyrim/mods/36213/
          SKSE - https://skse.silverlock.org/
      Credits:
       Halofarm - for Pinup Poser. (The poses I use in the images) Besthesda - The maker of Skyrim and the Creation Kit Caliente  - The maker of BodySlide & Outfit Studio. Skyrim Script Extender Team  - The makers of SKSE. Kendo 2 - Add an Item at Game Load script.  
      Permissions:
      You're free to use this mod your own project. No need to ask me for permission. Have fun!
      Submitter Doublezero Submitted 04/30/2019 Category Clothing  
×
×
  • Create New...