Awards GS

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Awards GS

Post by Zuu »

krinn wrote:Zuu speak about that too, i use it myself to update Zuu script language file, but i wasn't sure anyone have interest in that (with my script i mean).
I will look into adding that.

edit: Add it thru eints, there : https://translator.openttdcoop.org/project/gs-awards
Great!

However, some of your native strings show up as "invalid". When trying to translate any of those the web translator throws an fatal error on you. The invalid strings are shown at the bottom of this page:
https://translator.openttdcoop.org/tran ... ards/en_GB

If you want to make it more translator-friendly, try to move your OPT-strings out of the translation system and put these configuration options elsewhere so that a translator do not need to go through everyone of these empty strings that don't need any translation.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Awards GS

Post by planetmaker »

You should try to add the proper and required plurals definition to the lang files. It might fix all the validation errors.
Attachments
add_proper_plural_definition.diff
(766 Bytes) Downloaded 162 times
Mtlbss
Engineer
Engineer
Posts: 10
Joined: 29 Aug 2013 22:37

Re: Awards GS

Post by Mtlbss »

Hi, thanks a lot for this funy script, I put it on my server, I played it, and we like it too much really good job....^^
I use it too when my scenario script is bugged, bcse awards script work even on bugged scenario, that is really good bcse sometimes i passe long momment to create a scenario, then i can played it no more when some script is bugged, but with this one that can work once more, only a bug appear in the console but not kill the game the famous "dbg: [misc] String too long for destination buffer" i'm not reporting this bug bcse it's my fault and that's not really important game work good with it thx thx thx^^
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Awards GS

Post by krinn »

Thank you for the message, always a pleasure to see someone happy using it.
I'll update to a new version this week to add latest language files update (nothing really new).
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Awards GS

Post by krinn »

Ok added version 3 with some langages update and new languages (wow, good work translators!)
It actually fix a bug that prevent periodicmonth settings to work.
User avatar
te_lanus
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 19 Jul 2012 18:04
Location: The Elizabeth Arkham Asylum for the Criminally Insane

Re: Awards GS

Post by te_lanus »

Thanx. Will test it a bt tonight
User avatar
te_lanus
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 19 Jul 2012 18:04
Location: The Elizabeth Arkham Asylum for the Criminally Insane

Re: Awards GS

Post by te_lanus »

Found a bug

It runs up to 2kx2k but I tried it at 4kx2k (and 2kx4k) it crashes with an error (didn't get time to test 4kx4k)

PS. Tested with 4kx4k and same crash happens
Attachments
Onbenaam,%201ste%20Jan%201990.png
(468.01 KiB) Downloaded 4 times
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Awards GS

Post by krinn »

Found the reason, script is running too early and start checking awards while no company exists yet.
I'm thinking of way howto solve that (wait for map generation to end, check if any company exists before starting...)

Thanks for reporting that ;)
Last edited by krinn on 13 Aug 2014 15:51, edited 1 time in total.
User avatar
te_lanus
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 19 Jul 2012 18:04
Location: The Elizabeth Arkham Asylum for the Criminally Insane

Re: Awards GS

Post by te_lanus »

Hi

Tested the new one, and couldn't reproduce the crash.

But I found this: seems it's not "save friendly". I get that on the reward page's text seems to get "doubled" upon saving and loading (see screenshot)
Attachments
Bloggs%20%26%20Co.,%206de%20Jan%202005.png
(446.51 KiB) Downloaded 2 times
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Awards GS

Post by krinn »

When saved, companies record where awards are in their own pages, that's something i've done to fix this times ago (because openttd always record the company page infos and restore them itself when loading, so you must rewrite what was done to fix it).
So this time, i really don't know how it could happen without the savegame, as i'm unable to reproduce it when i save/load a game here.
User avatar
te_lanus
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 19 Jul 2012 18:04
Location: The Elizabeth Arkham Asylum for the Criminally Insane

Re: Awards GS

Post by te_lanus »

Here is a small savegame that also display the error
Attachments
Hamilton%20%26%20Co.,%2015de%20Jul%202000.sav
(331.89 KiB) Downloaded 149 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Awards GS

Post by Zuu »

FYI: Using GSStoryPageList (added shortly before 1.4 was branched off), it is now possible to choose to upon load delete all pages and re-build the book if you wish to take that path.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Awards GS

Post by krinn »

Thank you Zuu, going to look at it and see if i can do something with that :)
te_lanus: thx for the savegame, will see if i can find the cause.
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Awards GS

Post by krinn »

