Vyzor, UI Manager for Mudlet

Share your scripts and packages with other Mudlet users.
User avatar
Nioki
Posts: 10
Joined: Tue Feb 04, 2014 7:59 am

Re: Vyzor, UI Manager for Mudlet

Post by Nioki » Tue Feb 04, 2014 4:10 pm

I was tinkering with vyzor recently after going back into Achaea, since I decided to finally go beyond aliases and triggers, So I've started building myself a Gui, even though I was totally unfamiliar with lua until just before this. Read through all of the documentation I got my hands on Vyzor and Lua in general, and, well everything is going well, more or less due to me backwards engineering from Akayan GUI to help understand things better. Lack of tutorials or examples hurts. And I couldn't for the beast of it find the Sample Gui mentioned in earlier posts, must be blind.

Anyway, map went fine, and making the general layout and frames with backgrounds \ images is easy-peasy by now.
Real problem started with the Gauges. As soon as I add their code to the function. All but the borders dissappears. And well obviously they don't appear either. Can anyone guide me a bit here? :|

Code: Select all

	NioSys["HpFront"] = Vyzor.Frame( "HpFront" )
	NioSys.HpFront:Add( NioSys.BrightRedBG )
	NioSys["HpBack"] = Vyzor.Frame( "HpBack" )
	NioSys.HpBack:Add( Niosys.DarkRedBG )
	NioSys["HpOver"] = Vyzor.Frame( "HpOver" )
	NioSys.HpOver:Add( NioSys.WhiteBG )
	NioSys["HpGauge"] = Vyzor.Gauge( "HpGauge", "gmcp.Char.Vitals.hp", "gmcp.Char.Vitals.maxhp", NioSys.HpBack, NioSys.HpFront, LeftRight, NioSys.HpOver )
	NioSys.HpFrame:Add( NioSys.HpGauge )

	Vyzor.HUD:Draw()
NioSys.BrightRedBG , NioSys.DarkRedBG and NioSys.WhiteBG are all 'Background(Brush( Color )))' variables

And the HpFrame is a frame for the Hp Gauge with its position and transform setup to how I want the gauge to be in the end. Its also 4 frames deep inside the bottom border making it the fifth frame in. If that will help.

User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

Re: Vyzor, UI Manager for Mudlet

Post by Oneymus » Fri Feb 07, 2014 3:14 am

The first thing that stood out to me was the LeftRight in your constructor. Is that a variable you have set up? Or is it supposed to be Vyzor.GaugeFill.LeftRight? Also, you can just pass nil for that argument, as it defaults to GaugeFill.LeftRight.

If that's not the case, it would be helpful if you could get me a copy/paste from the error dialog when you run that script.

User avatar
Nioki
Posts: 10
Joined: Tue Feb 04, 2014 7:59 am

Re: Vyzor, UI Manager for Mudlet

Post by Nioki » Fri Feb 07, 2014 10:01 am

As soon as you pointed me to the error log, I kinda managed to fine three errors there myself :P one with syntax, one with the LeftRight, so I made it nil, and it seems like the HpOver overflow didn't work as well. Rereading the manual I saw that its supposed to be a table of frames.. but a table of how many frames then?

Also, since the question will need to be asked sooner or later:
I wanted to make a Balance gauge (achaea balance) that would be full when I have balance and when I lose balance it will go to zero and slowly regenerate to full up till balance is back, but I guess its impossible with the current Gauge component? So I'll just have to make a gauge out of frames myself then? Or is it possible :U


Oh and, is there a way to have mudlet to run through the script once again, and try redrawing everything, without me reloading the whole profile every time? Makes testing things that much difficult.

User avatar
keneanung
Site Admin
Posts: 93
Joined: Mon Mar 21, 2011 9:36 am
Discord: keneanung#2803

Re: Vyzor, UI Manager for Mudlet

Post by keneanung » Fri Feb 07, 2014 10:06 am

Duh! The LeftRight and HpOverflow things are what I told you on the achaean forums as well. And you said there were no errors in the error log :'(

I had no time to check this out myself yet, that's why I was silent.

User avatar
Nioki
Posts: 10
Joined: Tue Feb 04, 2014 7:59 am

Re: Vyzor, UI Manager for Mudlet

