• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new announcement concerning the upcoming addition to Stratics. You can find the announcement Here!

How do you know what command scripts are available?

S

Sweeney

Guest
Very curious.. do you just search the .xml files for commands?
 
S

Sweeney

Guest
A few people have read this.. what is your secret? I hate being ignorant.
 
M

mdscan

Guest
Yes I read that.. I'm wondering how the posters got the original information. Thanks for the bump though.
I have asked for this info too, but no reply. I guess that anyone who does know has not read the thread. I can't see any reason why they would not share the info so more people can try to come up with new scripts.
I hope someone replies soon.
 
S

Sweeney

Guest
Evidently noone wants to share. So much for the UO community.

*wonders how many wannabe-modders have died in the wake*
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
Sorry - when this thread first showed up, this was already answered in two other threads, so I just skipped over it figuring people would start noticing those threads.
Since then, forum activity has exploded, and I didn't see any of the bumps (I've only read probably 1/4 of the threads in this forum since I don't have time to read them all).


In the UserInterface folder, there is a file named "default.zip". Within that, there are a number of files that have a ".lua" extension.
Anything that can be done in one line in those files can be done with a script command.
For example, if you look in "Source/Debug.lua", you'll see a function called "Debug.Print". You can call this with a script command by...
Code:
/script Debug.Print( "Some message" )
This will then show in your Debug Console (which you can turn on with "/debugwindow on").

If you look in "Source/SettingsWindow.lua", you'll see a large function called "SettingsWindow.OnApplyButton". In this function, you can see how the settings are changed.
If you wanted to change the foliage setting, for example, you'd look at this line:
Code:
SystemData.Settings.Resolution.displayFoliage = ButtonGetPressedFlag( "SettingsGraphicsShowFoliageButton" )
So, to change the foliage setting to false, you could use the following script command:
Code:
/script SystemData.Settings.Resolution.displayFoliage = false
But you'd notice that this doesn't actually change your foliage. So, you should look back to the OnApplyButton function and see what else it does. If you look down at the bottom, you'll see this line:
Code:
UserSettingsChanged()
This is what actually applies your settings, and causes them to take effect. So to change the foliage setting, you'll need two script commands.
Code:
/script SystemData.Settings.Resolution.displayFoliage = false
/script UserSettingsChanged()
 

kelmo

Old and in the way
Professional
Alumni
Supporter
Stratics Veteran
Stratics Legend
UNLEASHED
Dread Lord
Just spend 4 hours on it...
 
M

mdscan

Guest
Thank you for the help. That is exactly what I was looking for. I missed the other threads that you mentioned.
I don't mind spending time to figure stuff out, but it helps to know where to start.
Thanks again.
This info might be useful in the sticky thread for Command Scripts.
 

kelmo

Old and in the way
Professional
Alumni
Supporter
Stratics Veteran
Stratics Legend
UNLEASHED
Dread Lord
Hey md... My remark was aimed at another poster. I am glad you found your answers. *tips hat*
 
Top