News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Water Tower (troubleshooting) and Add-ons in Extended

Started by Matthew, May 27, 2019, 11:36:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

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:

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.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Vladki

What is noconstruction=1 supposed to do?

makie

#2
Quoteicon=> 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?

Ves

#3
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.

Ranran(retired)

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.

Quote from: Ves on May 28, 2019, 08:43:32 AMI 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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Vladki

Simutrans extended can use addons folder, and it offers you loading with or without addons

Ranran(retired)

#6
Quote from: Vladki on May 28, 2019, 07:25:35 PMSimutrans 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)

Quoteit 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
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

ACarlotti

Quote from: Ranran on May 29, 2019, 12:31:38 PMI 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.

Ranran(retired)

#8
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:
with_private_paks = 1
The 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?

QuoteSince 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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Matthew

Thank you to everyone who has provided advice; all these contributions have been helpful.

Quote from: Ves on May 28, 2019, 08:43:32 AMI 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.

Quote from: Ranran on May 28, 2019, 11:37:55 AM
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.

QuoteIt 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.

Quote from: Ranran 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:
with_private_paks = 1
The 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.

Quote from: Ves on May 28, 2019, 08:43:32 AM
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.  :-[
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Matthew

Quote from: jamespetts 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.

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.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

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...

Ranran(retired)

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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Vladki

I don't understand. I have the same dialog as in the above screenshot in extended too.

Matthew

Quote from: Vladki 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.

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!
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Vladki

I use nightly builds (linux 64 bit) but the configuration may br tweaked long ago.

makie


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

Ranran(retired)

Quote from: Vladki on June 02, 2019, 06:04:44 PMI 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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Matthew

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.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Vladki

Platforms with 4 rotations are possible. You have to make all 4 images and use dims=1,1,4

Matthew

Quote from: Vladki 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

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".

(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Ranran(retired)

QuoteYou 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.
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
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Vladki

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

Matthew

Quote from: Ranran on June 06, 2019, 03:13:03 AM
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.
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.

Quote from: Vladki on June 06, 2019, 07:00:11 AM
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:
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Vladki

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.

ACarlotti

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)

Ranran(retired)

Quote from: Vladki on June 11, 2019, 09:12:16 PMI 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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

ACarlotti

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.