⚠️ Not yet verified in-game β this page was drafted from source analysis and hasn't been confirmed by actually running it. Treat it as a strong draft, not gospel.
OpenTankHatch
Module: opentankhatch.lua
Overview
The OpenTankHatch module is designed to open the driver hatch of a tank vehicle when it is activated. It checks if there is a driver in the vehicle; if not, it opens the hatch.
Inheritance
- Inherits from: none β base/utility module
- Imports: none
Instance pattern
This is a stateless utility module (no Create/instance pattern). It does not track any per-instance state.
Functions
OnActivate(guid, args)
Called when the object instance is activated. It checks if there is a driver in the vehicle; if no driver is found, it opens the driver hatch.
Events
- Listens for
Event.ObjectActivatedto callOnActivate.
Notes for modders
- This module is designed to be used with tank vehicles.
- Ensure that the vehicle has a door named βDriverHatchβ for this script to work correctly.
- The script does not handle cases where multiple drivers might be present; it only checks for the presence of one driver.