• 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!

[Tech Help] Command?

Lynk

Grand Poobah
Stratics Veteran
Stratics Legend
This was in the other SA thread, but I felt it more appropriate here (Sorry Cromag).

Where is the documentation that teaches us how and what we can use in the command prompt?



There are obviously key words and I would like to know them as well as the proper syntax. Something tells me that we will be able to communicate directly with the client with these. This command function built in with the recorded macros makes for some very interesting possibilities.

If this is the case - very good job EA - now give me the damned command list!
 

Harlequin

Babbling Loonie
Stratics Veteran
Stratics Legend
This was in the other SA thread, but I felt it more appropriate here (Sorry Cromag).

Where is the documentation that teaches us how and what we can use in the command prompt?



There are obviously key words and I would like to know them as well as the proper syntax. Something tells me that we will be able to communicate directly with the client with these. This command function built in with the recorded macros makes for some very interesting possibilities.

If this is the case - very good job EA - now give me the damned command list!
I'm curious too! I tried a couple of o/s commands thinking that it was that kind of commands, didn't work. Anyone knows?
 

Petra Fyde

Peerless Chatterbox
Alumni
Stratics Veteran
Stratics Legend
interesting, but relatively useless. Are you able to give us non-techies some idea of useful things we might be able to use it for?
 

Lynk

Grand Poobah
Stratics Veteran
Stratics Legend
It worked.... *hyperventilates*
Yes, I want a full list of the commands like Create Window, but it def appears as though you can run script commands, looks like a variant of VB. I want to know all the different window and gump names, I want a full list of everything. Where is it!
 

Harlequin

Babbling Loonie
Stratics Veteran
Stratics Legend
Nice! Was it documented in the KR manual? Anyone still has the pdf?
 
C

CroMag1980

Guest
I am going to poke around the default.zip file tonight in the ...Electronic Arts\Ultima Online Stygian Abyss\UserInterface directory.

The "includes" in the interface.xml I am assuming work like #includes in C++ so these files below might contain something currently usable.
Code:
<Scripts>
		<Script file="Interface.lua" />
		<Script file="Source/Tooltips.lua" />
		<Script file="Source/StringUtils.lua" />
		<Script file="Source/GGManager.lua" />
		<Script file="Source/Confirms/CGManager.lua" />
		<Script file="Source/Generic/UO_GenericGump.lua" />
		<Script file="Source/DamageWindow.lua" />
		<Script file="Source/HotbarSystem.lua" />
    <Script file="Source/OverheadText.lua" />
		<Script file="Source/ObjectHandle.lua" />
		<Script file="Source/HealthBarColor.lua" />
    <Script file="Source/NameColor.lua" />
    <Script file="Source/StaticTextWindow.lua"/>
	</Scripts>
Old documentation can be found here. You get a "not recommended" message from browser so use at own risk (but only place I could find those files).
 
P

pgcd

Guest
Yes, I want a full list of the commands like Create Window, but it def appears as though you can run script commands, looks like a variant of VB. I want to know all the different window and gump names, I want a full list of everything. Where is it!
It's not VB, it's Lua. The sources seem to be very closely related to those for KR, but there are some interesting differences. Too bad it's not active yet, as i long to be able to use my scripties.
 

Maplestone

Crazed Zealot
Stratics Veteran
Stratics Legend
The "command" action is a direct interface to the language of the UI. If you look at the Custom UI documentation at the modder exchange (from the link Cromag1980 provided above) you can get a rough overview, but in the end it still requires you to understand how to write Lua files (you can look in the default interface sources directory or custom mods for lists and examples)

I fear I really only know enough to know how stunningly powerful this is and how steep the learning curve is.
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
*adds "writing up useful SA script commands" to his task list*

edit:: See here.
 

Lynk

Grand Poobah
Stratics Veteran
Stratics Legend
I fear I really only know enough to know how stunningly powerful this is and how steep the learning curve is.
I'm really looking forward to developing some neat stuff.

I'm not familiar with LUA, but lets be honest if you can write in one language you can write in them all.. time to find some docs and brush up.
 

TullyMars

Sage
Stratics Veteran
Stratics Legend
I had done some previous KR modding on my own so figured I'd poke around and see what I can find for SA till they open up the custom interfaces.
Here is what I found and got to work in a cursory look at some of the UO SA Lua and xml files. Doubt any are real useful. Use at your own risk.

command script TargetWindow.ClearPreviousTarget()
Description: clears out your target so you have nothing on current target.
command script MapCommon.AdjustZoom(-50)
Description: zooms the radar map
command script MainMenuWindow.OnOpenBugReportItem()
Description: opens a bug report window

Dual Macro
command script MainMenuWindow.OnOpenUserSettings()
command script SettingsWindow.OpenLegacyTab()
Description: opens your settings window and switches it to legacy tab.

