TEMPEST.114 Posted October 11, 2022 Posted October 11, 2022 It’s in the Take off event but not in the birth or enter unit events and it would be a huge help if it was as there’s no way to know which base a newly spawned client is in with out brute force point interrogation! Thanks 1
cfrag Posted October 12, 2022 Posted October 12, 2022 Agreed, it would be a nice addition. In the mean time, you can get the unit from initiator, and Unit.getPoint() for the location of the unit Provided that the unit was spawned on an airfield (make sure via a check of alt versus land.height() at that location), all you need to do is iterate all airfields (via Coalition.getAirfields()) and pick the one with the closest distance to the unit. Not elegant, agreed, but workable. -ch 1
TEMPEST.114 Posted October 12, 2022 Author Posted October 12, 2022 @cfragThat's what I'm trying to work out how to do right now. Thanks.
PravusJSB Posted January 13, 2023 Posted January 13, 2023 -- I thought there was an event.place object (Airbase) if not you could... local c_pos = event and event.initiator and event.initiator:getPlayerName() and event.initiator:getPosition() or nil local n_base = c_pos and c_pos.p and Airbase.getNearset(c_pos.p) or nil local b_name = n_base and n_base:getName() or nil Creator & Developer of XSAF ::An AI model that wants to kill you, and needs no help from humans. Discord: PravusJSB#9484 twitch.tv/pravusjsb https://www.patreon.com/XSAF https://discord.gg/pC9EBe8vWU https://bmc.link/johnsbeaslu Work with me on Fiverr: https://www.fiverr.com/pravusjsb
Recommended Posts