-
Notifications
You must be signed in to change notification settings - Fork 24
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
Errors when getting group name of a unit, leading to no stream kill events #209
Comments
Looks like ED broke something in the scripting... again. I will have a look at how to workaround this but please raise an issue on the ED forums and link it so we can track things their side as well. |
This was actually already reported. |
Not sure if this is the correct fix but to get the kill events i applied following patch: lua/DCS-gRPC/exporters/object.lua | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lua/DCS-gRPC/exporters/object.lua b/lua/DCS-gRPC/exporters/object.lua
index cc791e4..422be8c 100644
--- a/lua/DCS-gRPC/exporters/object.lua
+++ b/lua/DCS-gRPC/exporters/object.lua
@@ -17,6 +17,11 @@ GRPC.exporters.position = function(pos)
end
GRPC.exporters.unit = function(unit)
+ local group = Unit.getGroup(unit)
+ if group then
+ group = GRPC.exporters.group(group)
+ end
+
return {
id = tonumber(unit:getID()),
name = unit:getName(),
@@ -24,7 +29,7 @@ GRPC.exporters.unit = function(unit)
coalition = unit:getCoalition() + 1, -- Increment for non zero-indexed gRPC enum
type = unit:getTypeName(),
playerName = Unit.getPlayerName(unit),
- group = GRPC.exporters.group(Unit.getGroup(unit)),
+ group = group,
numberInGroup = unit:getNumber(),
rawTransform = GRPC.exporters.rawTransform(unit),
} Should a unit always have a group? |
Yes units always have groups. This issue is due to ED changing things and making units not units anymore, but statics, probably as an attempt to optimise things. Making group optional is going to be a right pain for clients. Grimes suggested that there is a very hacky workaround to this bug of getting the group by mangling the unit name to remove the unit specific information and onyl leave the group then use |
Clarified with Grimes and it appears that what needs to happen is that lua scripters need to create a lookup table for units to groups which is a right pain in the arse to do since we now have to manage unit state in parallel with DCS's own unit state and risk desync. so we have two crappy options to choose from... thanks ED |
sigh |
…static on death
The following is in our log:
This links to this line in object.lua:
The text was updated successfully, but these errors were encountered: