The International Simutrans Forum

 

Author Topic: Water Tower (troubleshooting) and Add-ons in Extended  (Read 1312 times)

0 Members and 1 Guest are viewing this topic.

Offline Matthew

  • *
  • Posts: 178
  • Languages: EN, some ZH, DE & SQ
Water Tower (troubleshooting) and Add-ons in Extended
« on: May 27, 2019, 11:36:40 PM »
I would be grateful for advice about a building that I am attempting to mod. It is only the second building I've modded, so I'm probably making a very elementary error. All the files have been edited from others' work - it is very much standing on the shoulders of giants.

The building is a water tower for railways. Since convoys can only wait at stops (rather than waypoints), I sometimes have to build a stop in the countryside purely for the basis of timetabling. I thought that it would be better to have a water tower graphic for this purpose, rather than a platform or siding.

I have made a PAK file with Makeobj-Extended ("makeobj-extended pak128"), which does not report any errors, and put it into an AddOns subdirectory of the pakset. However, it does not appear in-game in the Railway toolbar. Any ideas why this might be? My understanding is that I don't need to alter menuconf.tab, because pakset buildings should be picked up automatically.

The .dat file is:

Code: [Select]
Obj=building
Name=WaterTower
# must be 1*1
type=stop
waytype=track
noconstruction=1
NoInfo=1
Dims=1,1,2
enables_ware=1
population_and_visitor_demand_capacity=0
employment_capacity=0
mail_demand=0
intro_year=1750
level=1
allow_underground=0
intro_month=1
maintenance=25
cost=4000
capacity=1
BackImage[0][0][0][0][0][0]=water-tower_S.0.0
BackImage[1][0][0][0][0][0]=water-tower_W.0.0
BackImage[0][0][0][0][0][1]=water-tower_S.0.0
BackImage[1][0][0][0][0][1]=water-tower_W.0.0
icon=> button-water-tower.0.0
cursor=water-tower-cursor.0.0

The attachment shows the PNG files, which are available here.
« Last Edit: June 12, 2019, 03:44:25 PM by Matthew »

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2676
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Water Tower (troubleshooting)
« Reply #1 on: May 28, 2019, 06:56:39 AM »
What is noconstruction=1 supposed to do?

Offline makie de

  • *
  • Posts: 94
  • Languages: DE
Re: Water Tower (troubleshooting)
« Reply #2 on: May 28, 2019, 07:54:21 AM »
Quote
icon=> button-water-tower.0.0
are you sure this is correct,  if the Icon points to nothing, nothing shown in the  Railway toolbar
-------
*hm* looks correct

are you sure the addon is loading?
« Last Edit: May 28, 2019, 08:14:44 AM by makie »

Offline Ves

  • Devotee
  • *
  • Posts: 1664
  • Languages: EN, SV, DK
Re: Water Tower (troubleshooting)
« Reply #3 on: May 28, 2019, 08:43:32 AM »
How big is the packed .pak file? If it is 1kb something wrong have happened already in the packing stage.

The no_construction is wether it displays the construction yard when the building is built.

Maybe you did this approach already, but when I try to pack a "new" thing I haven't tried yet, I usually locate an existing version of it in another pakset, copy it to my location and try to compile that as it is. Then I start to modify it, for instance by painting my own graphics on top of it, always compiling and testing in game to make sure it works. When something doesn't work you usually then know what caused it to not work.


I see now that you put it in the add-ons folder. Are you loading the game with add-ons? Try putting it into the main pakset folder.
« Last Edit: May 28, 2019, 08:56:42 AM by Ves »

Offline Ranran jp

  • *
  • Posts: 471
  • Languages: ja
Re: Water Tower (troubleshooting)
« Reply #4 on: May 28, 2019, 11:37:55 AM »
I downloaded pak file from that folder. It can be used correctly.


It is nice looking,  ;) but it seems that you need to adjust the position.

I see now that you put it in the add-ons folder. Are you loading the game with add-ons? Try putting it into the main pakset folder.
Yes, Simutrans-Extended can not use addons folder. You need to put it directly into the pakset folder.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2676
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Water Tower (troubleshooting)
« Reply #5 on: May 28, 2019, 07:25:35 PM »
Simutrans extended can use addons folder, and it offers you loading with or without addons

Offline Ranran jp

  • *
  • Posts: 471
  • Languages: ja
Re: Water Tower (troubleshooting)
« Reply #6 on: May 29, 2019, 12:31:38 PM »
Simutrans extended can use addons folder
How? I have tried it over and over, but have never read load it successfully. Where do I put the addons folder? (´・ω・`)
I know that standard enables the import button by placing the addons folder to the user folder without any special settings, and it's working.
Do I need to make special settings in extended? (edit simuconf.tab etc)

Quote
it offers you loading with or without addons
I think that's a feature of standard. There is no code in extended's pakselector.cc to display it.
Is it run in a completely different way than the standard?
EDIT: Yes, it seems that this has been changed to a method different from the standard.
But I tried putting the addons folder in various places, but I was not able to read load it.

EDIT2: fix a translation error
« Last Edit: May 29, 2019, 05:05:39 PM by Ranran »

Offline ACarlotti

  • *
  • Posts: 474
Re: Water Tower (troubleshooting)
« Reply #7 on: May 29, 2019, 01:23:29 PM »
I think that's a feature of standard. There is no code in extended's pakselector.cc to display it.
Is it run in a completely different way than the standard?
EDIT: Yes, it seems that this has been changed to a method different from the standard.
But I tried putting the addons folder in various places, but I was not able to read it.

I am aware that Simutrans Extended was changed to use different pak selector code a while back. Since I can't think of any reason for it needing to use different code, I want to reunify this with Standard at some point (though it is probably several years down my todo list).

I think it should be possible to specify using the addons folder if you start Simutrans Extended from the command line - according to the help text (run "simutrans-extended -help"), adding the "-addons" flag will do this.

Offline Ranran jp

  • *
  • Posts: 471
  • Languages: ja
Re: Water Tower (troubleshooting)
« Reply #8 on: May 29, 2019, 01:59:39 PM »
I read the code and got the answer...
The following parameters need to be added to the pakset's simuconf.tab for using addons folder in extended:
Code: [Select]
with_private_paks = 1The default (no description) is 0, i.e. the addons folder is invalid.

It will be difficult for ordinary players to realize this. Because there are no tips about it in simuconf.tab. My friend ranran told me "Extended can not use the addons folder". I have also thought that it is so.
Is it explained somewhere?

Quote
Since I can't think of any reason for it needing to use different code, I want to reunify this with Standard at some point (though it is probably several years down my todo list).
I hope to be integrated in the same way as the standard. At least until that time, please describe the above parameters and description in simuconf.tab.
« Last Edit: May 29, 2019, 05:10:13 PM by Ranran »

Offline Matthew

  • *
  • Posts: 178
  • Languages: EN, some ZH, DE & SQ
Re: Water Tower (troubleshooting)
« Reply #9 on: May 29, 2019, 11:20:54 PM »
Thank you to everyone who has provided advice; all these contributions have been helpful.

I see now that you put it in the add-ons folder. Are you loading the game with add-ons? Try putting it into the main pakset folder.

Yes, Simutrans-Extended can not use addons folder. You need to put it directly into the pakset folder.

So my error was using the AddOns folder. This also explains why another modding project failed.

Quote
It is nice looking,  ;) but it seems that you need to adjust the position.

Yes, it was in the wrong place. It is now in the right place, but I must learn how to use BackImage/FrontImage better to make it look right.

I read the code and got the answer...
The following parameters need to be added to the pakset's simuconf.tab for using addons folder in extended:
Code: [Select]
with_private_paks = 1The default (no description) is 0, i.e. the addons folder is invalid.

It will be difficult for ordinary players to realize this. Because there are no tips about it in simuconf.tab. My friend ranran told me "Extended can not use the addons folder". I have also thought that it is so.
Is it explained somewhere?
I hope to be integrated in the same way as the standard. At least until that time, please describe the above parameters and description in simuconf.tab.

I support this idea of making the AddOns folder work by default, if it is as simple as adding a line to simuconf.tab.

Maybe you did this approach already, but when I try to pack a "new" thing I haven't tried yet, I usually locate an existing version of it in another pakset, copy it to my location and try to compile that as it is. Then I start to modify it, for instance by painting my own graphics on top of it, always compiling and testing in game to make sure it works. When something doesn't work you usually then know what caused it to not work.

Yes, this is a good strategy for beginners, which is why this water tower is a combination of signal tower graphics and the goods siding DAT. But I couldn't test at all because of the AddOns problem.  :-[

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18683
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Water Tower (troubleshooting)
« Reply #10 on: June 01, 2019, 10:00:19 AM »
Thank you for your suggestions in this regard. I do not generally use addons, so have not looked into this. I have added documentation of the with_private_paks switch in simuconf.tab in the pakset, but I have not set this to enabled by default: this is because enabling addons may prevent people from joining online games that do not have the same addons enabled.

As to the different code for the pak selector - I know that this was written by Bernd Gabriel some time ago; I cannot now recall why it differs from Standard, but I think that there was a reason for it at the time. Standard's code for this may well have changed in the meantime, of course.

Offline Matthew

  • *
  • Posts: 178
  • Languages: EN, some ZH, DE & SQ
Re: Water Tower (troubleshooting)
« Reply #11 on: June 01, 2019, 04:54:30 PM »
Thank you for your suggestions in this regard. I do not generally use addons, so have not looked into this. I have added documentation of the with_private_paks switch in simuconf.tab in the pakset, but I have not set this to enabled by default: this is because enabling addons may prevent people from joining online games that do not have the same addons enabled.

It's kind of you to incorporate this into simuconf.tab, James. However, I noticed that the helpful text says "addons in the ~/addons folder
# (inside the pakset folder) will be available". I understand that in Standard, the addons folder is in the \simutrans\ folder, so addons for Pak128.Britain-Ex go in ..\simutrans\addons\Pak128.Britain-Ex\ . I have tested this setup today and it works in Experimental. It may be that your method works too, but perhaps there might be some value in using the same approach as Standard.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18683
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Water Tower (troubleshooting)
« Reply #12 on: June 01, 2019, 04:59:09 PM »
I have not looked into this folder structure question - it is possible that this changed in Standard at some point; I am not sure. Is the issue that the explanatory text in simuconf.tab does not correctly describe behaviour in Simutrans-Extended?

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2676
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Water Tower (troubleshooting)
« Reply #13 on: June 02, 2019, 01:48:02 PM »
The structure is indeed ~/simutrans/addons/pakxy/

When I start the game a pak selection dialog pops up and I can choose which pak to play, each with two buttons with or without addons.

I find that perfect... Maybe I have set up something long ago...

Offline Ranran jp

  • *
  • Posts: 471
  • Languages: ja
Re: Water Tower (troubleshooting)
« Reply #14 on: June 02, 2019, 05:02:46 PM »
I think this is confusing because it's different from the standard, and it's more inconvenient than the standard. I suppose that there is no problem completely integrated with the standard specification.
(Or is there any special reason?)
You can use the button to select whether to load addon or not, which will not affect the network connection. You just select pakset without loading any add-ons.

Extended does not have this feature. (Load with addons button)
 This is a feature that has been around for a long time (from 6 years ago?), and is separate from the standard's incorporation that ACarlotti is currently working on.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2676
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Water Tower (troubleshooting)
« Reply #15 on: June 02, 2019, 06:04:44 PM »
I don't understand. I have the same dialog as in the above screenshot in extended too.

Offline Matthew

  • *
  • Posts: 178
  • Languages: EN, some ZH, DE & SQ
Re: Water Tower (troubleshooting)
« Reply #16 on: June 02, 2019, 06:20:00 PM »
I don't understand. I have the same dialog as in the above screenshot in extended too.

I have never seen that dialogue in Extended. I get the dialogue shown in the attachment.
If you have accidentally incorporated the Standard dialogue chooser into your own build of Extended, then feel free to share....  ???

It seems too good to be true, though!

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2676
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Water Tower (troubleshooting)
« Reply #17 on: June 02, 2019, 08:06:36 PM »
I use nightly builds (linux 64 bit) but the configuration may br tweaked long ago.

Offline makie de

  • *
  • Posts: 94
  • Languages: DE
Re: Water Tower (troubleshooting)
« Reply #18 on: June 02, 2019, 08:57:05 PM »

this is standart release
the picture of ranran is only with the actual nightly of standart

Offline Ranran jp

  • *
  • Posts: 471
  • Languages: ja
Re: Water Tower (troubleshooting)
« Reply #19 on: June 03, 2019, 04:27:10 PM »
I don't understand. I have the same dialog as in the above screenshot in extended too.
What text do you see instead of "Load with addons"? The text "Load with addons" appears to be absent in the extended code.

Offline Matthew

  • *
  • Posts: 178
  • Languages: EN, some ZH, DE & SQ
Re: Water Tower (troubleshooting)
« Reply #20 on: June 05, 2019, 08:44:26 PM »
The water tower is now available with corrected graphics. It jumps from one side of the track to the other as you rotate, but that's an unavoidable constraint of Simutrans graphics (no doubt for good reasons back in time).

I've tried to prevent trains pausing to (un)load at water towers by setting goods capacity to zero, which seems to work so far, but probably needs more testing.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2676
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Water Tower (troubleshooting)
« Reply #21 on: June 05, 2019, 09:34:20 PM »
Platforms with 4 rotations are possible. You have to make all 4 images and use dims=1,1,4

Offline Matthew

  • *
  • Posts: 178
  • Languages: EN, some ZH, DE & SQ
Re: Water Tower (troubleshooting)
« Reply #22 on: June 06, 2019, 12:34:18 AM »
Platforms with 4 rotations are possible. You have to make all 4 images and use dims=1,1,4

I have tried that, but both according to the documentation* and my experience, that creates terminal platforms. In order to use a water tower as a scheduling point, it needs to be a through platform. If anyone knows of a way to have four rotations of a through platform, then I'd much appreciate a tutorial.

*The .dat reference for stops says, "If "dims=1,1,4" it will become a "sack" stop." I think Ves intended "sack" to mean terminus, in the sense of "cul-de-sac".


Offline Ranran jp

  • *
  • Posts: 471
  • Languages: ja
Re: Water Tower (troubleshooting)
« Reply #23 on: June 06, 2019, 03:13:03 AM »
Quote
You have to make all 4 images and use dims=1,1,4
No, it's wrong. You have to have dims=1,1,16 to support 4 rotations.
1,1,4 is for the terminal stop.
1,1,8 is considered to be symmetrical to the track.
1,1,16 is considered to be asymmetric with respect to the track.

i.e.
Code: [Select]
Dims=1,1,16
BackImage[0][0][0][0][0][0]=upper left
BackImage[1][0][0][0][0][0]=upper right
BackImage[2][0][0][0][0][0]=upper left
BackImage[3][0][0][0][0][0]=upper right
BackImage[4][0][0][0][0][0]=upper left
BackImage[5][0][0][0][0][0]=upper right
BackImage[6][0][0][0][0][0]=upper left
BackImage[7][0][0][0][0][0]=upper right
FrontImage[8][0][0][0][0][0]=lower right
FrontImage[9][0][0][0][0][0]=lower left
FrontImage[10][0][0][0][0][0]=lower right
FrontImage[11][0][0][0][0][0]=lower left
FrontImage[12][0][0][0][0][0]=lower right
FrontImage[13][0][0][0][0][0]=lower left
FrontImage[14][0][0][0][0][0]=lower right
FrontImage[15][0][0][0][0][0]=lower left
lower/upper, left/right are the position where the water tower should stand

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2676
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Water Tower (troubleshooting)
« Reply #24 on: June 06, 2019, 07:00:11 AM »
Thanks for correction. I just knew it is possible but didn't check the documentation.

Offline Matthew

  • *
  • Posts: 178
  • Languages: EN, some ZH, DE & SQ
Re: Water Tower (troubleshooting)
« Reply #25 on: June 07, 2019, 08:09:04 PM »
No, it's wrong. You have to have dims=1,1,16 to support 4 rotations.
1,1,4 is for the terminal stop.
1,1,8 is considered to be symmetrical to the track.
1,1,16 is considered to be asymmetric with respect to the track.

i.e.
Code: [Select]
Dims=1,1,16
BackImage[0][0][0][0][0][0]=upper left
BackImage[1][0][0][0][0][0]=upper right
BackImage[2][0][0][0][0][0]=upper left
BackImage[3][0][0][0][0][0]=upper right
BackImage[4][0][0][0][0][0]=upper left
BackImage[5][0][0][0][0][0]=upper right
BackImage[6][0][0][0][0][0]=upper left
BackImage[7][0][0][0][0][0]=upper right
FrontImage[8][0][0][0][0][0]=lower right
FrontImage[9][0][0][0][0][0]=lower left
FrontImage[10][0][0][0][0][0]=lower right
FrontImage[11][0][0][0][0][0]=lower left
FrontImage[12][0][0][0][0][0]=lower right
FrontImage[13][0][0][0][0][0]=lower left
FrontImage[14][0][0][0][0][0]=lower right
FrontImage[15][0][0][0][0][0]=lower left
lower/upper, left/right are the position where the water tower should stand

Thank you!  :thumbsup: This tutorial was so clear that even I could follow it and the revised pak all seems to work perfectly.

Thanks for correction. I just knew it is possible but didn't check the documentation.

It's been a good example of different members of the community working together to improve things. Thank you for pointing out my mistake!  :thumbsup:

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2676
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Water Tower (troubleshooting)
« Reply #26 on: June 11, 2019, 09:12:16 PM »
I see this when starting simutrans-extended. It offers loading with addons even if there is no corresponding pak.XY subfolder under ~/simutrans/addons/    (~ is the Linux user home directory. I don't know what path is expected in windows) I did not find anything about addons in simuconf.tab (it is unchanged since Oct 2017). And it works as expected.

Offline ACarlotti

  • *
  • Posts: 474
Re: Water Tower (troubleshooting)
« Reply #27 on: June 11, 2019, 10:00:28 PM »
I just investigated this a bit. Basically, the pakselector looks for addons folders at [USER_DIR]/[PAK_NAME], and only displays the option of loading with addons if that directory exists. So all of us who don't have that option obviously haven't created any addons folders.

(Note: the USER_DIR folder is the one that contains the save folder, which for me is ~/simutrans)

Offline Ranran jp

  • *
  • Posts: 471
  • Languages: ja
Re: Water Tower (troubleshooting)
« Reply #28 on: June 12, 2019, 09:15:43 AM »
I see this when starting simutrans-extended.
Thank you for the screenshot. It is the screen that I wanted to confirm.
I think that feature doesn't work at least on Windows.
This is because the contents of the addons folder are correctly load when with_private_paks=1 setting.
It means I have created the addons folder in the right place. It is the folder where save is created.
But still, the "With user addons" button is not displayed.
My user directory name consists only of short alphabet and numbers. It does not contain double-byte characters.

It seems that a good solution is to unify with the standard code, as the text of the labels only seems different and the expected behavior seems to be the same. Because in standard, the load addons button is displayed even on Windows.

Offline ACarlotti

  • *
  • Posts: 474
Re: Water Tower (troubleshooting)
« Reply #29 on: June 12, 2019, 01:52:59 PM »
Oh, it's been broken since about 2012. The pakselector screen looks for addons directly in the 'simutrans' folder, but the loading code in simmain.cc looks in 'simutrans/addons'. The Extended pakselector (which I think was written with the intention of improving the ordering of the pak listing) was written before this, and never updated.

I should check what was actually changed at some point - maybe some of the Extended changes are worth including in Standard.