Ok te_lanus found out what is was :
When running without the "HiddenAwards" option, the game when loading re-display all awards. I have indeed record the awards element position in the savegame, just that i didn't catch that when the option is turn off, the awards were display before i have loaded their position.
So browsing thru page, my script found out it must display an award and no element exists (erf didn't load the datas with element value at that time) for it, display it and record where it is display.

The good news : so it is fixed and it should stop creating awards again and again but update the ones that are already shown. The problem is that it will not remove any and just update the latest ones in the savegame. It mean i'm sorry your savegame will stay as-is, no new awards will be create when loading, but old unused ones will stay and will not be update.
Zuu suggestion can help, i could remove all elements and clean up all pages, but i will lost medals info as well. That's something i cannot do, because i record medals owner, as if a company own a medal, even if the company collapse the medal has been own and cannot be own again and the display will never get update to keep the medal own, it allow also the game running with hidden awards to not display the award to a company create after it has been found by someone else.
So i just prefer keep like i made it and newer game won't (shouldn't) get affected. But it mean yours will stay corrupt.
I will look at one more stuff i need to change and release the v4 with the fixes for the errors you've found.
Thank you for trying and reporting them. Here's a new v4 with both fixes in it.
Attachments
awards.4.tar
(210 KiB) Downloaded 134 times
User avatar
te_lanus
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 19 Jul 2012 18:04
Location: The Elizabeth Arkham Asylum for the Criminally Insane

Re: Awards GS

Post by te_lanus »

Thanx krinn

Just tested it with a quick game and seems the problem has been fixed
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Awards GS

Post by krinn »

Thank you, i have update awards to disable date display (thanks Zuu for API update!), will push the v4 update with a few more awards (i plan to add 2-3 more).
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Awards GS

Post by J0anJosep »

This string doesn't sound good to me:
str_news.png
str_news.png (42.98 KiB) Viewed 5625 times
Instead of a normal space between number and points you can use the {NBSP} (non-breaking space) to make it look better. That is just a suggestion, but not a problem.
As for the other things I marked, I am not a native speaker to help you on those.

Anyway, there are three (invalid) strings that contain CROSS, RIGHT_ARROW and CHECKMARK commands. I wouldn't use them, as they are strongly GUI related.
Formerly known as Juanjo
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Awards GS

Post by krinn »

Juanjo wrote:This string doesn't sound good to me:
str_news.png
Instead of a normal space between number and points you can use the {NBSP} (non-breaking space) to make it look better. That is just a suggestion, but not a problem.
As for the other things I marked, I am not a native speaker to help you on those.

Anyway, there are three (invalid) strings that contain CROSS, RIGHT_ARROW and CHECKMARK commands. I wouldn't use them, as they are strongly GUI related.

I know for the invalid strings but they are not invalid : http://hg.openttd.org/openttd/trunk.hg/ ... bles.h#l39 they are just dislike by the translator, but the script is not made for the translator but for openttd, so as long as openttd is happy with it. I know some newGRF may change that, but a newGRF that would change a checkmark sign with a cat would be the one that is making mistake. They are CROSS, RIGHT_ARROW... so any newGRF should replace them with CROSS, RIGHT_ARROW... but not something unreleated to their GUI nature.

But you can adapt to your language any changes you wish, i'm not really picky with that, if you add {NBSP} ... in your own language file, fine for me, as long as other speakers of that language doesn't complain. You can even alter the CROSS... stuff with something different. As long as the file remain "valid" for openttd (because an invalid spanish.txt would prevent the script to load for any users, even not spanish ones) and that nobody complains about your changes (do not change them all, only in your own native language). Really fine for me! I will keep them and next release your default language will display your changes. Any language i don't handle myself, i'm not looking if anything is right or wrong or any changes in them, still as long as openttd is able to start the script).
The only changes i have made to someone translatation is : http://dev.openttdcoop.org/projects/gs- ... f504182c6f

for the "has gain" trouble, i'm also not english speaker, and i made that english.txt, so it might be an error, but if i wrote it like that it's because i was thinking it was right. So i'm not really able to fix it, english or better english speaker could tell.

And thank you for your efforts at translating the script Juanjo and other translators. I appreciate it.
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Awards GS

Post by J0anJosep »

The developers of the translator tool only accepted these commands: http://bundles.openttdcoop.org/eints/ni ... g-commands

You can ask them to add CROSS and the others. In my opinion, these weren't accepted because they are related to GUI and better not to be used by scripts.

GS Awards and BigGUI:
biggui.png
biggui.png (25.27 KiB) Viewed 5608 times
Formerly known as Juanjo
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Awards GS

Post by krinn »

Update awards to v5 with a new setting for BigGUI users to disable special signs output, merge latest language update and throw a warning if you use an openttd version with bug when handling list (only show in console).
Juanjo : the new setting can be change in game to fix older savegame, but it doesn't redraw all awards, so you must wait for it to propagate to all awards. And it will never be applied to medals already earn.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Semrush [Bot] and 5 guests