Jump to content

Help with a script: House mod static customization


BamfuPanda

Recommended Posts

Hello, I require the help of a more or less advanced papyrus scripter about a specific script I had in mind. Nothing very complicated in my belief.

 

To make it clear:

 

-I am currently working on a house mod that makes us of a lot of custom meshes and skins. There are a few spaces for mannequins, racks, bookshelves etc... All the classic customization objects you find in about every single home mod.

I wish, however, to push that player customizing aspect a wee-bit further. In my attempt to make a script using the various guides the wiki provides as well as youtuber's videos, I have unfortunately miserably failed (to the point I managed to make one of my cells crash CK upon loading. That's called Critical Failure in older RPGs, right?)

That is why I require your help and guidance for this.

 

 

 

 

 

-The script I had in mind is an activator, let's say it is a button, that upon pressing, pops out a menu (I managed to script that far flawlessly), allowing the player to choose, let's say, Static A, Static B, or Static C (etc...).

 

For the sake of vulgarizing, let's say they are Hold shields of Whiterun, Solitude and Windhelm, allowing the player to choose their allegiance and display it at home.

 

-Upon the PC choosing, for example, Static A, the pre-placed static A in a specific location and set to INITIALLY DISABLED in the cell will appear, while automatically "telling" Static B and C to be set to disabled, thus only showing Static A.

Same thing upon the PC choosing Static B in the menu. A and C will be disabled and B will be switched to enabled. etc...

 

 

 

 

As you may have guessed, I have a very clear idea of the kind of script I need, but alas do not have the knowledge (nor the patience, truth be told) to finalize it. How should I link the statics to the activator? By Parenting? Linked ref?

What script lines should I type in?

 

 

 

Thank you sincerely in advance for any help you could provide.

As a teaser, here's a pic of the mod I'm working on.

Edited by BamfuPanda
Link to comment
Share on other sites

Enable parenting isn't needed. Make 3 properties of objectreferences corresponding to each static, and then, in the button:

If choice == 0; show static 1
     Activator2Property.Disable()
     Activator3Property.Disable()
     Activator1Property.Enable()
ElseIf choice == 1; show static 2
     Activator1Property.Disable()
     Activator3Property.Disable()
     Activator2Property.Enable()
ElseIf choice == 2; show static 3
     Activator1Property.Disable()
     Activator2Property.Disable()
     Activator3Property.Enable()
EndIf
Link to comment
Share on other sites

If you would like something a little more dynamic.

In other words something you can change the amount of items without writing a new script each time to accommodate the new amount of items.

In otherwords you can use the script as a template and just fill the properties as required.

 

1) Compile and Attach this script to your activator.

 

2) Fill the ObjectReference Property array with your items.

 

3) Create a Message with responses that coincide with the ObjectReference property array and then point the script Message Property to your Message.

eg: ObjectReference at index 0 coincides with your Message response at 0

Should be the same amount of message responses as the amount of items in the ObjectReference property array.

Scriptname MyStaticsScript extends ObjectReference

ObjectReference[] Property MyStatics Auto
Message Property WhichOneMsg Auto

Event OnActivate(ObjectReference akActionRef)
    Int iMsg = WhichOneMsg.Show()
    Int i = MyStatics.Length
    If iMsg >= i || iMsg < 0
        ;Problem: The message return was outside of the range of MyStatics property array.
        Return
    EndIf
    While i
        i -= 1
        If i == iMsg
            MyStatics[i].Enable()
        Else
            MyStatics[i].Disable()
        EndIf
    EndWhile
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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