News:

SimuTranslator
Make Simutrans speak your language.

tool_id = 4099? What tool is this?

Started by Yona-TYT, July 28, 2021, 04:53:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

tool_id = 4099? What tool is this? Why does it run without clicking and breaks into the tunnel construction? I think this is what is confusing me.

Dwachs

This is from terra forming the terrain for the tunnel portals.
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Quote from: Dwachs on August 23, 2021, 05:45:28 PMThis is from terra forming the terrain for the tunnel portals.
But I think it is not defined in the constants.

prissi

Any number larger than 4096 conatins the tool flag. 4096 indicates general tool, 9291 dialog tools and 0x4000 simple tools.

Dwachs

should be defined as constants tool_raise_land/tool_lower_land
Parsley, sage, rosemary, and maggikraut.

Andarix

Is there a way to determine the tool_id?

Apparently tool_exec_script and tool_exec_two_click_script do not work for script tools integrated with scripts(xyz) in toolbars.


I'm trying to test the pak64 tutorial in pak64.german.
It already works in automatic mode. But the menus are a bit crazy. The most serious error is that you can't build a post office because the post office buildings aren't displayed.

Yona-TYT

Quote from: Andarix on October 28, 2024, 12:12:56 PMApparently tool_exec_script and tool_exec_two_click_script do not work for script tools integrated with scripts(xyz) in toolbars.
I have been wanting to implement something like this for a while now so I can have more information about the tool currently in use:

I was hoping that this last one would be implemented: https://forum.simutrans.com/index.php/topic,23228.0.html

That would allow me to make many improvements to the tutorial.

Yona-TYT

test-tools.zip
Quote from: Andarix on October 28, 2024, 12:12:56 PMI'm trying to test the pak64 tutorial in pak64.german.
It already works in automatic mode. But the menus are a bit crazy. The most serious error is that you can't build a post office because the post office buildings aren't displayed.

I have a script tool that helps me identify menu ids, I'll check it out.
Captura de pantalla -2024-10-28 01-07-44.png

Yona-TYT

For pak64.german the menus are very different so I think more specific changes need to be made :

// placeholder for some menus icon
t_icon <- {road = 0x8006, rail = 0x8003, ship = 0x8007, plane = 0x8008, other = 0x8009, slope = 0x8001, tram = 0x8005}



Andarix

First of all, the mixed formatting with taps and spaces means that more lines are changed than were actually changed. I prefer spaces because tabs can be set to different widths. The Simutrans program code also uses spaces, which is why I set my editor up like this.



The current tool system in the tutorial script is very confusing and many things are duplicated. In the pull request I added a new file where the tools should be collected. The first function there should deactivate everything that is not used in the entire tutorial.

It is not yet fully aligned.

Instead of hiding the terrain tools individually, it would make more sense to hide the menu itself. I am still exploring this, as it is all written in a rather confusing way.

I have also stored the package data in a file, as this makes it easier to switch the tutorial between the packages.

https://github.com/simutrans/tutorial_pak64/pulls


Yona-TYT

Quote from: Andarix on October 30, 2024, 08:22:24 PMFirst of all, the mixed formatting with taps and spaces means that more lines are changed than were actually changed. I prefer spaces because tabs can be set to different widths. The Simutrans program code also uses spaces, which is why I set my editor up like this.



The current tool system in the tutorial script is very confusing and many things are duplicated. In the pull request I added a new file where the tools should be collected. The first function there should deactivate everything that is not used in the entire tutorial.

It is not yet fully aligned.

Instead of hiding the terrain tools individually, it would make more sense to hide the menu itself. I am still exploring this, as it is all written in a rather confusing way.

I have also stored the package data in a file, as this makes it easier to switch the tutorial between the packages.

https://github.com/simutrans/tutorial_pak64/pulls


That system is part of the original tutorial, it's really confusing, that's why it took me so long to implement the diffusion of icons in the menus.

The rules I follow with this are:
  • The tools and menus appear as you advance in the tutorial.
  • Each chapter advance deactivates all the menus of the previous one.
  • In the chapter, the tools previously used only darken/blur but are never hidden (until you advance to the next chapter).

Andarix

new partial pull request

@Yona
Can you please add the tools with 4xxx number to the tool_id_list.ods?

Yona-TYT

#14
(The forum should support "CSV" file extensions to attach such files)

Quote from: Andarix on October 31, 2024, 06:25:23 PMnew partial pull request

@Yona
Can you please add the tools with 4xxx number to the tool_id_list.ods?
I don't quite understand what you're asking me, so I made a list for each case:

Hex (pak64):
0x1000,0x1001,0x1002,0x1003,0x1004,0x1005,0x1027,0x100e,0x100f,0x1010,0x1011,0x1012,0x1021,0x1014,0x1007,0x1015,0x1013,0x100b,0x1008,0x1006,0x101f,0x1020,0x1029,0x1028,0x1023,0x101e,0x1026,
Base 10 (pak64):
4096,4097,4098,4099,4100,4101,4135,4110,4111,4112,4113,4114,4129,4116,4103,4117,4115,4107,4104,4102,4127,4128,4137,4136,4131,4126,4134,
Hex (pak64.german):
0x1000,0x1001,0x1002,0x1003,0x1004,0x1005,0x1013,0x100e,0x1023,0x100b,0x101e,0x1006,0x101f,0x1029,0x1020,0x1028,0x1010,0x1012,0x1021,0x1014,0x1011,0x1008,0x1007,0x100f,0x1015,0x1026,0x1027,
Base 10 (pak64.german):
4096,4097,4098,4099,4100,4101,4115,4110,4131,4107,4126,4102,4127,4137,4128,4136,4112,4114,4129,4116,4113,4104,4103,4111,4117,4134,4135,
Edit.
I made a list with their respective names for the tools I request, I did this in pak64.german:
List_tools_pak64german.txt (Change the extension to CSV).



