Message Separator widget - Page 5

Message Separator widget

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

@chlue

On startup, the widget handler calls a function in the script that returns a table of configuration data to save, but the table doesn't actually get filled until shutdown (at which point the function is called a second time). This means that if Spring crashes in any way, the second function call doesn't take place and your settings get overwritten by the contents of an empty table (ie. nothing).

As for the settings you listed: those variables are not user-configurable (in the sense that they aren't tied to key commands), so saving them isn't very useful. Besides, if someone wants to change them, editing the source is easy enough (as you did).


@Noize

Example messages?
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Post by NOiZE »

Example:


Hello i r a core fanboi, arm pussy's will not win this war, because core is the greatest, because they are the pwners, and arm is the suckyniss. so core will win hurray!!!!


:-)
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Of course a message like that is getting dropped or cut off. It's needless mindless (soulless?) pro-core propaganda. I propose that people who post this kind of drivel get all their messages dropped. :P
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Post by ZellSF »

NOiZE wrote:Example:


Hello i r a core fanboi, arm pussy's will not win this war, because core is the greatest, because they are the pwners, and arm is the suckyniss. so core will win hurray!!!!


:-)
Hello there message that displays perfectly here.
I wrote:Read the list over hotkeys again.
And again


(if it really is a bug that only you run into for some weird reason, maybe say if it's horizontal or vertical wrapping?)
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Post by NOiZE »

well it does not cut off every time


it does wrap nicely




But more annoying sometimes all messages disapear, because the oldest message disappears

am i making sense?
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

I noticed that also.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

But more annoying sometimes all messages disapear, because the oldest message disappears
Please be more clear about this, what do you mean by "oldest message disappears"? The automatic visual wiping that happens after typing some lines and then waiting a few seconds? Or something else (and if so, how do I reproduce it)?
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Basically the problem is all messages disappear at the same time, whereas in the default message box they disappeared separately (after each one timed out). So, type a bunch of lines of text so your box fills up, then it all will disappear at once, rather than based on the time after each line was typed.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Well, the boxes are cleared a fixed amount of frames after the arrival of the most *recent* message, so by the time they all disappear (which happens if no new ones came in for 15 seconds) you should have had plenty of opportunity to read them... and if you didn't, either increase the timeout (DELAY_BEFORE_CLEAR) period or turn on scrolling.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

hey kloot,

I just pressed Ctrl+P midgame and it kinda crashed my Lua.. Whenever the message log was shown, my widgets disappeared (aka error). Since your widget threw errors, I couldn't see any messages after that event.. Quote from the logs:
<[LCC]LordMatt[1st]> well, maybe this needs to be an undocumented easter egg for now ;)
{MessageSeparator} transparent rendering disabled
{MessageSeparator} transparent rendering enabled
{MessageSeparator} font-outlining disabled
<[LCC]LordMatt[1st]> but if u wanted to write it up
{MessageSeparator} font-outlining enabled
<[LCC]LordMatt[1st]> I would be happy to include it
{MessageSeparator} message wrapping enabled
error = 1, Call_DrawScreenItems, LuaUI\Widgets\gui_MessageSeparator.lua:859: attempt to index field `?' (a nil value)
error = 1, Call_DrawScreenItems, LuaUI\Widgets\gui_MessageSeparator.lua:859: attempt to index field `?' (a nil value)
edit: PS: the first line was cut.. so there was a long line on the screen while I pressed Ctrl+P

Hmm.. Second try and it even crashed when it was enabled before a long message.. But Matt couldn't replicate the error.. Here are my settings:

Code: Select all

	["Message Separator"] = {},
Hmm.. I thought, I changed some stuff.. But this is what widget_data.lua says..

Well, have fun fixing.. I'm off snowboarding for a week now..
User avatar
Blah64
Posts: 31
Joined: 09 Jul 2006, 04:02

Post by Blah64 »

my main problem, is that nearly every other game, it doesn't work. I'll have no box, but when i disable it the normal box comes back. I have to completely restart the battle to get it to work
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

I also had what happened to Blah64 happen to me.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Post by BrainDamage »

Blah64 wrote: I have to completely restart the battle to get it to work
have you tried

Code: Select all

/luaui restart
from the game chat?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

As I said, if Spring crashes for whatever reason rather than being closed properly, you'll end up with an empty settings table because the function that tells the widget handler what to write to widget_data.lua is only called once in those cases, whereas it's normally called twice (once on startup and once on shutdown) but doesn't return the actual data until call #2. The upshot of that is that your settings are reset, which is annoying but not really avoidable TBH. It cannot (under any circumstances) cause the boxes to disappear however, so I ask anyone who has that issue to post their config-data and contents of infolog.txt here for analysis.

In related news, I'm currently overhauling the message-wrapping code, so ctrl+p should be a bit safer to use soon. ;)
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Post by NOiZE »

Kloot wrote:Well, the boxes are cleared a fixed amount of frames after the arrival of the most *recent* message, so by the time they all disappear (which happens if no new ones came in for 15 seconds) you should have had plenty of opportunity to read them... and if you didn't, either increase the timeout (DELAY_BEFORE_CLEAR) period or turn on scrolling.
i´m quite sure this does not work really perfect, some messages are being displayed less then a second.

Looks more like it counts from the oldest visable message.
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

/me applauds Kloot. Excellent widget!

It would be great if you could find a different way of changing the settings though. All those keyboard shortcuts is the only thing that lets this widget down in my opinion.

Perhaps a single keyboard/mouse shortcut/combi could toggle a "config" panel instead?
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Post by Licho »

Can someone please fix this for spring 75?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

updated for 0.75 (see first post for link)
Last edited by Kloot on 28 Dec 2007, 01:25, edited 1 time in total.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Can you do something about this taking up half your screen with solid grey boxes? Tweakmode can't move them!
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

No, but you can. ;) See the top of the script for a complete list of keyboard commands, control + g and control + e will let you drag and resize the boxes yourself.
Post Reply

Return to “Lua Scripts”