Jump to content

Script-injected workshop menu help


Recommended Posts

Is there a super low level walkthrough for adding script-injected menus to the workshop? I've seen the demo script on nexus, but since I haven't touched a line of code since college like 15+ years ago, I'd feel a bit more comfortable following something a bit more step by step before unleashing a project into the world.

 

(I know it isn't necessarily the best option because of user error, but my biggest mod adds so many furniture objects that the vanilla menus become mired in scroll-nightmare-hell with it installed, so this seems the most reasonable option).

Link to comment
Share on other sites

For creating your keyword or formlist you can use Stuyk`s article. Google: " Stuyk understanding custom workshop menu". He uses FO4 Edit in his example, but I did it all in the CK.

Injecting is simple (not necessary to be a magic effect, can be a quest script, object reference script etc ).

Scriptname MyMenuScript  extends activemagiceffect
FormList property WorkshopMenuMain auto const    ;menu where you add your custom category
FormList property WorkshopMenuCustom auto  const      ;your custom menu formlist 
       
Event OnEffectStart(Actor akTarget, Actor akCaster)                                
        WorkshopMenuMain.addForm(WorkshopMenuCustom)                           
EndEvent

For deinstalling all the same but this:

WorkshopMenuMain.removeAddedForm(WorkshopMenuCustom)

It can be done in the same script using a messagebox with 3 buttons:


Scriptname MyMenuScript extends activemagiceffect
Message property MyMessageBox auto const
FormList property WorkshopMenuMain auto const
FormList property WorkshopMenuCustom auto const
int ibutton    

Event OnEffectStart(Actor akTarget, Actor akCaster)                                
    ibutton = MyMessageBox.show()                 
           if ibutton == 0                                  
            WorkshopMenuMain.addForm(WorkshopMenuCustom)                  
        elseif ibutton == 1
           WorkshopMenuMain.removeAddedForm(WorkshopMenuCustom)
        else
           ;Do something else  or do nothing(leave empty)
    Endif
EndEvent

This example will add your menu to the workshop main menu.

If you have only 1 category( without sub categories) , then I think you only need to create a keyword and to add it instead of the formlist.

Edited by kitcat81
Link to comment
Share on other sites

Thanks- that's super helpful!! I probably will need sub-categories, but this is a great jumping off point.

Not at all :). Creating a keyword and a formlist is fully described by Stuyk. The method in his article creates a menu with 1 sub-category. To create more sub- categories you`ll need just to add more keywords and to paste them into your formlist.

But he does not tell how to inject it, so I added a code for a magic effect. The magic effect should be fire and forget and it can be attached directly to a chem. For a message box menu you also can use some other object like a holotape (I guess it will be Event OnEquipped then).

Edited by kitcat81
Link to comment
Share on other sites

  • Recently Browsing   0 members

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