News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Tutorial scenario reports script errors

Started by Matthew, April 02, 2024, 07:19:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

Steps to reproduce

1. Install Simutrans with pak128.
2. Load the tutorial scenario.
3. Note that all the tabs of the scenario briefing only contain the word "(null)"
4. Click on a building.

Expected result

The building's Info Window opens.

Actual result

The building's Info Window opens and so does an error window reporting "An error occurred within a script!"

Animated example



Setup
Simutrans 123.0.1 r10421
Steam
Kubuntu 22.04

Notes

I was alerted to this problem by this Reddit post from a new player.

I suspect that the tutorial is supposed to start with some kind of instruction, but it's so long since I've opened it that I'm not certain.

I don't know whether this bug is specific to the Steam version or not; I just happened to have the Steam version installed.

P.S. Nightly not affected?

I tried to reproduce this using the Nightly version provided via Steam, r11101. I could not, but I got a message saying "This Scenario is not compatible with your pakset or version of simutrans."
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Yona-TYT

I'm afraid you are using a very old simutras revision, according to the title bar it is using "r10421".

Screenshot_2024-04-02-21-14-33-690_com.android.chrome-edit.jpg

Yona-TYT

QuoteI tried to reproduce this using the Nightly version provided via Steam, r11101. I could not, but I got a message saying "This Scenario is not compatible with your pakset or version of simutrans."


I have a concern with the version comparator, it is possible that it may crash on steam or future versions.


I don't know how to test since I would only know when trying a new version of simutrans.

Matthew

Quote from: Yona-TYT on April 03, 2024, 01:17:46 AMI'm afraid you are using a very old simutras revision, according to the title bar it is using "r10421".

Screenshot_2024-04-02-21-14-33-690_com.android.chrome-edit.jpg

This is 123.0.1, which is the latest official release.

According to the scenario.nut file, Steam is distributing tutorial version 1.6.20.

Since they are both older versions, they should work together, shouldn't they?
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Yona-TYT

Quote from: Matthew on April 03, 2024, 11:02:23 PMThis is 123.0.1, which is the latest official release.

According to the scenario.nut file, Steam is distributing tutorial version 1.6.20.

Since they are both older versions, they should work together, shouldn't they?
Yes they should, but if the version comparison says that it is not compatible, it may be that in that version there was case sensitivity in the version names and pak128 changed to Pak128.

Matthew

I tried to play the tutorial on the new Simutrans 124 r11164 via Steam, running pak128 with tutorial version 1.6.51 beta, but I was unsuccessful:



This is on Linux.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Andarix

You can change the version in pak128/scenario/tutorial/scenario.nut line 116.

The tutorial in pak64 also contains version 123.0.1 instead of 124.0.

pak192.comic -> 122.0.1

Roboron

Is it really necessary to prevent the tutorial from loading if the game version is more recent?

Yona-TYT

#8
The expected behavior should be that all versions higher than that are loaded, for some reason this is not fulfilled

I'm going to check, this was really what I was afraid of. :-[

Edit

Unfortunately there was a problem in the text analyzer that determines if the version is correct or not, this is a basic function present in the other tutorials so I had to update all of them.

