Project Zomboid

Project Zomboid

126 arvostelua
[b41/42] Power Window Controls
2
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Tiedostokoko
Julkaistu
Päivitetty
1.534 MB
8.6.2021 klo 5.01
22.8. klo 16.10
6 muutosilmoitusta ( näytä )

Tilaa ladataksesi
[b41/42] Power Window Controls

Kuvaus
Now available for Build 42 - a few minor new features have shipped along with the update.

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 too 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, placing 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.
A PTBR translation has been integrated with the 1.1 update, originally uploaded here: Power Window Controls PTBR.

The mod is entirely client side and tested on both b41 and b42 unstable. Load order should be irrelevant.

Do note that you don't get "power windows" without power - a flat or missing battery will prevent the options to control distant windows from being given to you. This is only a check though - operating windows does not consume any battery power.

With the 1.1 update the UI icons have been updated to be more dynamic - the square grid will try to match the layout of your car, showing a 2x2 for four door sedans, a single row of two for coupes and the original 2x3 grid for six door cars. Although I use "door" loosely here - the mod still looks only for windows with open/close functionality. Oh, and the "close" icons will now highlight the square in red instead of green.

The mod now supports cars with exceptional treatment: currently AutoTsar's Jeep Wranglers have been added, such that their tent windows are ignored. But further entries can be added easily - see the special thread for suggestions.

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.
Steam user Não é o Gui for the previously separately uploaded PTBR localization.

Tags:B41,B42,Cars,Vehicles,Interface,Tweak

Workshop ID: 2511087277
Mod ID: WolfWindowControls
Suositut keskustelut Näytä kaikki (3)
5
10.6.2021 klo 7.14
TÄRKEÄ: Translation Submissions
Wolf
3
23.3.2022 klo 10.21
Possible compatibility issues
FatherSarge
0
22.8. klo 16.25
TÄRKEÄ: Exception Vehicles Submissions
Wolf
33 kommenttia
Wolf  [tekijä] 22.8. klo 16.42 
Oh and for anyone looking to use this mod once again: I've changed the display name seen in the mod manager to match that seen here on the Steam page. So in alphabetical order it's now at "P" for "Power", not "W" for "Wolf's" like before.
Wolf  [tekijä] 22.8. klo 16.34 
@404exe @UndeadLokemaniac

Sorry folks, kept getting dragged off by other things and forgetting about this. I've now dipped my toes into Build 42 for the first time and, after an embarassing amount of trial and error, repackaged the mod to satisfy b42's structure requirements. I've also had to clean up a bunch of my old half-broken developments from my working copy. Unfortunately I wasn't able to find the methodology to finish the Big One~, but I did still finalize and throw in a few minor updates.
404exe 7.8. klo 9.17 
@Wolf any progress? I miss your mod in b42!
UndeadLokemaniac 29.6. klo 12.58 
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.1. klo 18.07 
@Wolf thank you, believe your mod isn’t an issue believe someone was just abusing a speed cheat
Wolf  [tekijä] 25.1. klo 22.22 
@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.1. klo 13.22 
This mod needs to be fixed if moving forward for B42
iDestin 25.1. klo 13.22 
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.11.2024 klo 9.18 
Four-door cars are suddenly a lot less frustrating to vent on a hot day. Thanks so much for this mod!
Wolf  [tekijä] 7.11.2024 klo 4.23 
@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.