Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RunwayTouch and RunwayTakeoff for more accurate TakeOff and Lan… #272

Merged
merged 1 commit into from
Nov 5, 2024
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
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
Loading