I feel very sorry for this, since until they update the script in the paksets the tutorial will not work. :-[

https://github.com/simutrans/tutorial_pak64/commit/04859d2b59d8cfed7d3583f91b48633ddecccc6c

Andarix

In many cases, users can also replace one file. Make the file available and indicate where it needs to be saved.

If this file is replaced in the zips of the package sets as soon as possible, that would be an advantage. The package sets do not have to be recreated for this.

Then a reinstallation is enough to fix it.

Roboron

I have updated the tutorial scenarios on Steam.

But this is probably worth a small bugfix release for those paksets.

Nevertheless, players getting paksets through the installer will still install the version released with Simutrans :-(

It would be cool if the installer actually fetched a remote pakset list, so you always install the latest version of a pakset without the need for us to update Simutrans as well. But that's a development for another day.


Yona-TYT


Matthew

Roboron, thank you for fixing this so quickly.

I have never seen the tutorial before. It's really great to see how cleverly it detects the learner's successes and failures. I have played games from big studios where the tutorial could not do that. Thank you to Dwachs (for the scripting system), Yona (for the tutorial), and anyone else responsible. I think it is a great help to new players, especially on Steam.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Yona-TYT

Quote from: Roboron on May 06, 2024, 12:08:38 PMA bug was reported on the steam forums https://steamcommunity.com/app/434520/discussions/0/4357872562129203939/
I have analyzed the situation and from what it says it seems that the [5/5] section was not displayed. I've already fixed it, I didn't find anything else out of the ordinary.

https://github.com/simutrans/pak128/commit/fcaa31b0434ff870aec0f28479b5ede48ff5eeb9

So far there have only been minor details with the texts, I thank the commands with which I do something similar to automated tests hehehe. :D

Roboron

Fantastic, I've updated the tutorial on Steam once again to include the recent fixes (for pak128 only).

Yona-TYT

In underground constructions, when the tunnel entrance is placed, it should show:

translate("Press [Ctrl] to build a tunnel entrance here")+" ("+start_tunn.tostring()+".)"
However this stopped working due to some changes in the simutrans code and the way the tunnels are built.


In order to get this working again I'm going to need a new function that lets me know if the [Ctrl] key is pressed.

Andarix

pak64 - 124.0

The class_chapter_07.nut file is different between pak64 SVN and Release Zip file.

Yona-TYT

Quote from: Andarix on May 08, 2024, 06:20:02 AMpak64 - 124.0

The class_chapter_07.nut file is different between pak64 SVN and Release Zip file.
This is strange, but I'm sure Prissi is now using the version directly from github, so there should be no problems next time.

prissi

The language update script now also updates the tutorial of pak64.

Yona-TYT

Quote from: Roboron on May 06, 2024, 09:59:51 AMI have updated the tutorial scenarios on Steam.

But this is probably worth a small bugfix release for those paksets.

Nevertheless, players getting paksets through the installer will still install the version released with Simutrans :-(

It would be cool if the installer actually fetched a remote pakset list, so you always install the latest version of a pakset without the need for us to update Simutrans as well. But that's a development for another day.
I completely agree with that idea, in fact supertux already does it like that! (maybe it's a good idea to look at their code for inspiration), let's hope that's the way forward for simutrans too.

Yona-TYT

Quote from: Andarix on May 05, 2024, 10:04:01 PMYou can change the version in pak128/scenario/tutorial/scenario.nut line 116.

The tutorial in pak64 also contains version 123.0.1 instead of 124.0.

pak192.comic -> 122.0.1

Today I just sent a significant improvement in the function that analyzes simutrans versions, it is much more robust and I hope it will remain functional for many years (unless the version numbering style in simutrans changes).

I have carried out various tests playing with version numbers and simulating all possible cases, but if anyone wants to help with more tests, welcome.

pak64: https://github.com/simutrans/tutorial_pak64/commit/250781ec803cf751419a51b69a197bf2fe734839
pak128: https://github.com/simutrans/pak128/commit/45fba552488b43f72d8ec21ce0672a0ac0db796d
pak192.comic: https://github.com/simutrans/tutorial_pak192.comic/commit/7cd172c5cc92f3b126a3a06a268f9472a543184f


Yona-TYT

Quote from: Roboron on May 13, 2024, 07:55:41 PMAnother error (and general feedback) https://steamcommunity.com/app/434520/discussions/0/4358999171570733692/?tscn=1715609064
It seems that there are problems with the coordinates, I thought I had solved them all but it seems that at some point some change in the API broke something, I'm going to investigate.


I think it mentions more problems, but I'll start by fixing this one.

Yona-TYT

#24
There is an error in the text variables in the pak128 tutorial: "chapter_03/08_3-3.txt"

{tx} Set the layer to <em>{lev}</em>, and connect the <em>tunnel</em> {t4} with the other entrance in {t5}.
To:
{tx} Set the layer to <em>{lev}</em>, and connect the <em>tunnel</em> {t1} with the other entrance in {t2}.
Edit.

I have fixed some problems with the list that shows the coordinates and layer levels, the mechanics worked wonderfully but the problem was only the visual part (the displayed texts).


Captura desde 2024-05-13 19-52-48.png


Edit 2.

Chapter 6

"/scenario/tutorial/en/chapter_06/goal.txt"
"/scenario/tutorial/es/chapter_06/goal.txt"

Command Script Link is not in its place.
<p>
{scr}
</p>

Edit 3.

He also discovered one of the strangest bugs that was in the tutorial, this has to do with the coordinates obtained from the city limits.

It seems that the coordinates obtained when the map is rotated are incorrect, to solve this I have had to implement a function to know in which direction the rotation of the current map is located.

https://github.com/simutrans/pak128/commit/9a355ac764d288c363ac9854dbfc70f40a6d5725
https://github.com/simutrans/pak128/commit/41de627c410eda58fb162e4809cf1ac692358692

function my_compass()
{
local c_max = {x = map_siz.x-1, y = map_siz.y-1}
local c = coord(0,0)
local text = c.tostring()

local res_c = {x = 0, y = 0}
local ttx = ""
local siz = text.len()
for(local j=0;j<siz;j++){
local tx = format("%c",text[j])
try {
tx.tointeger()
}
catch(ev) {
if(tx==","){
res_c.x = ttx.tointeger()
ttx = ""
continue
}
continue
}
ttx+=tx
if(j == siz-1){
res_c.y = ttx.tointeger()
}
}
//gui.add_message("Res: "+ res_c.x +" -- "+res_c.y)
//gui.add_message("MAX: "+ c_max.x +" -- "+c_max.y)
if(res_c.x == 0 && res_c.y == 0){
gui.add_message("N")
return 0
}
else if(res_c.x == c_max.y && res_c.y == 0){
gui.add_message("W")
return 1
}
else if(res_c.x == c_max.x && res_c.y == c_max.y){
gui.add_message("S")
return 2
}
else if(res_c.x == 0 && res_c.y == c_max.x){
gui.add_message("E")
return 3
}
return null
}

Yona-TYT

Completed v1.6.60 testing for all tutorials.

Change Log:

ADD Following Convoys in Chapter 2 Step D
Minor fixes in Chapter 3
Fix Chapter 7
Fix error when get coord form city limits (Chapter 7)
Update simutrans Version and fix string_analyzer()
(Using in Pak192.comic only) New functions to get build and way names

Tutorial-V1.6.60.png

On github you can find the most recent one.

https://github.com/simutrans/pak128/tree/master/pak128.prototype/scenario/tutorial
https://github.com/simutrans/tutorial_pak192.comic
https://github.com/simutrans/tutorial_pak64



prissi

SHould you mess with the toolbar on pak128: The numbers of all toolbars will change shortly, same for pak64 as part of menu restructuring.

Roboron

This is happening again with latest pak128 (nightly, not release)

tmp.png

Yona-TYT

Is that the Steam version? I tried it last night on Android and the version checker doesn't fail.

Roboron


Yona-TYT

Quote from: Roboron on June 03, 2024, 06:29:45 PMYes, it is.
Can you test if it works in the normal version of simutrans? Now I can't use the PC since there is no electricity.

I can only speculate that the version nomenclature is different on simutrans steam.

Roboron

Yes, it also happens with the "normal" version.

Yona-TYT

The stupid "0" in the version was not being recognized as integral, this seems to solve the problem.

https://github.com/simutrans/pak128/commit/48afddd11995b9edd3329bfcf1211a8abeffb417

Please check if this really solves the problem as I can't do it myself right now.

Roboron