Jump to content

[Scripting] add MCM option to insert text by the user


Recommended Posts

Another 4 hours now and no luck by me either managing to understand what the SkyUI github wants to tell me or my poor attempts to at least copy paste a similar function from another mod (massmatchmaker).

 

I want basically this:

 

- a text field in the MCM that reads "empty"

- user can click on the field and write someting. for example a sexlab tag "doggystyle" or a DDe Outfit "Yoke"

- this text is then internally called for and inserted into other functions (I think this part I will be able to pull off myself)

 

but problem is: the text needs to be user input and should be stored ofc. 

external json file is not an option, I want it to be in the MCM (most ppl just dont use or can handle jsons)

 

I will not even attempt to explain what I already tried, it all ended up either not compiling, not beeing anywhere close to what I need etc...

some mods also seemed to use their complete own system for it, so in short I did not find any mod or documentation that I could use as template. 

 

thx alot. 

Link to comment
6 minutes ago, AndrewLRG said:

I just like to read other modders scripts before bed. :)

 

haha, my brain seems to be just incapable of doing that. 
when I look at others scripts I see a godian knot and I dont have a sword :P

 

and I dunno if I am looking at the wrong places, but simple script examples like the ones you made are nowhere to be found. 

Link to comment

I just want to say something about that line...

Event OnPageReset(string a_page)
	if a_page == "First Page"
		oidTextInput = AddInputOption("Insert Text Here", SavedText)
	endif
EndEvent

 

Don't do it like this... if You ever change Page name or something then ur MCM will not work...

 do it like this:

 

Event OnPageReset( String PageName )
	If( PageName == Pages[0] )
		FirstPage()
	EndIf
EndEvent

 

for example if You ever change "First Page" name to something else You don't have to change it in other locations...

 btw. Static String is making Script bigger... we don't want to waste memory ^_^

 

in "old" script version we had 2 variables Pages[0] and "First Page" both have same value so they use 200% of the memory they need...

 if You already have one reference dont make new same reference... especialy static reference...

 

//Edit:

  

22 hours ago, Nymra said:

and I dunno if I am looking at the wrong places, but simple script examples like the ones you made are nowhere to be found. 

 

I'm 99% sure that SKY UI wiki have it... and way better explained...

 i'm too lazy to look for SKY UI but You can simply open Sky UI PSC files...

 

always when You look for something just open PSC files and read funcions ;x...

 

SKY UI Script file line 299:

; @since 4
int function AddInputOption(string a_text, string a_value, int a_flags = 0)
	{Adds a text input option}
	Guard()
endFunction

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use