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...

Barber in Skyrim. Need help to complete de script


Gorgotem
 Share

Recommended Posts

I want to create a barbers wild in Skyrim that allow the player to change between a few beard options without the need of oppenning the race menu. Y had all the code for the menú options, that will include 9 different tipe of beards, 2 new items, 1 new NPC and a new wild. Please, I need help to find witch script can allow me to change the facial hair of the player. I left here the unfinished script. Thanks for helping!

Scriptname hairstylescript extends ObjectReference  
{script de prueba}

Message Property Hairstylemenu1 Auto
Message Property Hairstylemenu2 Auto
Message Property Hairstylemenu3 Auto
Message Property Hairstylemenu4 Auto
 

Event OnActivate(ObjectReference akActionRef)
    Game.DisablePlayerControls(False, False, False, False, False, True)
    Game.EnablePlayerControls(False, False, False, False, False, True)
    Menu()
EndEvent

Function Menu(Bool abMenu = True, Int aiButton = 0)
    While abMenu
        If aiButton != -1
        aiButton = Hairstylemenu1.Show()
        abMenu = False
        If aiButton == 0
                aiButton = Hairstylemenu2.Show()
                If aiButton == 0
                ElseIf aiButton == 1
                ElseIf aiButton == 2
                ElseIf aiButton == 3
                ElseIf aiButton == 4
                EndIf
            ElseIf aiButton == 1
                aiButton = Hairstylemenu3.Show()
                If aiButton == 0
                ElseIf aiButton == 1
                ElseIf aiButton == 2
                EndIf
            ElseIf aiButton == 2
                aiButton = Hairstylemenu4.Show()
                If aiButton == 0
                ElseIf aiButton == 1
                ElseIf aiButton == 2
                EndIf
            EndIf
        EndIf
    EndWhile
EndFunction

Link to comment
Share on other sites

I keep working on it and I develop these

Scriptname hairstylescript extends ObjectReference  
{script de prueba}

Message Property Hairstylemenu1 Auto
Message Property Hairstylemenu2 Auto
Message Property Hairstylemenu3 Auto
Message Property Hairstylemenu4 Auto
Message Property Hairstylemessage1 Auto
Message Property Hairstylemessage2 Auto
FormList Property Beardlist Auto
ActorBase  Property Player Auto


Event OnActivate(ObjectReference akActionRef)
    Game.DisablePlayerControls(False, False, False, False, False, True)
    Game.EnablePlayerControls(False, False, False, False, False, True)
        Menu()
EndEvent

Function Menu(Bool abMenu = True, Int aiButton = 0)
        While abMenu
        If aiButton != -1
        aiButton = Hairstylemenu1.Show()
        abMenu = False
        If aiButton == 0

        ElseIf aiButton == 1
            Player.SetNthHeadPart(Beardlist.GetAt(1), 6)
                ElseIf aiButton == 2
            aiButton = Hairstylemenu2.Show()
                If aiButton == 0

                ElseIf aiButton == 1
                    Player.SetNthHeadPart(BeardList.GetAt(2) as HeadPart, 6)
                ElseIf aiButton == 2
                    Player.SetNthHeadPart(BeardList.GetAt(4) as HeadPart, 6)
                ElseIf aiButton == 3
                    Player.SetNthHeadPart(BeardList.GetAt(31) as HeadPart, 6)
                ElseIf aiButton == 4
                    Player.SetNthHeadPart(BeardList.GetAt(32) as HeadPart, 6)
                EndIf
            ElseIf aiButton == 3
                aiButton = Hairstylemenu3.Show()
                If aiButton == 0

                ElseIf aiButton == 1
                    Player.SetNthHeadPart(BeardList.GetAt(6) as HeadPart, 6)
                ElseIf aiButton == 2
                    Player.SetNthHeadPart(BeardList.GetAt(33) as HeadPart, 6)
                EndIf
            ElseIf aiButton == 4
                aiButton = Hairstylemenu4.Show()
                If aiButton == 0

                ElseIf aiButton == 1
                    Player.SetNthHeadPart(BeardList.GetAt(41) as HeadPart, 6)
                ElseIf aiButton == 2
                    Player.SetNthHeadPart(BeardList.GetAt(42) as HeadPart, 6)
                EndIf
            EndIf
        EndIf
    EndWhile
EndFunction

In theory this will do what i want to, but i dosn't compile and give me these errors

C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\hairstylescript.psc(28,10): SetNthHeadPart is not a function or does not exist
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\hairstylescript.psc(34,46): cannot convert to unknown type headpart
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\hairstylescript.psc(34,46): cannot cast a form to a headpart, types are incompatible

I'd tried to resolve it, but i can't yet (keet working)

This is the page in creation kit wiki that explais the "unexisting" function 

http://www.creationkit.com/SetNthHeadPart_-_ActorBase

If anyone can help, y thank it a lot :)

Link to comment
Share on other sites

  • 2 weeks later...

New Advances, Now I reduce the current compilation errors to one: SetNthHeadPart is not a Function or does not exist

 

New Script:

Scriptname hairstylescript extends Actor
{script de prueba}

Message Property Hairstylemenu1 Auto
Message Property Hairstylemenu2 Auto
Message Property Hairstylemenu3 Auto
Message Property Hairstylemenu4 Auto
Message Property Hairstylemessage1 Auto
Message Property Hairstylemessage2 Auto
FormList Property Beardlist Auto
ActorBase  Property Player Auto

Import Game


Event OnActivate(ObjectReference akActionRef)
    Game.DisablePlayerControls(False, False, False, False, False, True)
    Game.EnablePlayerControls(False, False, False, False, False, True)
        Menu()
EndEvent

Function Menu(Bool abMenu = True, Int aiButton = 0)
        While abMenu
        If aiButton != -1
        aiButton = Hairstylemenu1.Show()
        abMenu = False
        If aiButton == 0

        ElseIf aiButton == 1
            Game.GetPlayer().SetNthHeadPart(Beardlist.GetAt(1), 4)
                ElseIf aiButton == 2
            aiButton = Hairstylemenu2.Show()
                If aiButton == 0

                ElseIf aiButton == 1
                    Game.GetPlayer().SetNthHeadPart(BeardList.GetAt(2) as HeadPart, 4)
                ElseIf aiButton == 2
                    Game.GetPlayer().SetNthHeadPart(BeardList.GetAt(4) as HeadPart, 4)
                ElseIf aiButton == 3
                    Game.GetPlayer().SetNthHeadPart(BeardList.GetAt(31) as HeadPart, 4)
                ElseIf aiButton == 4
                    Game.GetPlayer().SetNthHeadPart(BeardList.GetAt(32) as HeadPart, 4)
                EndIf
            ElseIf aiButton == 3
                aiButton = Hairstylemenu3.Show()
                If aiButton == 0

                ElseIf aiButton == 1
                    Game.GetPlayer().SetNthHeadPart(BeardList.GetAt(6) as HeadPart, 4)
                ElseIf aiButton == 2
                    Game.GetPlayer().SetNthHeadPart(BeardList.GetAt(33) as HeadPart, 4)
                EndIf
            ElseIf aiButton == 4
                aiButton = Hairstylemenu4.Show()
                If aiButton == 0

                ElseIf aiButton == 1
                    Game.GetPlayer().SetNthHeadPart(BeardList.GetAt(41) as HeadPart, 4)
                ElseIf aiButton == 2
                    Game.GetPlayer().SetNthHeadPart(BeardList.GetAt(42) as HeadPart, 4)
                EndIf
            EndIf
        EndIf
    EndWhile
EndFunction

Edited by Gorgotem
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...