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.
This is from terra forming the terrain for the tunnel portals.
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.
Any number larger than 4096 conatins the tool flag. 4096 indicates general tool, 9291 dialog tools and 0x4000 simple tools.
should be defined as constants tool_raise_land/tool_lower_land
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.
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.
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
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}
Added list for tool ids
https://github.com/simutrans/tutorial_pak64/pulls (https://github.com/simutrans/tutorial_pak64/pulls)
Quote from: Andarix on October 30, 2024, 05:21:22 PMAdded list for tool ids
https://github.com/simutrans/tutorial_pak64/pulls (https://github.com/simutrans/tutorial_pak64/pulls)
This is great! Thank you very much for your great contribution. 8)
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 (https://github.com/simutrans/tutorial_pak64/pulls)
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 (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).
new partial pull request (https://github.com/simutrans/tutorial_pak64/pull/8)
@Yona
Can you please add the tools with 4xxx number to the tool_id_list.ods?
(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 (https://github.com/simutrans/tutorial_pak64/pull/8)
@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).
thanks
And pak64:
List_tools_pak64.txt
Quote from: Yona-TYT on October 31, 2024, 09:13:48 PM(The forum should support "CSV" file extensions to attach such files)
(https://i.imgur.com/iU3Vksn.png)
https://i.imgur.com/iU3Vksn.png
(Added :) )
Quote from: Isaac Eiland-Hall on November 01, 2024, 02:44:58 AM(https://i.imgur.com/iU3Vksn.png)
https://i.imgur.com/iU3Vksn.png
(Added :) )
Great!. 🎉🎉🎉🎉
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 (https://github.com/simutrans/tutorial_pak64/pull/9)
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 (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
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.
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.
Add chapter_step_enabled_tools( pl ) end of chapter_disabled_tools( pl ) shold solved this.
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.
https://github.com/simutrans/tutorial_pak64/commit/3b80779bbe55d52315421dc78484352cff1a666c
Add the tunnels in step F and the signs in step I.
Edit.
Remove tool in CH2
https://github.com/simutrans/tutorial_pak64/commit/111a04dad8abd1fc4e6a2c0414b5c7130fc635ea
Edit2.
Remove and Remove Way in CHP3
https://github.com/simutrans/tutorial_pak64/commit/50677436e547ad73d1f30cbfb1d0f901b5736ec4
Edit3.
Remove and Way tool in CP4
https://github.com/simutrans/tutorial_pak64/commit/ee96ad600e56ba398145fa0dc128b2bb2a8854d7
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
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
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.
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.
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
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.
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
fix for transformer in pak64.german
chapter 5 step C transformer 3
https://github.com/simutrans/tutorial_pak64/pull/13 (https://github.com/simutrans/tutorial_pak64/pull/13)
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.
Quote from: Andarix on November 04, 2024, 10:39:46 AMThe icon for the list tools is displayed as inactive.
Quote from: Andarix on November 04, 2024, 10:39:46 AMThe icon for the special tools is not displayed as inactive.
https://github.com/simutrans/tutorial_pak64/commit/0ca3aefc4326d39cb36e187c482932f8cf7a3f1c
There was a bad id.
Quote from: Andarix on November 04, 2024, 10:39:46 AMAnd the icon for the road tools (0x800e) is not displayed.
This is strange, even returning true in function is_tool_allowed(pl, tool_id, wt) in chapter 6, the roads menu does not appear. :(
Quote from: Yona-TYT on November 04, 2024, 11:46:46 AM...
This is strange, even returning true in function is_tool_allowed(pl, tool_id, wt) in chapter 6, the roads menu does not appear. :(
I don't know why the activation doesn't work. I removed the icon from the block list.
https://github.com/simutrans/tutorial_pak64/pull/14 (https://github.com/simutrans/tutorial_pak64/pull/14)
Quote from: Andarix on November 04, 2024, 01:03:48 PMI don't know why the activation doesn't work. I removed the icon from the block list.
https://github.com/simutrans/tutorial_pak64/pull/14 (https://github.com/simutrans/tutorial_pak64/pull/14)
I tried to fix that, if it doesn't work please let me know.
https://github.com/simutrans/tutorial_pak64/commit/e3a219483e3ff1d58111c6169b06012b4eb373c8
class_chapter_07.nut
line 18 define
t_allowed_list = [
tool_build_way, tool_build_station, tool_build_depot, tool_build_wayobj, tool_build_roadsign, 4108,
tool_remove_way, tool_remove_wayobj, tool_make_stop_public, tool_stop_mover, tool_merge_stop, 4103
]
This should be controlled via the class_basic_gui.nut.
Quote from: Andarix on November 07, 2024, 11:54:55 AMclass_chapter_07.nut
line 18 define
t_allowed_list = [
tool_build_way, tool_build_station, tool_build_depot, tool_build_wayobj, tool_build_roadsign, 4108,
tool_remove_way, tool_remove_wayobj, tool_make_stop_public, tool_stop_mover, tool_merge_stop, 4103
]
This should be controlled via the class_basic_gui.nut.
That list is for the is_work_allowed_here function, not for the gui.
4103 = tool_clear_reservation
Permitted tools for a chapter are in chapter_step_enabled_tools( pl ). There is currently nothing there for Chapter 7. If no step is specified, the information there applies to the whole chapter.
Quote from: Andarix on November 07, 2024, 03:52:55 PM4103 = tool_clear_reservation
Permitted tools for a chapter are in chapter_step_enabled_tools( pl ). There is currently nothing there for Chapter 7. If no step is specified, the information there applies to the whole chapter.
If you are right, I will modify. ;)
Edit.
Chg : https://github.com/simutrans/tutorial_pak64/commit/beef15eb55d7addff56e3afe17da9c19b50cece1