These are just the ones I got working correctly and as I said I may wait till the real talents in modding come out. The good news is I don't see why any and all previous mods and such shouldn't work again and with a little perserverance all requests will probably be worked out.
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
((edit:: Commands moved here))

Anybody have requests for other commands?


Note: If you want to do multiple settings changes rapidly - merge them into a single macro with only one "UserSettingsChanged()" call at the end.
You can also move the "UserSettingsChanged()" call as it's own macro, if you'd like.
 
F

Fink

Guest
Gildar, brilliant as always.

Any you could whip up for changing performance-affecting settings would be great; frame rate, shadows, etc, whatever you think is critical. This could be handy for on-the-fly benchmarking, a "fine-tune" macro set. Seems to be a popular gripe.

Being able to press a key and have it change playfield zoom level to the desired setting would be good, too, opting for something that scales well without rectangular pixels.
 
O

Old Man of UO

Guest
Switching Object Handle Filters on the fly...

Dynamic Objects -...


Anybody have requests for other commands?


Note: If you want to do multiple settings changes rapidly - merge them into a single macro with only one "UserSettingsChanged()" call at the end.
You can also move the "UserSettingsChanged()" call as it's own macro, if you'd like.
OH WOW! I had asked for the Object Handles switch key function... I think this is what I need!!

One other request... I use different default zoom levels depending on which character I am playing and what they are doing. For example, my tamer lead tames cu sidhes and I find it easier to zoom IN about 2/3 max to tame. Then when I go hunting for more to tame, I zoom OUT to about 2/3 max. Is there a Zoom setting that will work?

THANKS Gildar!
 
T

TheGrayGhost

Guest
OH WOW! I had asked for the Object Handles switch key function... I think this is what I need!!

One other request... I use different default zoom levels depending on which character I am playing and what they are doing. For example, my tamer lead tames cu sidhes and I find it easier to zoom IN about 2/3 max to tame. Then when I go hunting for more to tame, I zoom OUT to about 2/3 max. Is there a Zoom setting that will work?

THANKS Gildar!
Same boat this is something I have been wanting. Thanks a ton Gildar!
 

Lynk

Grand Poobah
Stratics Veteran
Stratics Legend
Very nice, where are you getting this from? Is there a manual??

I also need to assign a hot key to changing screen size since I use my mouse wheel to target self/last target.
 
O

Old Man of UO

Guest
Very nice, where are you getting this from? Is there a manual??

I also need to assign a hot key to changing screen size since I use my mouse wheel to target self/last target.
Lynk, in case you didn't know yet, the default hot keys for zoom in/out are

IN: Left ALt - (Minus)
Out: Left ALT + (Plus)

and of course you can change those. But I want to go to a fixed zoom rather than scrolling the zoom.
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
Very nice, where are you getting this from? Is there a manual??
No - I'm getting them from experience modding the KR client. It's mostly the same Lua underneath.


I also need to assign a hot key to changing screen size since I use my mouse wheel to target self/last target.
You already have this - it's 6th and 7th from the bottom of the key binding list.


toggle circ of trans?? please?
You've already got that one - last option in the input list.


As for fixed zoom... I'm not seeing any way to do that. Sorry.


Here are a few other nice ones...

((edit:: Commands moved here))
 
O

Old Man of UO

Guest
Gildar, I didn't do a very good job explaining what I am looking for in the Zoom.

Let's say we can zoom from 0% (min) to 100% (max). Can I hot key 25% zoom and 75% zoom with the commands?
 

TullyMars

Sage
Stratics Veteran
Stratics Legend
Illandril, I got myself stuck on working out a dismount command that can be put into macros and I was wondering if you found a quick way of getting a toons objectId.

I was thinking of setting the TargetWindow.TargetId to my toons ID and calling the TargetWindow.OnItemDblClicked() function which does this
UserActionUseItem(TargetWindow.TargetId,false)

Any suggestions?
 

Lynk

Grand Poobah
Stratics Veteran
Stratics Legend
No - I'm getting them from experience modding the KR client. It's mostly the same Lua underneath.
Ok.. but you must have gotten that knowledge from somewhere? How do you know the commands are ResizeWindow and _doFreeze, etc.

I don't imagine you figured out the KR modding just by typing random words in until you got a reaction?

Hide the orange border around the play window (effectively prevents resizing and moving of the play window) -
COMMAND script WindowSetShowing( "ResizeWindow", false )

Show the orange border around the play window -
COMMAND script WindowSetShowing( "ResizeWindow", true )

