Creating an new Item

Post » Sun Jun 17, 2012 12:30 pm

I have follow the tutorial on making a item, and save the new item in a esp. I have try using Player.additem but it not working. I am missing something, what do I get this new item?

Thanks, Simon.
User avatar
Alex Vincent
 
Posts: 3514
Joined: Thu Jun 28, 2007 9:31 pm

Post » Sun Jun 17, 2012 7:57 pm

You have to have the correct number, which is partially based off the load order your mod is when loaded into your game. This is a HEX value.

The first two digits are this hex number. Anything in the base game would be 00. First mod would be 01. etc..
User avatar
Blackdrak
 
Posts: 3451
Joined: Thu May 17, 2007 11:40 pm

Post » Sun Jun 17, 2012 5:16 pm

You could give the player your item with a "Start Game Enabled" quest.
Scriptname GiveYourArmorToPlayerQuestScript extends QuestInt iCountArmor Property YourARMO AutoEvent OnInit()        RegisterForUpdate(5)EndEventEvent OnUpdate()        iCount = Game.GetPlayer().GetItemCount(YourARMO)        If iCount; != 0                If (iCount > 1) ; Player somehow has more than one                        iCount -= 1 ; Set iCount to (iCount - 1)                        Game.GetPlayer().RemoveItem(YourARMO, iCount, True) ; Silently remove extras                Else;If (iCount == 1) ; Player has exactly one                        UnregisterForUpdate() ; Stop polling                        Stop() ; If that's all, might as well stop this quest                EndIf        Else;If (iCount == 0)                Game.GetPlayer().AddItem(YourARMO, 1, False) ; Add one with the message shown        EndIfEndEvent
I'm sure it could be done more simply, but more stuff could be added in later should you need to.
User avatar
Josee Leach
 
Posts: 3371
Joined: Tue Dec 26, 2006 10:50 pm

Post » Mon Jun 18, 2012 12:48 am

Thanks, Just needed to change the first two digits :smile:
User avatar
Sylvia Luciani
 
Posts: 3380
Joined: Sun Feb 11, 2007 2:31 am


Return to V - Skyrim