Project Zomboid

Project Zomboid

118 ratings
Power Window Controls
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.150 MB
8 Jun, 2021 @ 5:01am
12 Jun, 2021 @ 1:11am
5 Change Notes ( view )

Subscribe to download
Power Window Controls

Description
This is a simple lua script that enables the player in the first (driver) seat of a vehicle to control all openable windows with additional buttons on the vehicle radial menu, much like in any modern car.

I'm told power window controls were commonspread enough in the early nineties, so hopefully seeing them on every car won't feel anachronistic, but regardless of that, this was made primarily as a workaround for a technical limitation in vanilla Zomboid.
By default, to see if you should be given control over a window, the game checks what seat you're in, then checks if that seat has a door on the same spot and, if it does, checks if that door has an openable (and unbroken) window on the same spot.
So let's say you're Filibuster Rhymes, coding whole 4 openable windows into your RV that... only has one door. What you end up with is 3 factually unusable windows.

The method this mod employs eliminates the middleman in the door and, when you are in the driver seat, directly scans for window parts with the following IDs:
WindowFrontLeft
WindowFrontRight
WindowMiddleLeft
WindowMiddleRight
WindowRearLeft
WindowRearRight
and adds the options to open/close them to the radial menu if they are present, not broken and can be opened/closed.
(if you make a vehicle with openable windows with different IDs, hit me up)

The front left (driver's) window will show up with the normal "Open/Close Window" segment, while others will display a custom prompt and a modified icon to indicate which window it is. The text prompts are currently provided for the EN, DE, RU and CN localizations.
Apparently someone has also released a separate localized verison: Power Window Controls PTBR.

The mod was made and tested on b41 IWBUMS, but theoretically it should also work with the stable build, it doesn't do all that much (if you do try it on b40, especially with other mods, let me know how it goes). Load order is irrelevant.


Credit goes to:
Aiteron and their Better Towing, where I spied a method to inject my code into the radial menu.
Filibuster Rhymes and their Used Cars, or more specifically, their Fleetwood Bounder RV which basically inspired this mod.
My friend Peach for helping with the localization.
Steam user Bazooka for the Simplified Chinese translation.

Tags:B41,Cars,Vehicles,Tweak

Workshop ID: 2511087277
Mod ID: WolfWindowControls
Popular Discussions View All (2)
5
10 Jun, 2021 @ 7:14am
PINNED: Translation Submissions
Wolf
3
23 Mar, 2022 @ 10:21am
Possible compatibility issues
FatherSarge
30 Comments
UndeadLokemaniac 29 Jun @ 12:58pm 
I love this mod and I hope it gets updated for b42 at some point. I used it all the time with b41 and when I play on it, I still use it.
iDestin 26 Jan @ 6:07pm 
@Wolf thank you, believe your mod isn’t an issue believe someone was just abusing a speed cheat
Wolf  [author] 25 Jan @ 10:22pm 
@iDestin
I see. I haven't touched B42 myself yet, but it does sound like they changed something fundamental, based on that error.

I'll try to check it out some time; sounds like I might even end up having to make a separate version for 42.
iDestin 25 Jan @ 1:22pm 
This mod needs to be fixed if moving forward for B42
iDestin 25 Jan @ 1:22pm 
function: showRadialMenu -- file: WolfWindowControl.lua line # 102 | MOD: Wolf's Window Controls
function: onKeyStartPressed -- file: ISUIHandler.lua line # 52 | Vanilla
java.lang.RuntimeException: attempted index: isOpenable of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:92)
at zombie.input.GameKeyboard.update(GameKeyboard.java:106)
at zombie.GameWindow.logic(GameWindow.java:249)
gleeby deeby 22 Nov, 2024 @ 9:18am 
Four-door cars are suddenly a lot less frustrating to vent on a hot day. Thanks so much for this mod!
Wolf  [author] 7 Nov, 2024 @ 4:23am 
@Antonwerffds This should be compatible with any mod cars as long as they have windows internally defined as the six options above. So most.

This should at least create no conflicts, so even in the worst case scenario some vehicles (or only some windows in some vehicles) will just not have remote control featured in this mod, but the game will still run with no errors.
Antonwerffds 7 Nov, 2024 @ 4:01am 
Does this KI5 cars accept ?
Wolf  [author] 13 Oct, 2024 @ 7:49pm 
@Ryan No, that one is from something else and I honestly don't even remember what. Only the window actions are added with this addon.
Ryan 12 Oct, 2024 @ 6:51pm 
that (P) sign is it from this mod or from another mod? and what does it do?