While I'm at it... toggle the "locked" state of the play window, status window, chat windows, and menubar -
COMMAND script Debug.PrintToChat(L"UI Freezing...")
COMMAND script _doFreeze = _WindowGetShowing( "ResizeWindow" )
COMMAND script WindowSetShowing( "ResizeWindow", not _doFreeze )
COMMAND script WindowSetMovable( "StatusWindow", not _doFreeze )
COMMAND script ChatWindow.LockWindow( _doFreeze )
COMMAND script WindowSetMovable( "MenuBarWindow", not _doFreeze )
COMMAND script WindowSetMovable( "MenuBarWindowMinimized", not _doFreeze )
COMMAND script Debug.PrintToChat(L"UI Frozen? "..StringToWString( tostring(_doFreeze) ) )
 

TullyMars

Sage
Stratics Veteran
Stratics Legend
Very nice, where are you getting this from? Is there a manual??
Lynk open up the default.zip in the user interface folder of the game installation.
From there use notepad (or whatever editor like Notepad++) to read all the different Lua (the source folder is probably where the meat of the programming can be found) Whenever you see a function you should be able to call that from the command script. You can also see various system and user variables that you should be able to set using the command.

From there it is trial and error. If you are like me it is trial and error and error and error. If you are experienced like Gildar (and the other uo.modders-exchange.net contributers)...much less error.
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
Let's say we can zoom from 0% (min) to 100% (max). Can I hot key 25% zoom and 75% zoom with the commands?
Not that I can find.


Illandril, I got myself stuck on working out a dismount command
UserActionUseItem(WindowData.PlayerStatus.PlayerId,false) will dismount... but if you're not mounted it will toggle your paperdoll.
I don't see a way to quickly check to see if you're mounted or not.


Ok.. but you must have gotten that knowledge from somewhere? How do you know the commands are ResizeWindow and _doFreeze, etc.
I studied Lua, and read through the files in the Default zip of the UserInterface directory. There was some documentation (but it was out of date, and not particularly useful) that originally came along with KR, but that was since removed.

_doFreeze is my own variable that I defined in the commands (I needed to pass the data between the string of commands).
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
From there it is trial and error. If you are like me it is trial and error and error and error. If you are experienced like Gildar (and the other uo.modders-exchange.net contributers)...much less error.
I don't know about that one... I think we just try things faster ;)
 

TullyMars

Sage
Stratics Veteran
Stratics Legend
UserActionUseItem(WindowData.PlayerStatus.PlayerId,false) will dismount... but if you're not mounted it will toggle your paperdoll.
I don't see a way to quickly check to see if you're mounted or not.
Ah thank you for that variable.
 
O

Old Man of UO

Guest
...
UserActionUseItem(WindowData.PlayerStatus.PlayerId,false) will dismount... but if you're not mounted it will toggle your paperdoll.
I don't see a way to quickly check to see if you're mounted or not.
...
This works perfectly!

Anyway to remount? I know that I can drop an ethy into a hot bar slot and assign a key to that, and works great for mounting, but not my cu sidhe.
 

TullyMars

Sage
Stratics Veteran
Stratics Legend
I assume you don't want to use the targetnearestfriendly option that many macroers have discussed.
Well when I get near my SA computer I will test it out but thought I'd post these two theoretical approaches in case anyone wants to play around and make them work.

1.UserActionUseItem(WindowData.Pets.PetId[1].MobileId , false)
OK not sure what the right variable is supposed to be but it is something like this for the first pet in your list. Of course if you replace the 1 with a 2 you would get your second pet as that is just the placement in the index.

2. SystemData.ActiveWindow = "PetWindowShowViewHealthBar"..thenameofyourpet.."LabelName"
PetWindow.OnDblClick()
In this one I know the window name is wrong but it is something grandiose like that.


As I said neither of these will work as is but may give some people a start on where to look.
 
O

Old Man of UO

Guest
What does this one do?

COMMAND script SystemData.Settings.GameOptions.GodMode = SystemData.Settings.GameOptions.GodMode
COMMAND script UserSettingsChanged()
 
D

Diggity

Guest
Switching Object Handle Filters on the fly...
...
Anybody have requests for other commands?
Hotkey handle filters, very handy. Thanks.

How about a command to create a mobile healthbar from either current target or target window gump?
 
C

CroMag1980

Guest
I'd ideally like to store a bunch of friendly/enemy targets that i can overwrite on the fly.

If F5-F8 were Target Friendly 1-4 and F9-F12 were Target Enemy 1-4 - along with a "store target friend" "store target enemy" macros (up to 4 of each in this example) I basically would not need to touch my mouse... o_0
 
F

Fink

Guest
Wish I'd seen all this before setting up all my characters.. might just have to paste a bunch of macros into each settings file.

Good work, keep them coming. :thumbsup:
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
How about a command to create a mobile healthbar from either current target or target window gump?
((edit:: Commands moved here))

I tried moving it to the mouse cursor... but that needed 5 commands to work for people who use UI scaling (and for those who haven't noticed yet... there's a delay between each command... so it was sloooow)
 
O

Old Man of UO

Guest
Wish I'd seen all this before setting up all my characters.. might just have to paste a bunch of macros into each settings file.

Good work, keep them coming. :thumbsup:
Whenever I try to change anything in the settings files they get written over with a blank default file. Same for the XML files. Does this work for you?
 
O

Old Man of UO

Guest
Creates a mobile healthbar from current target (sticks it in the upper-left corner of the screen):
COMMAND script MobileHealthBarWindow.CreateHealthBar(WindowData.CurrentTarget.TargetId)

Creates a mobile healthbar from the current target, attaches it to the current target (moves it over the target's head and keeps it stuck there), then detaches it (lets you drag it around as you please):
COMMAND script _mobID, _x = WindowData.CurrentTarget.TargetId, MobileHealthBarWindow.CreateHealthBar(WindowData.CurrentTarget.TargetId)
COMMAND script AttachWindowToWorldObject(_mobID, "MobileHealthBarWindow".._mobID)
COMMAND script DetachWindowFromWorldObject(_mobID, "MobileHealthBarWindow".._mobID)


I tried moving it to the mouse cursor... but that needed 5 commands to work for people who use UI scaling (and for those who haven't noticed yet... there's a delay between each command... so it was sloooow)
STOLEN!
 

Maplestone

Crazed Zealot
Stratics Veteran
Stratics Legend
I tried moving it to the mouse cursor... but that needed 5 commands to work for people who use UI scaling (and for those who haven't noticed yet... there's a delay between each command... so it was sloooow)
What about creating a new LUA file with a subroutine doing everything and having just one script referencing the subroutine?

( just something to think about when doing custom UIs :) )
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
What about creating a new LUA file with a subroutine doing everything and having just one script referencing the subroutine?

( just something to think about when doing custom UIs :) )
The problem with that... no custom UI stuff in SA yet :(

If we did... I would be making skins instead of writing up commands.
 
D

Diggity

Guest
I tried moving it to the mouse cursor... but that needed 5 commands to work for people who use UI scaling (and for those who haven't noticed yet... there's a delay between each command... so it was sloooow)
I'm on a laggy slow computer at the moment so not sure how it will work "for reals", but thanks for the commands.

I did notice that if I use the MobileHealthBarWindow.OnBeginDragHealthBar(id) function, it does create the healthbar somewhat near the cursor. Real laggy on my computer tho and the healthbar gump doesn't anchor until I click the mouse right on the gump. I'll try doing a multipart command macro to also use the .OnEndDragHealthBar to see if I can get the healthbars to create somewhat quickly at the cursor location. Ultimately I'd like to create all the healthbars by spamming next enemy or next friend while positioning the cursor where I want the healthbars to show.

On another note, is there a command that can be use to toggle the ignore persons user settings? With all the Armageddon spam, I probably have 1/2 my shards Shadowlords groups on ignore. Be nice to easily toggle them on/off.
 
O

Old Man of UO

Guest
Switching Object Handle Filters on the fly...

Corpses -
COMMAND script SystemData.Settings.GameOptions.objectHandleFilter = SystemData.Settings.ObjectHandleFilter.eCorpseFilter
COMMAND script UserSettingsChanged()
...

Anybody have requests for other commands?

...
Ya, I have a request.

Anyway to use this command script to open up all corpses within range?
 
A

Ash

Guest
I assume you don't want to use the targetnearestfriendly option that many macroers have discussed.
Well when I get near my SA computer I will test it out but thought I'd post these two theoretical approaches in case anyone wants to play around and make them work.

1.UserActionUseItem(WindowData.Pets.PetId[1].MobileId , false)
OK not sure what the right variable is supposed to be but it is something like this for the first pet in your list. Of course if you replace the 1 with a 2 you would get your second pet as that is just the placement in the index.

2. SystemData.ActiveWindow = "PetWindowShowViewHealthBar"..thenameofyourpet.."LabelName"
PetWindow.OnDblClick()
In this one I know the window name is wrong but it is something grandiose like that.


As I said neither of these will work as is but may give some people a start on where to look.
Well, not ideal for multiple pet users, but single pet players can (at least with new targeting haven't tried legacy) make a simple macro
1 - Target Nearest Follower
2 - Use Targeted Object

Presto you just mounted the nearest follower.
 
F

Fink

Guest
Whenever I try to change anything in the settings files they get written over with a blank default file. Same for the XML files. Does this work for you?
I've had one occasion where the file has gone bad and been overwritten by a default file when I've loaded the character. Not sure what I did but I restored from a backup, then attempted another copy/paste and it worked. Was basically creating a long macro with lots of repetition in the guts of it, which itself was then repeated x10.
 
Top