Surrexen Posted August 30, 2019 Share Posted August 30, 2019 I'm having trouble working out how to distinguish between certain missile types via a script. If I have this: local ShotWeapon = EventData.weapon:getDesc() local ShotCategory = ShotWeapon.category local ShotMissileCategory = ShotWeapon.missileCategory local ShotMissileGuidanceType = ShotWeapon.guidance And then test for this: if ( ShotMissileCategory == 6 ) then --do stuff That will pick up Mavericks, Harms and oddly enough Harpoons. How can I then tell them apart? Also shouldn't Harpoon be classed as an Anti-Ship missile where ShotMissileCategory should equal 4 and not 6? Link to comment Share on other sites More sharing options...
Hardcard Posted August 30, 2019 Share Posted August 30, 2019 If you're using MOOSE, this is will give you the names of the missiles (it's available for SHOT events): EventData.WeaponName [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Grimes Posted August 30, 2019 Share Posted August 30, 2019 getTypeName() works with any weapon object. As for why the guidance type or missileCategory might not always have the expected values, it likely has to do with how the weapon is defined. As I understand it there are broad categories for weapons within the game and there is basically a template flight profile that weapons within that category follow. As some weapons get updated with AFMs or advanced behaviors the weapon might not fit that specific profile anymore. For instance most of the older ASM sea skim and then do a popup attack when near the target. The new Harpoon descends or maintains altitude until it finds a target, then sea skims, then depending on the setting do a popup attack or not. AI launched Harpoons still appear to follow the old profile though. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum Link to comment Share on other sites More sharing options...
Surrexen Posted August 31, 2019 Author Share Posted August 31, 2019 getTypeName() works with any weapon object. As for why the guidance type or missileCategory might not always have the expected values, it likely has to do with how the weapon is defined. As I understand it there are broad categories for weapons within the game and there is basically a template flight profile that weapons within that category follow. As some weapons get updated with AFMs or advanced behaviors the weapon might not fit that specific profile anymore. For instance most of the older ASM sea skim and then do a popup attack when near the target. The new Harpoon descends or maintains altitude until it finds a target, then sea skims, then depending on the setting do a popup attack or not. AI launched Harpoons still appear to follow the old profile though. Stellar .. thanks heaps Grimes :thumbup: Link to comment Share on other sites More sharing options...
Recommended Posts