Skip to content

Commit

Permalink
Added RunwayTouch and RunwayTakeoff for more accurate TakeOff and Lan…
Browse files Browse the repository at this point in the history
…d events
  • Loading branch information
dutchie032 committed Nov 4, 2024
1 parent 4fbcedb commit 1111bdb
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Events `OnRunwayTouch` and `RunwayTakeoff` for "changed" TakeOff and Landing logic in DCS.

## [0.8.0]

### Breaking Changes
Expand Down
2 changes: 2 additions & 0 deletions STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ should use their independent logging and tracing functions.
- [x] `S_EVENT_HIT`
- [x] `S_EVENT_TAKEOFF`
- [x] `S_EVENT_LAND`
- [x] `S_EVENT_RUNWAY_TAKEOFF`
- [x] `S_EVENT_RUNWAY_TOUCH`
- [x] `S_EVENT_CRASH`
- [x] `S_EVENT_EJECTION`
- [x] `S_EVENT_REFUELING`
Expand Down
20 changes: 20 additions & 0 deletions lua/DCS-gRPC/methods/mission.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ GRPC.onDcsEvent = function(event)
},
}

elseif event.id == world.event.S_EVENT_RUNWAY_TAKEOFF then
return {
time = event.time,
event = {
type = "runwayTakeoff",
initiator = {initiator = typed_exporter(event.initiator)},
place = exporter(event.place),
},
}

elseif event.id == world.event.S_EVENT_LAND then
return {
time = event.time,
Expand All @@ -106,6 +116,16 @@ GRPC.onDcsEvent = function(event)
},
}

elseif event.id == world.event.S_EVENT_RUNWAY_TOUCH then
return {
time = event.time,
event = {
type = "runwayTouch",
initiator = {initiator = typed_exporter(event.initiator)},
place = exporter(event.place),
},
}

elseif event.id == world.event.S_EVENT_CRASH then
return {
time = event.time,
Expand Down
19 changes: 19 additions & 0 deletions protos/dcs/mission/v0/mission.proto
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ message StreamEventsResponse {
dcs.common.v0.Airbase place = 2;
}

// Occurs when an aircraft takes off from an airbase, farp, or ship.
message RunwayTakeoffEvent {
// The object that took off.
dcs.common.v0.Initiator initiator = 1;
// The airbase, farp or ship the unit took off from.
dcs.common.v0.Airbase place = 2;
}

// Occurs when an aircraft lands at an airbase, farp or ship.
message LandEvent {
// The object that landed.
Expand All @@ -127,6 +135,14 @@ message StreamEventsResponse {
dcs.common.v0.Airbase place = 2;
}

// Occurs when an aircraft lands at an airbase, farp or ship.
message RunwayTouchEvent {
// The object that landed.
dcs.common.v0.Initiator initiator = 1;
// The airbase, farp or ship the unit landed at.
dcs.common.v0.Airbase place = 2;
}

// Occurs when an aircraft crashes into the ground and is completely
// destroyed.
message CrashEvent {
Expand Down Expand Up @@ -539,6 +555,9 @@ message StreamEventsResponse {
LandingQualityMarkEvent landing_quality_mark = 39;
// @exclude 40 reserved for S_EVENT_BDA

RunwayTakeoffEvent runway_takeoff = 54;
RunwayTouchEvent runway_touch = 55;

// The following events are additions on top of DCS's own event enum,
// which is why they start at 8192 to give DCS plenty of space for
// new built-in events.
Expand Down

0 comments on commit 1111bdb

Please sign in to comment.