[Mod] Advanced Trains [advtrains] [1.13]

User avatar
orwell
Member
 
Posts: 707
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [1.13]

by orwell » Wed Oct 24, 2018 13:05

papou30 wrote:Just a note to thank you pheonixfire and orwell for the time you have dedicated me because now everything works very well. You really friendly and attentive. Once again a very big thank you.

You`re welcome. Have fun!
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

wziard
New member
 
Posts: 8
Joined: Mon Oct 29, 2018 19:12

Re: [Mod] Advanced Trains [advtrains] [1.13]

by wziard » Mon Oct 29, 2018 20:36

Awesome train mod.

I have a strange bug however: in my server I get messages like these:
2018-10-29 21:30:34: WARNING[Server]: ServerEnv: Trying to store id = 0 statically but block (19,0,-5) already contains 2171 objects.

- the -5 sometimes is -4.
- When I teleport to that location, there's nothing visibly there.
- the 2171 keeps going up. I can't really put a finger on it, but I think it goes up each time I quit the server and restart it. During a run it stays constant (for a while at least)

if I use a debugger to see what the 2171 stored objects contain I get an endless list of this:

<snip>
{type = 7 '\a', pos = {X = 3180, Y = 90, Z = -672}, data = "\001\000\023advtrains:discouple\000\000\000\tDISCOUPLE\000\n", '\000' <repeats 15 times>}, {type = 7 '\a', pos = {X
= 3180, Y = 90, Z = -672}, data = "\001\000\023advtrains:discouple\000\000\000\tDISCOUPLE\000\n", '\000' <repeats 15 times>}, {type = 7 '\a', pos = {X = 3180, Y = 90, Z = -672}, data = "\001\000\023advtrai
ns:discouple\000\000\000\tDISCOUPLE\000\n", '\000' <repeats 15 times>}, {type = 7 '\a', pos = {X = 3180, Y = 90, Z = -672}, data = "\001\000\023advtrains:discouple\000\000\000\tDISCOUPLE\000\n", '\000' <re
peats 15 times>}, {type = 7 '\a', pos = {X = 3180, Y = 90, Z = -672}, data = "\001\000\023advtrains:discouple\000\000\000\tDISCOUPLE\000\n", '\000' <repeats 15 times>},
<snip>

Does anybody have any ideas how to debug? I'm not (yet) really fluent in lua, and especially not in the interaction between the minetest engine and lua in a debugging situation.

For now the server keeps running as if nothing's wrong, but I suspect it will become a problem eventually?
 

User avatar
gpcf
Member
 
Posts: 266
Joined: Fri May 27, 2016 10:48
In-game: gabriel

Re: [Mod] Advanced Trains [advtrains] [1.13]

by gpcf » Tue Oct 30, 2018 07:11

I put your bug into our bug tracker:
https://bugs.linux-forks.de/advtrains/73.html

It seems that the discouple entities do not get destroyed when the blocks get unloaded. I think this can be fixed by setting some entity property that was created specifically for advtrains, that forbids the server from saving the entities statically.
 

BuckarooBanzay
Member
 
Posts: 111
Joined: Tue Apr 24, 2018 05:58
Location: Switzerland
GitHub: thomasrudin-mt
In-game: BuckarooBanzai

Re: [Mod] Advanced Trains [advtrains] [1.13]

by BuckarooBanzay » Tue Oct 30, 2018 08:30

Can someone provide some example code for the lua-automation.
As far as i understand there is an initialization-code and a piece of code that gets executed if a train drives over the lua-track.
My goal is to build a two-way track with multiple trains on it and the "normal" atc-rail is just too simple for that.

Thanks, and great work by the way :)
 

wziard
New member
 
Posts: 8
Joined: Mon Oct 29, 2018 19:12

Re: [Mod] Advanced Trains [advtrains] [1.13]

by wziard » Tue Oct 30, 2018 08:41

gpcf wrote:It seems that the discouple entities do not get destroyed when the blocks get unloaded. I think this can be fixed by setting some entity property that was created specifically for advtrains, that forbids the server from saving the entities statically.



I *think* I saw something like that in the C++ code. I'll have a look myself as well and report my findings in the bug tracker.

Thanks

edit:
I found it. I'm a bit busy right now and I didn't really understand how to add something to that bug tracker so I'll post my (extremely simple) patch here:

diff --git a/advtrains/couple.lua b/advtrains/couple.lua
index 7e99571..6d5428b 100644
--- a/advtrains/couple.lua
+++ b/advtrains/couple.lua
@@ -18,7 +18,7 @@ minetest.register_entity("advtrains:discouple", {
collisionbox = {-0.3,-0.3,-0.3, 0.3,0.3,0.3},
visual_size = {x=0.7, y=0.7},
initial_sprite_basepos = {x=0, y=0},
-
+ static_save = false,
is_discouple=true,
on_activate=function(self, staticdata)
if staticdata=="DISCOUPLE" then
 

User avatar
gpcf
Member
 
Posts: 266
Joined: Fri May 27, 2016 10:48
In-game: gabriel

Re: [Mod] Advanced Trains [advtrains] [1.13]

by gpcf » Tue Oct 30, 2018 09:09

wizard: just send an e-mail to 73@bugs.linux-forks.de. I will see if I can test your patch soon and merge it into advtrains.
 

User avatar
gpcf
Member
 
Posts: 266
Joined: Fri May 27, 2016 10:48
In-game: gabriel

Re: [Mod] Advanced Trains [advtrains] [1.13]

by gpcf » Tue Oct 30, 2018 18:03

Orwell has fixed it for the tss branch (see https://git.bananach.space/advtrains.gi ... 819988539f). The master branch is legacy, it should be considered deprecated.
 

wziard
New member
 
Posts: 8
Joined: Mon Oct 29, 2018 19:12

Re: [Mod] Advanced Trains [advtrains] [1.13]

by wziard » Fri Nov 02, 2018 06:52

It would be nice if this was stated in the Readme. For me a s a complete noob that is not obvious :-)

I'll send the patch for the main branch. though testing the patch is probably more work than manually adding
static_save = false
in couple.lua
 

User avatar
orwell
Member
 
Posts: 707
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [1.13]

by orwell » Sat Nov 03, 2018 12:05

Thanks, and welcome in the community, wizard.
I just forgot the static_save property in the couples. And it is true that I do only backport important changes to "master" anymore. I will make the current "tss" branch the new main branch soon.
This is indeed somthing I should also put on master.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

Dan2018
Member
 
Posts: 24
Joined: Mon Mar 12, 2018 15:07

Re: [Mod] Advanced Trains [advtrains] [1.13]

by Dan2018 » Mon Nov 05, 2018 12:25

This mod looks amazing.

Before i stick it on our server. Could you let me know if theres a way to protect the trains on multiplayer servers?
Last time i stuck something on without protection it caused chaos.

Many thanks
 

User avatar
orwell
Member
 
Posts: 707
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [1.13]

by orwell » Mon Nov 05, 2018 12:44

Currently, trains you place should be protected from others, however, this is somewhat broken. It is one of the big ToDos I just couldnt adress yet because of limited time.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

Dan2018
Member
 
Posts: 24
Joined: Mon Mar 12, 2018 15:07
 

BuckarooBanzay
Member
 
Posts: 111
Joined: Tue Apr 24, 2018 05:58
Location: Switzerland
GitHub: thomasrudin-mt
In-game: BuckarooBanzai

Re: [Mod] Advanced Trains [advtrains] [1.13]

by BuckarooBanzay » Wed Nov 07, 2018 10:54

Is there a procedure i have to follow to update to the tss branch?
I switched from the latest master to the tss and now my trains are killing me when accelerating and take me with them without me being near them :P (it was funny at first but did get annoying with time..)

Anyways: cool mod, keep up the good work
 

User avatar
gpcf
Member
 
Posts: 266
Joined: Fri May 27, 2016 10:48
In-game: gabriel

Re: [Mod] Advanced Trains [advtrains] [1.13]

by gpcf » Wed Nov 07, 2018 13:41

@orwell: maybe the pickup radius was increased?
 

User avatar
orwell
Member
 
Posts: 707
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [1.13]

by orwell » Wed Nov 07, 2018 14:35

BuckarooBanzay wrote:Is there a procedure i have to follow to update to the tss branch?
I switched from the latest master to the tss and now my trains are killing me when accelerating and take me with them without me being near them :P (it was funny at first but did get annoying with time..)

Anyways: cool mod, keep up the good work

This is nothing you did wrong, but is rather caused by a bug that existed previously that has now been resolved. The trains you now get teleported to are the ones you flew out of somewhen before.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

BuckarooBanzay
Member
 
Posts: 111
Joined: Tue Apr 24, 2018 05:58
Location: Switzerland
GitHub: thomasrudin-mt
In-game: BuckarooBanzai

Re: [Mod] Advanced Trains [advtrains] [1.13]

by BuckarooBanzay » Wed Nov 07, 2018 16:59

orwell wrote:
BuckarooBanzay wrote:Is there a procedure i have to follow to update to the tss branch?
I switched from the latest master to the tss and now my trains are killing me when accelerating and take me with them without me being near them :P (it was funny at first but did get annoying with time..)

Anyways: cool mod, keep up the good work

This is nothing you did wrong, but is rather caused by a bug that existed previously that has now been resolved. The trains you now get teleported to are the ones you flew out of somewhen before.


Thanks for the reply, i still get killed when i drive too fast :O
https://imgur.com/a/RnpOSEd
Image
Except if i use the admin-account with higher privs.
Versions:
  • advtrains: tss branch
  • minetest: 0.4.17.1





EDIT: it seems the value for the train-id does get assigned nil: wagons.lua, line 649
Code: Select all
advtrains.player_to_train_mapping[clicker:get_player_name()]=self.train_id
Last edited by BuckarooBanzay on Wed Nov 07, 2018 21:13, edited 1 time in total.
 

User avatar
orwell
Member
 
Posts: 707
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [1.13]

by orwell » Wed Nov 07, 2018 18:37

:/ one more item to investigate on.
Added to bugtracker
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

python_megapixel
New member
 
Posts: 1
Joined: Tue Nov 13, 2018 14:23
In-game: python_megapixel

Re: [Mod] Advanced Trains [advtrains] [1.13]

by python_megapixel » Sat Nov 17, 2018 20:04

I read the guide to the interlocking system - seems simple enough, except even though I play in creative mode I can't find the markers for the end of a track sector in the inventory...
 

Previous

Return to Mod Releases



Who is online

Users browsing this forum: hisforeverkid and 9 guests