Jump to content

Recommended Posts

Posted

Hey,

 

I'm pretty new to Papyrus Scripting and I would like to make my first mcm menu.

Since my script with the amount of features I want to implement, is getting quite crowded,

(the mod would probably fit in one script, but that would be thousands of lines of code, so I would rather split it into about 2000 lines of code per page)

my idea was to make one script per mcm page, now my questions are:

How do I do that? Has anyone tried that before? Is it even possible?

I'm running out of options, so I'm asking you guys here on the forum, in the hope you can help me :3

 

Regards qotsafan

Posted

I know that you cannot have multiple scripts with the same events, that just makes two whole mod entries rather than controlling separate pages.

 

You might be able to put some stuff into functions on a second or third script and shorten the amount of code in the main script, but that all depends on how you write it up I suppose.

Posted

Thanks for the quick response :3

 

Hmm yeah, I figured as much, so I stopped the project for now (it was a bit insane anyway) and scaled it down a bit, so I do not need to make multiple scripts.

I would have continued it, if it were possible though.

 

I also made a script that contains functions declared as "global", didn't find another way that doesn't give me headaches ^^, but it's only a small part of the main script.

I'm also not quite sure how to handle multiple scripts, adding them to the scripts tab or alias tab or make a whole new quest (which I guess is wrong :3)

Didn't find a good tutorial about that :3

 

Despite all that, my scripts seem to work, so I'm not complaining, thanks for the help anyway.

If anyone cares, I can post the scripts once I'm done :3

 

Regards qotsafan

Posted

I literally just tested this.

You can have multiple MCM menus.

Each needs to be uniquely named and contained in it's own quest.

Posted

Multiple MCM menus yes, but not individual pages controlled by separate scripts. I understood the OP as wanting all options on Page 1 to be controlled by one script, all options on Page 2 to be controlled by another script, etc. etc...

Posted

Exactly, since I read somewhere, that there is a limit to how many mcm menus you can load.

I could make multiple mcm menus, but that would be counter-productive :3

 

Oh and btw, does one of you two (or anyone else) know how I can get the name of an object in a FormList?

The SKSE function GetName() doesn't seem to work, I always get back a null String.

 

Example:

 

String[] function SetOutfitMenu()
String[] Menu = new String[128]
Menu[0] = "$No Option"
int i = 0
while (i < 127)
Menu[(i+1)] = (OutfitFormList.GetAt(i).GetName() as String)
i += 1
endwhile
return Menu
endFunction

That doesn't seem to work (you may call me lazy, but I'm not fond of making hand-made String Arrays of the size of 128 entries ^^).

 

Regards qotsafan

Posted

I've done similar.

Here is my function block so you can see what is happening

 

  Reveal hidden contents

 

Posted

Hmm, when I think about it, that seems to work for "ammunition", since it actually has a "Full Name" entry, which an "outfit" doesn't and it seems it can't "Get" the EditorID, just my luck :3

There also seems to be no GetBaseOutfit function for NPCs (while GetDefaultSleepOutfit, which is called GetOutfit, exists...), which is unfortunate too :3

Posted

GetOutfit will return the default outfit or the sleep outfit

 

GetOutfit(true) is used for getting the sleep outfit

GetOutfit(false) is used for getting the default outfit

GetOutfit() can also be used for getting the default outfit

 

Note, I've not used the function before. That is just what I understand from reading the documentation.

Posted

Oh... I seem to not have read the "or" thanks lol, I will try it out an tell the results :3

 

Edit: Yes, it works perfectly, thank you so much ^^

 

My test example (it's only a part of the functions):

 

  Reveal hidden contents

 

  • Recently Browsing   0 members

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