News:

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

[Script tool] Menu icon for a script tool

Started by Yona-TYT, December 04, 2024, 04:42:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

I've been trying to make a menu to run a script tool from the menu bar, but I couldn't get this to work in pak128.

In pak64.german there are script tools with their well organized icons, I wish I could do something like that in pak128, however I don't know much about creating objects for paksets.

This is what I have so far:

I followed some instructions from here: https://forum.simutrans.com/index.php/topic,19836.0.html

It also says to add something like: "toolbar[4][10]=scripts(my_tools)", to the menuconf.tab

Andarix

A button must be defined in the script tool for the toolbar.

description.tab
icon=script_tool_check_pass
dat file for script tool
Obj=cursor
#copyright=
name=script_tool_check_pass
#cursor
Image[0]=image.1.1
#icon/button
Image[1]=> image.1.0
#marker
Image[2]=image.1.2

And instead of including each script tool with a name in the toolbar, you can define a toolbar name for the script tool.

description.tab
menu=SCRIPT_TOOL_INFO
menuconf.tab pak64.german
# script tools
toolbar[7][0]=general_tool[47]
toolbar[7][1]=scripts(SCRIPT_TOOL_INFO)
toolbar[7][2]=scripts(SCRIPT_TOOL_GROUND)
toolbar[7][3]=scripts(SCRIPT_TOOL_WORK)
toolbar[7][4]=scripts(SCRIPT_TOOL_UPGRADE)

It is also important that the cursor.[Scripttool].pak must be in the pak folder or addon folder. It is not loaded from the tool folder.

Yona-TYT

Wow, this information is worth gold, thank you very much!.

Yona-TYT

Here is a little experiment:

Captura de pantalla -2024-12-04 21-54-32.png

Script Tool: walls_rectangles.zip

prissi

THe current pak128 nightlies have also the script macro generator.