The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on October 02, 2016, 03:34:02 AM

Title: Pop-ups why not ?.
Post by: Yona-TYT on October 02, 2016, 03:34:02 AM



I had mentioned this here: http://forum.simutrans.com/index.php?topic=15748.msg154543#msg154543  ;)


I always thought that this was possible, but when I started to experiment with the script, I found that there is no practical way to show pop-ups.


Perhaps there is a good reason for this is not it ?.  ???



Title: Re: Pop-ups why not ?.
Post by: DrSuperGood on October 02, 2016, 06:29:04 AM
Quote
Perhaps there is a good reason for this is not it ?.
The game currently lacks the functionality for popups like confirmations. Additionally anything that requires user input to make a logical decision (eg for scripting) requires net synchronization of the input events so that the same decision can be made on the same frame across all clients.
Title: Re: Pop-ups why not ?.
Post by: Dwachs on October 02, 2016, 11:47:40 AM
What are you trying to achieve? Just presenting a pop-up message?
Title: Re: Pop-ups why not ?.
Post by: Yona-TYT on October 02, 2016, 06:52:02 PM
Quote from: Dwachs on October 02, 2016, 11:47:40 AM
Just presenting a pop-up message?
Yes, display a pop-up message only.
Title: Re: Pop-ups why not ?.
Post by: Dwachs on October 06, 2016, 08:24:12 PM
Please try the new r7890. Please download the complete package (you need updated base scripts).

The method gui.add_message will send messages to all players, these messages land in the message center -> scneario.
In order to work properly (message get colored by player color), you need to set scenario.api to

scenario.api = "120.2"
Title: Re: Pop-ups why not ?.
Post by: Yona-TYT on October 08, 2016, 02:59:30 PM
Quote from: Dwachs on October 06, 2016, 08:24:12 PM
Please try the new r7890. Please download the complete package (you need updated base scripts).

The method gui.add_message will send messages to all players, these messages land in the message center -> scneario.
In order to work properly (message get colored by player color), you need to set scenario.api to

scenario.api = "120.2"


Thank you very much :thumbsup: [size=78%], but the truth I was referring to a simple warning window, such as return of "is_work_allowed_here (pl, tool_id, pos)" but can be called without having to make click. (as a print ()).[/size]


I want to use in the tutorial.
Title: Re: Pop-ups why not ?.
Post by: Yona-TYT on January 18, 2017, 01:34:51 PM
I do not know if this is possible, but it would be good to add a new parameter that allows to configure the display mode, zero can be the default value. ;)



Title: Re: Pop-ups why not ?.
Post by: Dwachs on January 18, 2017, 07:22:16 PM
I do not understand: add parameter to what? with which goal? what do you mean by display mode?
Title: Re: Pop-ups why not ?.
Post by: Yona-TYT on January 18, 2017, 08:51:45 PM
Quote from: Dwachs on January 18, 2017, 07:22:16 PM
add parameter to what?
To "gui.add_message"
Quote from: Dwachs on January 18, 2017, 07:22:16 PM
with which goal?
Choose how to display the message:
0-> Nothing changes.
1-> Is Displayed in the status bar.
2-> Is Displayed in a temporary window.
3-> Is Displayed in a permanent window.
Title: Re: Pop-ups why not ?.
Post by: An_dz on January 22, 2017, 04:06:18 PM
I thought the script could choose where to show the message, like:

show_msg(string msg, int place)

place = 0 // permanent window
place = 1 // temp window
place = 2 // ticker