The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on November 19, 2018, 06:15:21 AM

Title: [tutorial] Using the information bar
Post by: Yona-TYT on November 19, 2018, 06:15:21 AM
I would like to give the player the information he needs to advance to the next step at all times, the best way to do this is by using the information bar. The problem is that the window configuration for scenarios is by default [off].

Why not activate the information bar for scenario messages, or at least do it from the scrip ?.
(https://www.mediafire.com/convkey/75f2/r71lrfcf20b2w166g.jpg)
On the other hand, it would be very useful to be able to use links in the information bar, for example: A link that allows me to show the window of the scenario.
(https://www.mediafire.com/convkey/f056/rsp9szwn6l6d9ie6g.jpg)
It would be nice to be able to give more use to that informative bar.
Title: Re: [tutorial] Using the information bar
Post by: Leartin on November 19, 2018, 08:40:06 AM
Three thoughts:
1.) Is the newsticker, a location where the message disappears on it's own, really the best position for information that's supposed to be permanently on screen?
2.) If you intend to display the message in a loop, wouldn't that be really annoying if you were to use different display settings?

3.) This could be combined with requests for a chat feature. If there was a chat similar to basically every other game, you could always have it display the last few messages/lines in the bottom left corner. Rather than using the newsticker, the scenario could be allowed to send a chat message, which would then always be visible - at least in singleplayer games.
Title: Re: [tutorial] Using the information bar
Post by: Yona-TYT on November 19, 2018, 10:09:50 AM
Quote1.) Is the newsticker, a location where the message disappears on it's own, really the best position for information that is supposed to be permanently on screen?
It's the only way, "Pop-.up" windows are very annoying.
Quote
2.) If you intend to display the message in a loop, wouldn't that be really annoying if you were to use different display settings?
I do not think that's a problem.
Quote3.) This could be combined with requests for a chat feature. If there was a chat similar to basically every other game, you could always have it display the last few messages/lines in the bottom left corner. Rather than using the newsticker, the scenario could be allowed to send a chat message, which would then always be visible - at least in singleplayer games.
I have always wanted a window of information that appears in a lower corner and that hidden auomaticamente like that of open-ttd and other simulation games, but with the limited interface of simutrans, I doubt that this happens.

Title: Re: [tutorial] Using the information bar
Post by: Leartin on November 19, 2018, 11:00:24 AM
Quote from: Yona-TYT on November 19, 2018, 10:09:50 AM
It's the only way, "Pop-.up" windows are very annoying.[...]I do not think that's a problem.
I agree that the newsticker is a better place than popups, but you would need to ignore the users message settings, such that it's displayed in the ticker even if all messages are off, and not displayed as a popup even if that option is on. I don't think it's hard to do, but there are definitelly people who value their ability to decide whether and how messages are shown over the artistic expression of a scenario authors. I'm pointing it out for awareness, that's all.


Quote from: Yona-TYT on November 19, 2018, 10:09:50 AM
I have always wanted a window of information that appears in a lower corner and that hidden auomaticamente like that of open-ttd and other simulation games, but with the limited interface of simutrans, I doubt that this happens.
I mostly mentioned it for completions sake, not because I think it will be done (or has higher priority than other suggestions). I just like it when different suggestions compliment each other, rather then implementing several instances of a noncoherent minimum (which is still better than nothing, though)
Title: Re: [tutorial] Using the information bar
Post by: Yona-TYT on November 19, 2018, 05:57:48 PM
I like using "ticker::add_msg(text, pos, colorval);"  for show the message directly.
Title: Re: [tutorial] Using the information bar
Post by: prissi on November 20, 2018, 01:56:21 AM
The message bar is the wrong place for permanent messages. People may go to toilet and then miss it. Also identical messages may not displayed more than once, if it is already in the history. This was added to avoid cluttering the histroy bar.

Also there is the message history in the message window. Having tons of identical messages there is pointless. No, I think one should respect the user settings.
Title: Re: [tutorial] Using the information bar
Post by: Yona-TYT on November 21, 2018, 01:01:59 PM
This function to display a message without saturating the mailbox list and displayed directly:



//api_gui.cc

#include "../../simticker.h"




void_t add_newsticker(const char* text, koord pos )
{
   if (text) {
      ticker::add_msg(text, pos,  color_idx_to_rgb(COL_BLACK));
   }
   return void_t();
   
}




STATIC register_method(vm, add_newsticker, "add_newsticker");



This does not require having the mailbox configuration activated. ;) 

Edit .
I need help to get the coordinates (koor) from a text string. :-[


Title: Re: [tutorial] Using the information bar
Post by: Dwachs on November 21, 2018, 02:26:46 PM
Something like this will not be included. There is the message system. The user then can control, where these messages appear.
Title: Re: [tutorial] Using the information bar
Post by: Yona-TYT on November 21, 2018, 04:33:11 PM

Quote from: Dwachs on November 21, 2018, 02:26:46 PMSomething like this will not be included. There is the message system. The user then can control, where these messages appear.

And what would be the way forward to achieve this ?.[