News:

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

Recent posts

#1
Pak128 Add-ons and Graphics / Re: Susie's Add-ons
Last post by SusieNoia - Yesterday at 02:13:38 PM
And by its application...

DAT:
Name=Ninja_Hotel
Obj=building
Type=cur
Passengers=60
Build_Time=5300
chance=25
Intro_year=2015
Retire_year=2215
climates=water,tropic,mediterran,temperate
Dims=1,1,2
BackImage[0][0][0][0][0][0]=ninja.1.0
BackImage[0][0][0][1][0][0]=ninja.0.0
BackImage[1][0][0][0][0][0]=ninja.1.1
BackImage[1][0][0][1][0][0]=ninja.0.1
BackImage[0][0][0][0][0][1]=ninja.1.2
BackImage[0][0][0][1][0][1]=ninja.0.2
BackImage[1][0][0][0][0][1]=ninja.1.3
BackImage[1][0][0][1][0][1]=ninja.0.3
#2
Bug Reports / Re: [Linux Wayland] Window bor...
Last post by Yona-TYT - Yesterday at 01:20:24 PM
Quote from: prissi on Yesterday at 11:53:52 AMMaybe try self-compile.

You're right, compiled Simutrans doesn't have any issues with window decorations.

However, I'm concerned that regular users might have this problem when running Simutrans, most don't even know how to compile their own versions.

Captura desde 2025-06-25 09-20-10.png
#3
Scripting Scenarios and AI / Re: Tutorial - code review
Last post by Yona-TYT - Yesterday at 01:15:11 PM
A while ago I made a "rudimentary" function that allows you to know the current rotation, maybe this will help you?.

Note: This is already used in the tutorial


0 = North
1 = West
2 = South
3 = East
  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
  }
#4
Bug Reports / Re: [Linux Wayland] Window bor...
Last post by prissi - Yesterday at 11:53:52 AM
Maybe try self-compile.
#5
Scripting Scenarios and AI / Re: Tutorial - code review
Last post by Andarix - Yesterday at 11:51:59 AM
Quote from: Yona-TYT on Yesterday at 11:25:56 AMJust like there is a "start_game()" function, maybe a function that is called every time a save is made could help?, although I don't know if this already exists (I don't think so).

The question is rather what is saved from the parameters and what is not.

The coordinates are adjusted at runtime. But when loading, the initial coordinates are loaded and then not replaced by the valid ones on the map.

I currently don't know whether it is even possible to query the map orientation via script.

I also noticed now that the 0,0 coordinates of the factories are not in the dialogues but the coordinates of field 0,1. I was of the opinion that field 0,0 was in the dialogues until now.

Quote from: prissi on Yesterday at 11:45:43 AM...
So how to reproduce the error?

start the scenario tutorial
rotate map
save
load the save

run to chapter 3

Only the coordinates of the industries seem to be affected.
#6
Scripting Scenarios and AI / Re: Tutorial - code review
Last post by prissi - Yesterday at 11:45:43 AM
Since the map rotation is saved, and the coordinates in the script are rotated according to this, the only way to mess this up, is when the rotation indicator is manipulated or there is an error in the program.

So how to reproduce the error?
#7
Scripting Scenarios and AI / Re: Tutorial - code review
Last post by Yona-TYT - Yesterday at 11:25:56 AM
Just like there is a "start_game()" function, maybe a function that is called every time a save is made could help?, although I don't know if this already exists (I don't think so).
#8
Pak128 Add-ons and Graphics / Re: Susie's Add-ons
Last post by SusieNoia - Yesterday at 08:38:02 AM
Ciau,

Thank you for the suggestion, Giuseppe :)
I have made a pak of Maradona as a special building in the city 8)

DAT:
Name=Hotel_The_Footballer
Obj=building
Type=cur
Passengers=84
Build_Time=12000
chance=25
Intro_year=1989
Retire_year=2189
climates=desert,tropic,mediterran,temperate
Dims=1,1,2
BackImage[0][0][0][0][0][0]=footballer.1.0
BackImage[0][0][0][1][0][0]=footballer.0.0
BackImage[1][0][0][0][0][0]=footballer.1.1
BackImage[1][0][0][1][0][0]=footballer.0.1
BackImage[0][0][0][0][0][1]=footballer.1.2
BackImage[0][0][0][1][0][1]=footballer.0.2
BackImage[1][0][0][0][0][1]=footballer.1.3
BackImage[1][0][0][1][0][1]=footballer.0.3
#9
Scripting Scenarios and AI / Re: Tutorial - code review
Last post by Andarix - Yesterday at 07:53:15 AM
The problem may lie in the sequence.

The function rename_factory_names() is executed very early and accesses the coords of the factories (coord_fac_1 ....). And these coords are only specified for the start rotation.

This means that the map would have to be rotated to the appropriate rotation when saving and then back to the rotation that was displayed when saving after loading.

Alternatively, the coords of the factories (coord_fac_1 ...) would have to be overwritten and saved.

[EDIT]

I may have a solution.
#10
Bug Reports / r11731 - player ranking
Last post by Andarix - Yesterday at 06:52:34 AM
When I open the player ranking list, the players are mixed up. Petersil Cars ist Script AI player.

Screenshot 2025-06-25 084712.png