Gizmos Car Keys (improved)

by Pi-C

Tired of running to your vehicle? Then let it come to you! This mod is based on "Gizmos Car Keys" by aodgizmo. It works with most modded car and spider-vehicle prototypes -- not just vanilla cars.

Content
2 months ago
0.17 - 1.1
14.8K
Transportation

b [Fixed] Crash when opening Tips & Tricks tutorial scenario

1 year, 10 months ago
(updated 1 year, 10 months ago)

I learned this week that the Tips & Tricks tutorials (which can be launched from within, and simultaneously with, a normal game) handle migration scripts a little different from normal. For one thing, require() resolves relative paths differently. Not sure if it is related, but I got this crash trying to start the Stack Transfers tutorial.

 215.098 Applying migration: Gizmos Car Keys (improved): 00-17-04_check_tech.lua
 215.099 Applying migration: Gizmos Car Keys (improved): 00-17-09_cars_to_vehicles.lua
 215.152 Error AppManager.cpp:697: Failed to load tutorial: Error while applying migration: Gizmos Car Keys (improved): 00-17-09_cars_to_vehicles.lua

__GCKI__/migrations/00-17-09_cars_to_vehicles.lua:1: attempt to index global 'GCKI' (a nil value)
stack traceback:
    __GCKI__/migrations/00-17-09_cars_to_vehicles.lua:1: in main chunk
1 year, 10 months ago

Thanks for the report!

I just loaded a game with Cargo Ships to check out the issue with my dummy item. When I started to play the stack tutorial, I encountered this bug in Cargo Ships:

531.759 Error AppManager.cpp:697: Failed to load tutorial: Error while applying migration: Cargo Ships: migrations-0-1-11.lua

__cargo-ships__/migrations/migrations-0-1-11.lua:2: module logic.oil_placement not found;  no such file __cargo-ships__/migrations/logic/oil_placement.lua no such file __core__/lualib/logic/oil_placement.lua
stack traceback:
  [C]: in function 'require'
  __cargo-ships__/migrations/migrations-0-1-11.lua:2: in main chunk

After removing Cargo Ships (it's loading before GCKI), I've seen the crash you reported. Investigating now. :-)

1 year, 10 months ago
(updated 1 year, 10 months ago)

My problem was slightly different from yours. Usually, I require() all necessary files in control.lua, and the global variables used by my mod are set up when migration files are loaded. However, when I loaded the tutorials, script.mod_name was "level" instead of the name of my mod, and I guess all my global variables were unset. I've had to use absolute instead of relative pathnames (thanks for pointing that out in your bug report on the forum!) when requiring files, and add

GCKI = GCKI or require('__GCKI__.common')()

to each migration file, because GCKI would only survive for as long as the migration file where it was required would run.

1 year, 10 months ago

Fixed in version 1.1.5.

New response