Post by Nioki » Fri Feb 07, 2014 10:40 am

keneanung wrote:Duh! The LeftRight and HpOverflow things are what I told you on the achaean forums as well. And you said there were no errors in the error log :'(

I had no time to check this out myself yet, that's why I was silent.
Well, I was mistaken, I thought the error log is the quick bug tip, so my mistake there, and yeah, I've been sitting on those till I noticed the Error log button separately for the debug. It was kinda weird though. And I wrote here first, just that post needed to be verified by admin or mod first, so it showed up only after I wrote on the achaean forums.
Aside from that, thanks a lot, at least got rid of part of it with your help keneanung.

User avatar
keneanung
Site Admin
Posts: 93
Joined: Mon Mar 21, 2011 9:36 am
Discord: keneanung#2803

Re: Vyzor, UI Manager for Mudlet

Post by keneanung » Fri Feb 07, 2014 11:14 am

As to answer your other questions:

Each frame in the overfill table will add another 100% to the gauge. Meaning if you put one frame into the table, you can differentiate up to 200%, with two frames it's 300% and so on.

The balance gauge is doable, if you exactly know the time it takes the balance to return. Say it takes 3 seconds to get balance back, then set the max value to 30. Every time you lose the balance, set the current value to 0 and have a timer that ticks each 100 milliseconds and add 1 to the current value and update the gauge. Once your balance returns, set the curent value to 30 and kill/stop the timer.

About the redrawing: I am not quite sure and it's been a while since I wrote my GUI, but it should depend on how you set the initialization up. If it is a script (outside any functions), each time you save the script it will be run. It might leave a whole lot of artifacts on the screen though (Frames, where you assigned the variables to new tables, but never removed them from the GUI etc.)

EDIT Typos and grammar

User avatar
Nioki
Posts: 10
Joined: Tue Feb 04, 2014 7:59 am

Re: Vyzor, UI Manager for Mudlet

Post by Nioki » Fri Feb 07, 2014 11:29 am

Okay, I'll test it out later today when I am at my pc. As for gauge updates I was under the impression that it should auto update. Might be the reason why my current gauges seem to be full all the time and dont update. Anyway, I'll try doing both redraw and the balance+update and hopefully the update script, if I manage to make one will work :p I'll update then

User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

Re: Vyzor, UI Manager for Mudlet

Post by Oneymus » Fri Feb 07, 2014 3:35 pm

Gauges don't automatically update. This removes any dependencies on specific events. It works this way mostly because Vyzor has no way of knowing, in any kind of automatic (rather, performant) method, if the values for the Gauge have changed. In order to update ALL Gauges, you can call VyzorGaugeUpdate(). Otherwise, to update an individual Gauge, you call the :Update() method on that Gauge.

The idea behind the Gauges is that they automatically grab the values by way of the table address you provided, so you don't have to pass them every time you want to update.

For the balance gauge, yes, keneanung has the right of it. You will need more logic, in case your timer is off. For instance, if you get balance back before the timer expires, do you need to kill the timer? If the timer is ahead of schedule, how should you account for that? Relevant questions, though their importance is subjective.

When I implemented some visual balance tracking, I did it with simple binary "lights". Effective, though it does lose the temporal granularity of a Gauge.

User avatar
Akaya
Posts: 412
Joined: Thu Apr 19, 2012 1:36 am

Re: Vyzor, UI Manager for Mudlet

Post by Akaya » Fri Feb 07, 2014 7:22 pm

Here's a Visual Balance Tracker for Achaea I wrote awhile back. Its written with Geyser but can be placed within a Vyzor UI (as shown in the video). http://forums.mudlet.org/viewtopic.php? ... =20#p16109

User avatar
Nioki
Posts: 10
Joined: Tue Feb 04, 2014 7:59 am

Re: Vyzor, UI Manager for Mudlet

Post by Nioki » Fri Feb 07, 2014 7:38 pm

Oh thanks, I'll try it out, for now will be epic, but I'll still want to figure more things out. Especially being a student in design, and kinda focusing a lot on UX - mudlet is a good base for projects :P Oh, and Akaya, I hope you don't mind that I used the code from your UI manager to figure some things out for myself ^^'

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest