chromium Posted January 16, 2015 Posted January 16, 2015 Hi, I'm looking for a way to create a table, starting from MIST dbs, of all the enemy units that are or has been visibile in the F10 "fog of war" map. At date, I need to store those information: -Unit ID -Group ID -Unit Position -LastUpdateTime (last time in seconds where the unit has been visible in F10 map) I'm already ok about table structure, data update and duplicates handling... but... I'm almost blind about how to understand which unit is visibile on F10 and which are not. Any suggestion? Thanks! Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
vicx Posted January 16, 2015 Posted January 16, 2015 (edited) I would poll all friendly units and get their detected targets and then apply some filters depending on how rigorous I wanted to be. for _,_group in pairs(coalition.getGroups(coalition.side.BLUE,nil)) do for _,_unit in pairs(_group:getUnits()) do _controller = _unit:getController() _detectedTargets = _controller:getDetectedTargets() for _,_target in pairs(_detectedTargets) do _target = _target.object _detected, _visible, _distance, _type, _time, _last_position, _last_velocity = _controller:isTargetDetected(_target,nil) if _visible then AddVisible(_target, _target:getGroup(), _target:getPosition(), _timer.getTime(), ) end if _last_position then AddGhost(_target, _target:getGroup(), _last_position, _time, ) end end end end Yes you should replace coalition.getGroups(coalition.side.BLUE,nil) with a MIST DB. Right now I am actually testing what the ghost unit icon in the F10 view actually means. It is either that the unit type is unknown OR that the unit cannot be ranged. I doubt it has anything to do with unit visibility because the ghost moves instead of staying in last known position. I think we could actually improve on the F10 map and make a better FOG of WAR mode. Share what you find Chomium. Edited January 16, 2015 by vicx
chromium Posted January 16, 2015 Author Posted January 16, 2015 Thanks for the hint, I'll check it asap and share result and code. Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
chromium Posted January 22, 2015 Author Posted January 22, 2015 Still working on that, cause for other reason I need a lot more of information... at the moment I'm relying on my old code, that simply check LOS taking into account earth curvature and a fake "detection limit distance". (waiting for EDGE). As soon as I got a working solution I'll post it here :) Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
Recommended Posts