|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Thu Aug 09, 2012 12:58 am
Button images/ CMUD GUI |
Hey,
For once I'm not asking how to do something, how about that?
I thought I would share with you all my work in progess CMUD client (which I use to play The Two Towers MUD, a LotR based MUD - t2tmud.org:9999).
This shows what is possible by using multiple windows, with images loaded into buttons.
Note I have very very limited knowledge of scripting, so this is just the start.
Comments? Does anyone else do something simular?
Hope you enjoy,
Falgor |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Thu Aug 09, 2012 1:22 am |
Not sure how to use MXP, but as these buttons don't do anything they work okay.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Aug 09, 2012 12:56 pm |
That's an excellent job.
There was a suggestion at one point of making a stickied thread where people showed shots of their rocking screen layouts. This would be a good example. |
|
|
|
Xerakon Apprentice
Joined: 10 May 2011 Posts: 111
|
Posted: Sun Aug 12, 2012 5:55 pm |
Kudos on this! This is exactly the same sorta thing I was looking for earlier before I decided to go with a more simplistic approach. =)
|
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Tue Aug 14, 2012 6:51 pm |
Hmm, I have started having an issue. My gauges have stopped working, it is almost as if the variable they use will not export to a window seperate from my main one. However the clock still works, which also uses a variable made from the main window.
Any ideas? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Tue Aug 14, 2012 7:22 pm |
but the variables in a module, those share reguardless of window.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Tue Aug 14, 2012 7:31 pm |
That's what I thought, but the gauges are not working unless I put them in my main window.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Tue Aug 14, 2012 7:38 pm |
did you try using the full variable path name on the gauge tab?
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Aug 14, 2012 7:42 pm |
Could you explain exactly what the situation is? You implied at first that it was _not_ working when
the variable was defined in the main window, then you said it was not working unless you put
the variable in the main window.
A window cannot see variables that are defined in a different window. A window can see variables
that are defined in a module, provided that the module is set as global, and the window is set to
see that module. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Aug 14, 2012 9:43 pm |
Quote: |
A window cannot see variables that are defined in a different window. A window can see variables
that are defined in a module, provided that the module is set as global, and the window is set to
see that module.
|
1)windows cannot change what modules they can see. Windows can only include/exclude packages. Apart from the differences explained in #2, modules are an all or nothing affair for windows.
2)Global means that any module/window from any package can see into that module. External means that only the windows/modules from other packages can see into that module. Local means that only the windows and other modules in the same package as this module can see into the module (think along the lines of private properties in object-oriented programming).
3)CMud uses a logic tree to go looking for variables if you reference said variables using @varname syntax. The process is like so:
--first look in the window that has context
--next look in any modules in the contexted window's package that are defined as global or internal
--next look in any modules in other packages that are defined as global or external
--if still not found, create new variable in contexted window at the root level (or, if assignment is not appropriate to the activity, return a null value)
When you use @//window or module/class/.../varname, CMud does not use that logic tree and will only look at the location you specified. If the location is valid but the variable doesn't exist there, either a null value will be returned or a new variable will be created (depending on what you were doing with the variable). If the location is invalid (ie, a typo in a window/module/class name or a class was disabled), a new variable with the specified path as its name is created at the window's root level. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Aug 14, 2012 11:58 pm |
Right, sorry. What I meant was that the _package_ had to be enabled for the window.
|
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Wed Aug 15, 2012 9:08 pm |
I'm using a variable that the MUD makes for me, an MXP variable for my Health/Energy.
It only updates if the button gauge is part of the main window, not when I put it in one of my graphical side windows. |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Wed Aug 15, 2012 9:10 pm |
Therefore I can't set a trigger that picks up the variable as global or anything, as I am not in control of the variable... the MUD is.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Aug 15, 2012 10:55 pm |
@variables are global to the session, which means it doesn't matter from which window you are referencing the variable. %mud (used for mxp variable references), %gmcp (GMCP variables), and %gsl (the old Simutronics protocol) are specific to the window, so if they are not defined in that window context you get a null value returned.
The mapper and SQL functionality operate under the same principles, as well, though in the case of SQL that means you generally get an AV error instead of a null value. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Aug 16, 2012 1:38 am |
Perhaps you could copy the MXP variable into a global variable and use that in your button?
|
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Wed Oct 10, 2012 10:39 pm |
An update, rather than use seperate windows I just send the buttons to seperate toolbar locations. Also made a bit more space (in this instantance I am just sending the buttons to toolbar 4, vertical toolbar on the right). As this is part of the main window there is no problem with the MXP variables updating!
|
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Thu Oct 18, 2012 1:19 pm |
Here is what I did just with buttons alone. You can see the x-ray graphic I use for my target. I can light up the limb joints with different colors showing when I break the targets limb or prep it to break and so on.
|
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Thu Oct 18, 2012 1:22 pm |
I'm not connected obviously. I manually set it to display the red and green lights for the purpose of showing it here. When I connect, the information would also be displayed in the lower toolbars as well that are showing blank right now.
|
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Wed Oct 24, 2012 10:45 pm |
Nice, that looks like a complex combat system!
|
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Wed Oct 24, 2012 10:49 pm |
Does your MUD use a lot of mxp variables, mine only uses HP and EP therefore I have to get the rest of the stuff off triggers.
|
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Wed Oct 24, 2012 11:03 pm |
It uses GMCP. Everything is updated through GMCP and triggers. I haven't played it in more than a year or so, but was trying to show what you can do with buttons. None of what I show uses MXP however.
|
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Wed Oct 24, 2012 11:06 pm |
By the way, it is a complex system. The combat in Achaea and other IRE games is very complex.
|
|
|
|
|
|