News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Tutorial - code review

Started by Andarix, May 15, 2025, 01:22:00 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Andarix

Quote from: Yona-TYT on May 15, 2025, 03:00:20 AMOk, I made the necessary changes to the "code_review" branch, and I also had to add another text file to step 7.

https://github.com/simutrans/tutorial_multipak/commit/5f75194943825323b5a53aba19e4cf5c80d5574c
https://github.com/simutrans/tutorial_multipak/commit/0aba71fec34e234ee67d943a0ec8e4d5a386819a



Additional note: The "cov_sw" flag that indicates whether the number of convoys in circulation is correct or not, seems to not be working in "code_review", as a result, when I delete the vehicle, the info in the scene window is no longer coherent.

        if (!cov_sw){
          text = ttextfile("chapter_02/07_3-4.txt")
          text.tx = ttext("<em>[3/4]</em>")

          local tile = my_tile(city2_halt_1[city2_halt_1.len()-1])
          text.stnam = ""+city2_halt_1.len()+") "+tile.get_halt().get_name()+" ("+coord_to_string(tile)+")"

          text.list = create_halt_list(city2_halt_1)
          text.nr = siz
        }




Are you sure it worked before?

cov_sw is initialized to true in scenario.nut.

It is evaluated once in Chapter 2. It is evaluated four times in Chapter 3.

A search of all files did not yield any further entries.

I haven't actually changed anything about that.

Yona-TYT

I need to review all of that. I'd also like to change the text labels to unowned, only in places where they can be used, of course.

@Andarix, I hope this doesn't hinder or harm your work. If so, please let me know, and I'll postpone this for another time.

@Prissi, I'm wondering if it's possible to use unowned text labels on player-owned roads/rails? If so, then I'll open an extension request.

Andarix

Quote from: Yona-TYT on May 16, 2025, 05:49:16 PM...
@Andarix, I hope this doesn't hinder or harm your work. If so, please let me know, and I'll postpone this for another time.
...

I've completed chapters 1 through 3 regarding the changes to the maps.

My tests with pak64 didn't cause any more errors. However, I only tested for correct functionality.

Yona-TYT

#3
There are several changes regarding moving "Follow Vehicle" to step 7: https://github.com/simutrans/tutorial_multipak/commit/0aba71fec34e234ee67d943a0ec8e4d5a386819a

cov_sw was actually a dead variable; the one that should be used in these cases is called correct_cov.
Fix here: https://github.com/simutrans/tutorial_multipak/commit/d6e0b8f54b3628a8eaae7f6cd6a4e0dab06a5cfe


Prissi did some cleanup on the "Schedule" code, and I've now moved her changes to the "code review" branch. Thanks a lot for your input @Prissi 8)
https://github.com/simutrans/tutorial_multipak/commit/73f960d1a577a2e22028388f2253964273989f7e


Edit.

You need to adjust the info in step 6 so that "text.list = create_schedule_list(city1_halt_2)" is used instead of "st1, st2 ...".

Screenshot 2025-05-21 at 12-02-42 .png

Andarix

chapter 5

I've revised the substations a bit and removed various tile definitions. However, the automatic tile search isn't complete yet.

I think we should be a bit more flexible with the post office extensions. Several sets also include post office stops. Therefore, I would rather allow both the extension with a post office building and the extension with a post stop.

The check has been changed so that the stop accepts mail.

Yona-TYT

Quote from: Andarix on May 27, 2025, 02:46:46 PMI think we should be a bit more flexible with the post office extensions. Several sets also include post office stops. Therefore, I would rather allow both the extension with a post office building and the extension with a post stop.


In fact, in pak192.comic's tutorial, the mechanics are a bit different, as it uses a combination of post buildings and post stops. I like the idea of combining both options . 8)

Andarix

Quote from: Yona-TYT on May 21, 2025, 03:38:59 PM...
Prissi did some cleanup on the "Schedule" code, and I've now moved her changes to the "code review" branch. Thanks a lot for your input @Prissi 8)
https://github.com/simutrans/tutorial_multipak/commit/73f960d1a577a2e22028388f2253964273989f7e
...

I think these changes aren't working correctly.

I can no longer create timetables.

However, it works in the release version of the tutorial.

Yona-TYT

Quote from: Andarix on May 27, 2025, 10:40:39 PMI think these changes aren't working correctly.

I can no longer create timetables.

However, it works in the release version of the tutorial.
I tried the first bus and it seems to work fine, where exactly is it failing?.

Andarix

#8
When I buy a vehicle from the depot, the vehicle isn't displayed at the top.

If I switch to the vehicle at the top, I can't access a new route. The timetable window doesn't open, and the field jumps back.

It's time for others to test the new code. Unpack the zip file to [pakset]/scenario and then select "Load Scenario".

errors

Chapter 2 step 4 texts are not correct because this was not changed on the translation page.
[edit]
chapter 2 step 6 1/2 text error halt list


[edit]
delete attaches files

new files here

Andarix

Quote from: Yona-TYT on May 27, 2025, 10:58:54 PMI tried the first bus and it seems to work fine, where exactly is it failing?.

It's possible that all the testing has caused some confusion.

Andarix

#10
bugfix version


[edit]

reupload files

Yona-TYT

It seems that this is a bad character, and there may be translation errors because of this.IMG_20250529_084944_251.jpg

Andarix

Quote from: Yona-TYT on May 29, 2025, 12:51:44 PMIt seems that this is a bad character, and there may be translation errors because of this.
...

Then take a look at Simutrans's es.tab.

Simutrans uses this symbol to mark UTF-8 translation files.

Andarix

Quote from: Andarix on May 28, 2025, 07:02:49 AM...
It's time for others to test the new code. Unpack the zip file to [pakset]/scenario and then select "Load Scenario".
....


no feedback = no bugs

 :)

Yona-TYT

Quote from: Andarix on June 07, 2025, 08:38:15 AMno feedback = no bugs

 :)
I haven't had much time to test, I'm afraid 😞

Isaac Eiland-Hall

Quote from: Andarix on June 07, 2025, 08:38:15 AMno feedback = no bugs

 :)

Soooo, if we shut down the forum, no more bugs! :hunts around for the delete command: ;-)