Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.zip
/.idea/
*.iml
*.iml

.ai-sandbox.json
.claude/settings.local.json
1 change: 1 addition & 0 deletions AI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-- @history v1.0.0.0 - 2025-03-23 - Initial implementation
-- v1.1.0.0 - 2026-07-03 - Rename vd telemetry, expose implement functions on vehicle / implement
-- v1.2.0.0 - 2026-08-24 - Expose implement functions addressed at the selected machine
-- v1.2.1.0 - 2026-09-10 - Fix vdTelemetry integration reacting to other players in multiplayer
-- @Description: Registers additional input bindings
-- @web: https://grisu118.ch or https://vertexdezign.net
-- Copyright (C) Grisu118, All Rights Reserved.
Expand Down
37 changes: 28 additions & 9 deletions AISpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,42 @@ function AdditionalInputsSpec:onLoad(savegame)
self.spec_additionalInputs.debugger:trace("onLoad")
end

---Called when a player enters this vehicle.
---In multiplayer this is raised on every client for every player, so it also fires for
---remote players entering their own vehicles. isControlling is only true for the local
---player, everyone else must be ignored.
---@param isControlling boolean true if the local player is the one controlling the vehicle
function AdditionalInputsSpec:onEnterVehicle(isControlling)
if g_vdTelemetry ~= nil then
local spec = self.spec_additionalInputs
spec.debugger:trace(function()
return "onEnterVehicle(" .. tostring(isControlling) .. ")"
end)
local spec = self.spec_additionalInputs
spec.debugger:trace(function()
return "onEnterVehicle(" .. tostring(isControlling) .. ")"
end)

if not isControlling then
return
end

if g_vdTelemetry ~= nil then
g_vdTelemetry:setCurrentVehicle(self)
end
end

---Called when a player leaves this vehicle.
---Same multiplayer semantics as onEnterVehicle: raised on every client for every player,
---and additionally when a vehicle occupied by someone else is deleted or its player
---disconnects. wasEntered is only true if the local player was the one inside.
---@param wasEntered boolean true if the local player was controlling the vehicle
function AdditionalInputsSpec:onLeaveVehicle(wasEntered)
local spec = self.spec_additionalInputs
spec.debugger:trace(function()
return "onLeaveVehicle(" .. tostring(wasEntered) .. ")"
end)

if not wasEntered then
return
end

if g_vdTelemetry ~= nil then
local spec = self.spec_additionalInputs
spec.debugger:trace(function()
return "onLeaveVehicle(" .. tostring(wasEntered) .. ")"
end)
g_vdTelemetry:clearCurrentVehicle()
end
end
Expand Down
8 changes: 7 additions & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="111">
<author>VertexDezign</author>
<version>1.2.0.0</version>
<version>1.2.1.0</version>
<title>
<en>Additional Inputs</en>
<de>Zusätzliche Eingaben</de>
Expand Down Expand Up @@ -49,6 +49,9 @@ Please report feedback or issues on Github.
GitHub link: https://github.com/VertexDezign/AdditionalInputs

Changelog:
1.2.1.0:
* Fix multiplayer issue where the vdTelemetry integration reacted to other players entering or leaving their vehicles

1.2.0.0:
* Add public API to fold, lower and activate the currently selected machine

Expand Down Expand Up @@ -99,6 +102,9 @@ Bitte melden Sie Feedback oder Probleme auf Github.
GitHub-Link: https://github.com/VertexDezign/AdditionalInputs

Changelog:
1.2.1.0:
* Mehrspieler-Fehler behoben, bei dem die vdTelemetry-Anbindung auf andere Spieler reagierte, die ihre Fahrzeuge betraten oder verliessen

1.2.0.0:
* API hinzugefügt, um die aktuell ausgewählte Maschine ein-/auszuklappen, zu heben/senken und zu aktivieren

Expand Down
Loading