Isaac Eiland-Hall



Andarix

Chapter 2 should now work with the new system.

In pak64, however, the extensions of stations are also displayed. I don't yet know how to distinguish between stations and extensions.

https://github.com/simutrans/tutorial_pak64/pull/9

Yona-TYT

Quote from: Andarix on November 01, 2024, 10:08:08 AMChapter 2 should now work with the new system.

In pak64, however, the extensions of stations are also displayed. I don't yet know how to distinguish between stations and extensions.

https://github.com/simutrans/tutorial_pak64/pull/9
Station buildings cannot be differentiated since they have the same waytype (I correct myself, in some cases the waytype <= 0, so they can be filtered)
 and the same tool_id as a stop. There is a parameter that identifies when they are buildings, but I'm afraid it is not sent to the script API, the same happens with the system_type.

However, to hide extension buildings, in some cases it works by filtering by: waytype < 0

Andarix

Well, in pak64.german, stations and extensions have been distributed to their own menus. That makes things easier now.

Currently, there still seem to be problems with darkening/blurring tools.

But the review of the display of tools has priority for now. I hope what I write is easier for you to understand than what has been written so far.

Yona-TYT

function start_chapter() //Start only once per chapter and start game
I think general_disabled_tools(player_x.nr) and chapter_step_enabled_tools(player_x.nr) should also be called from start_chapter() because it is executed at game start and when there is a change between chapters (That includes when a vehicle is removed).

Currently there is a problem, and that is that the tools are not updated when I load a savegame in chapter 3, st 2.

Andarix

Add chapter_step_enabled_tools( pl ) end of chapter_disabled_tools( pl ) shold solved this.

Andarix

From my side, the tool review is complete.

However, I have not tested all of the tools. Some further work may be required.

I hope that the tool manipulation is now a little easier to understand.


Yona-TYT

https://github.com/simutrans/tutorial_pak64/commit/4dd149eaede04549c25cb18f0203fde89ba105e6
Chapter 5 is a bit confusing with the tools, but the idea is to keep the previously used tools, does this mess up the menus in pak64.german?.

Here is a screenshot of what the menus look like in pak64 with this change:
Captura de pantalla -2024-11-03 16-49-13.png

Yona-TYT

In chapter 6 wt_power is not used, it is only used in chapter 5.

I made the following changes but I'm not sure if this is correct.

https://github.com/simutrans/tutorial_pak64/commit/afa47c5c10a18b870ec0dac7ab7554b4ab68047f

The result in the menus is as expected so for me it's fine like this:
Captura de pantalla -2024-11-03 17-24-07.png

Andarix

There are no differences between the paksets for the tools themselves.

However, the Powerline tools have their own menu in pak64.german. They are no longer included in the special tools, which is why they do not have to be disabled if the Powerline menu is disabled. But it doesn't matter.

There are differences in the menus.

Yona-TYT

Quote from: Andarix on November 03, 2024, 10:19:50 PMThere are no differences between the paksets for the tools themselves.

However, the Powerline tools have their own menu in pak64.german. They are no longer included in the special tools, which is why they do not have to be disabled if the Powerline menu is disabled. But it doesn't matter.

There are differences in the menus.

The menus in pak64 look good now, however I haven't been able to test with pak64.german due to the difference with the industrial chain.

I'll wait for some beta version of the pak in the future.

Andarix

During my test I found 2 errors in the menus in pak64.german.

Chapter 3 Step 8
The slope tools are not displayed. The tools needed to raise the tracks are also in the underground menu. However, the text says that they are the slope tools.

Chapter 4 Step B
The ship tools are not displayed.

[EDIT]
After saving and writing here the shiptools are now displayed.
strange

Andarix

Quote from: Yona-TYT on November 03, 2024, 10:52:29 PMThe menus in pak64 look good now, however I haven't been able to test with pak64.german due to the difference with the industrial chain.

...

If these factories are missing, it is not a problem.

Screenshot 2024-11-04 003502.jpg

Unfortunately, the map has double heights, which results in an ugly landscape when loading with one height. It will take some time to adapt the surface.

Yona-TYT

Quote from: Andarix on November 03, 2024, 11:25:09 PMThe slope tools are not displayed. The tools needed to raise the tracks are also in the underground menu. However, the text says that they are the slope tools.
https://github.com/simutrans/tutorial_pak64/commit/e704fc99e75057873fbf6c1e4cf7832a1c91ddb6

I think that fixes the slopes for step H.

Additionally the tools are not used in the tutorial:
                          tool_raise_land,
                          tool_lower_land,
                          tool_restoreslope

Andarix

fix for transformer in pak64.german

chapter 5 step C transformer 3

https://github.com/simutrans/tutorial_pak64/pull/13

Andarix

I have a problem in Chapter 6 Step D with pak64.german

The icon for the list tools is displayed as inactive.
And the icon for the road tools (0x800e) is not displayed.
The icon for the special tools is not displayed as inactive.