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

i [FIxed?] GCC+AAI=endless spam when driving

3 years ago

Hey! It's been a while since I played Factorio -_-
While the Autodrive mod is not updated for 1.1, I've been trying "AAI vehicles" for the same purpose. When I enter a car and drive it with a AAI Remote controller, I get that "claim this vehicle with keys" message endlessly whenever the vehicle stops. Is there a way to disable the hints?

3 years ago

Also, I've managed to get a crash when clicking with Keys on a Car after riding in a car driven with a AAI Remote controller

Мод Gizmos Car Keys (improved) (1.1.1) вызвал неустранимую ошибку.
Пожалуйста, сообщите об этой ошибке автору мода.

Error while running event GCKI::on_built_entity (ID 6)
GCKI/control.lua:1433: attempt to index local 'locked' (a number value)
stack traceback:
GCKI/control.lua:1433: in function <GCKI/control.lua:1395>

3 years ago
(updated 3 years ago)

Hey! It's been a while since I played Factorio -_-

Hi! It's been a while since I meddled with GCKI, there are some major changes in BI ahead that have kept me quite busy, So, sorry for not replying sooner.

While the Autodrive mod is not updated for 1.1, I've been trying "AAI vehicles" for the same purpose. When I enter a car and drive it with a AAI Remote controller, I get that "claim this vehicle with keys" message endlessly whenever the vehicle stops. Is there a way to disable the hints?

Lines 2210f. in control.lua:

        -- Inform player that the vehicle can be claimed
        GCKI.output(player, {"GCKI-messages.vehicle_available", GCKI.loc_name(vehicle)})

Commenting this will get rid of the spam, but there should be a better solution. With AAI Programmable Vehicles, GCKI will do way more than usually necessary. For some reason, AAI replaces the vehicle whenever it has reached a waypoint (could be related to it using unit prototypes for pathfinding). So I guess AAI will evict the driver (the vehicle still exists, so you are informed that you can claim the vehicle), destroy the old vehicle, create a new one, and put the player character into that again. Therefore, on_driving_state changed will be triggered two times at each waypoint -- that's definitely a waste of UPS. I hope I can figure something out …

3 years ago
(updated 3 years ago)

Also, I've managed to get a crash when clicking with Keys on a Car after riding in a car driven with a AAI Remote controller

Thanks! I've never found it because it would only occur in multi-player mode. It's easily fixed:

In control.lua, change line 1433 from

      color_vehicle(locked.entity)

to

      color_vehicle(global.GCKI_vehicles[locked].entity)
3 years ago
(updated 3 years ago)

About the spam problem: I still haven't found a reasonable solution for the core problem (AAI destroying/creating vehicles). There may be a way if the new vehicle was created before the old one was destroyed, and if AAI would inform GCKI that it's going to move players from one vehicle to another. This way, I could skip the on_driving_state_changed event completely, which would also get rid of the messages. Alas, I can't do that without Earandel's cooperation. I'll ask him if he'd be willing to use an interface I provide, but the final decision is up to him, of course.

I can do something to cure the symptoms, though. The easiest way is to add a user setting that will silence GCKI. There's already a wrapper function in place for printing info messages to a particular player. It would be simple to check for that player's setting before actually outputting these messages. However, this would make the mod completely silent and you may miss some crucial information (e.g., did you really claim a vehicle or didn't it work because you clicked accidentally clicked beside it the first time and the second click followed too fast). Would that be acceptable?

Another way is to measure the time between two events and only output the message if at least 10 seconds have passed since the last message has been printed. Of course, if you're driving in a vehicle for a long time, there still will be some spam if you pass many waypoints, so this wouldn't solve the problem completely.

3 years ago

I'd vote for disabling the "claim this vehicle with keys" message with a player setting.

3 years ago
(updated 3 years ago)

I didn't think of that -- it's a good idea, though! Should I make that setting generally available, or depending on other mods (AAI and possibly others that cause a lot of spam)?

3 years ago

Making a setting for turning off "tutorial" messages generally available would be great!

3 years ago

Check your PMs on the forum -- I think I've got the spamming issue fixed! This involves a minor patch to AAI for now. If you can confirm that it works without breaking anything, I'll send it on to Earendel.

3 years ago

Although I am quite interested, sadly I won't have time to play until Saturday =(

3 years ago

OK, no problem. I'm currently cleaning up the code, putting tests that turn up all over again into separate functions, moving stuff to different files instead of keeping everything in one huge file. There's a lot of potential for making small mistakes that will cause crashes or (even worse) things not working as expected, so testing that version would be even better. In case you wonder why I go through all that trouble: It's about laying the ground for adding spidertrons to GCKI. :-)

3 years ago

Good news: Earendel has accepted my patch for AAI Programmable vehicles, so the new code in GCKI for skipping the on_player_driving_changed_state event will officially work with the latest version of AAI! There's still some SE-related stuff I want to get ready before release, though …

3 years ago

I'm giong to celebrate that! *buys a pizza

1 year, 11 months ago

FIxed in version 1.1.2! :-)

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

8.050 Error ModManager.cpp:1560: Не удалось загрузить мод "GCKI": Failed to load locale: Duplicate key "hints-warn_guest" in property tree at ROOT.GCKI-messages.

RU locale
I've also tried with my language pack mod disabled - it hasn't helped.

1 year, 11 months ago

Thanks for the report! These are new keys, so your modpack doesn't know about them yet. The mistake is mine: I copied the new line from the English version over to the Russian file, so whoever translates the mod would see the current version of the English string. Of course, I've forgotten to comment out the double, and I never noticed because the Russian translation is totally out of sync with the new strings anyway, so I never bothered to test it. :-)

I'll update later today. For the time being, just comment out lines 9 and 12 from locale/ru/messages.cfg! The game started for me in Russian after I've done that, so there shouldn't be any more duplicates.

By the way, I'd be grateful if you'd rework the translation. There are a couple of new strings, and I think I changed several of the old ones.

New response