Project Zomboid

Project Zomboid

131 evaluări
Power Window Controls
2
   
Premiază
Adaugă la preferate
Preferat
Elimină din preferate
Dimensiunea fișierului
Postat
Actualizat
1.613 MB
8 iun. 2021 la 5:01
13 oct. la 13:56
7 jurnale de actualizare ( vizionare )

Abonează-te pentru a descărca
Power Window Controls

Descriere
Version 1.2 - the driver can now close/open all windows at once with one UI button.

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, CN and PTBR languages.

The mod is entirely client side on b41. The b42 version now has some code shared between client and server (since the base game has moved some functions the mod duplicates there). Until b42 multiplayer arrives, this should be irrelevant. Load order should be as well, for both versions.

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.

With the 1.2 update the driver now has an option to open all closed or close all open windows simultaneously with one button. The buttons will only appear when more than one window would be affected.

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,QoL

Workshop ID: 2511087277
Mod ID: WolfWindowControls
Discuții populare Vezi toate (3)
5
10 iun. 2021 la 7:14
IMPORTANT: Translation Submissions
Wolf
3
23 mart. 2022 la 10:21
Possible compatibility issues
FatherSarge
0
22 aug. la 16:25
IMPORTANT: Exception Vehicles Submissions
Wolf
37 comentarii
Wolf  [autor] cu 11 ore în urmă 
@猫子

So I did try my hand at it and did end up running into that "practical problem" I was expecting. It ended up taking some experimenting and playing around with hacky workarounds for a few evenings, but I did eventually find a nice, clean implementation closely copying how the vanilla game handles these actions, which I am quite happy to put into the public version.

The new update with the "Open All"/"Close All" buttons is now out. Do note that the new buttons will only appear if there's more than one window for them to affect. I.e. "Close All Windows" will only show up if you have at least 2 windows open at the time.
猫子 11 oct. la 0:00 
Oh! Really? ! That's great! Thank you very, very much.
Wolf  [autor] 10 oct. la 23:50 
@猫子

I was thinking of it before. With the way this script hooks into a vanilla function, I think it should be possible in theory, but it might cause issues in practice. I'll experiment with it later and see what I can do.
猫子 10 oct. la 0:53 
Can the function of opening/closing all the car windows with one click be realized?
Wolf  [autor] 22 aug. la 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  [autor] 22 aug. la 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 aug. la 9:17 
@Wolf any progress? I miss your mod in b42!
UndeadLokemaniac 29 iun. la 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 ian. la 18:07 
@Wolf thank you, believe your mod isn’t an issue believe someone was just abusing a speed cheat
Wolf  [autor] 25 ian. la 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.