Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: devel/watch-minecarts crashing  (Read 676 times)

bloop_bleep

  • Bay Watcher
    • View Profile
devel/watch-minecarts crashing
« on: September 28, 2017, 01:27:46 am »

I've encountered a strange problem. Whenever I boot up my save, the first time I run devel/minecarts, it outputs the entries for several vehicles, but then crashes with this message:

Code: [Select]
...XXXX\df_43_05_win/hack/scripts/devel/watch-minecarts.lua:17: attempt to index a nil value (local 'item')
stack traceback:
        ...XXXX\df_43_05_win/hack/scripts/devel/watch-minecarts.lua:17: in global 'compare_one'
        ...XXXX\df_43_05_win/hack/scripts/devel/watch-minecarts.lua:53: in global 'compare_all'
        ...XXXX\df_43_05_win/hack/scripts/devel/watch-minecarts.lua:74: in local 'script_code'
        C:\Users\XXXXX\df_43_05_win\hack\lua\dfhack.lua:562: in function 'dfhack.run_script_with_env'
        (...tail calls...)

The second and any subsequent times I run it, it outputs nothing and crashes with the same message. I have to completely reload DF to be able to get the first message again. What's going on here?

EDIT: While we're at it, does anybody know the solution to the very problem which prompted me to use watch-minecarts in the first place? Basically, I have a highest-speed roller on top of a spiraling downward track. The minecart would go down several z-levels and then derail diagonally. This sounds a lot like corner ramp derailing, but that only happens with upward corner ramps and in my design any extraneous velocity created by one corner ramp would be immediately remedied by the next corner.
« Last Edit: September 28, 2017, 01:32:41 am by bloop_bleep »
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: devel/watch-minecarts crashing
« Reply #1 on: October 07, 2017, 06:56:36 am »

I rarely look into this forum, so you're in luck.

One cause I've found for devel/minecarts crash in 42.06-alpha is when I've destroyed (via, say, autodump-destroy-here) carts to get their build order and quality in order.

As for your problem, corner ramps drain 6k speed per z-level, whether cart is ascending or descending, so I guess (probably wrongly, minecarts are complicated and I don't know the design) will go 44k→38k→32k→26k→20k→14k→crash due 5k diagonal movement.

bloop_bleep

  • Bay Watcher
    • View Profile
Re: devel/watch-minecarts crashing
« Reply #2 on: October 07, 2017, 10:59:34 am »

Yeah, I had figured that out the hard way.  :D As for watch-minecarts, I ended up writing my own script that prints the speed and position of any non-stationary minecarts.
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.