beo6 Posted May 26, 2013 Share Posted May 26, 2013 i have seen the GetDistanceToEntity function in the GoblinAI.lua file but havent found it in the Command Reference Documentation. Maybe i am blind but it is really useful and should be in there. Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 26, 2013 Share Posted May 26, 2013 Didn't know it existed. I use entity.getposition().distance(target). Link to comment Share on other sites More sharing options...
beo6 Posted May 26, 2013 Author Share Posted May 26, 2013 i think you meant DistanceToPoint. True that would work but is a lot more to write. like self.entity:GetPosition():DistanceToPoint(self.target:GetPosition()) not sure if chaining functions in lua works this way Link to comment Share on other sites More sharing options...
cassius Posted May 26, 2013 Share Posted May 26, 2013 EntityDistance existed in le2. It seems to be absent from Leadwerks 3. Strange it was VERY usefull. amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
beo6 Posted May 26, 2013 Author Share Posted May 26, 2013 it does exist in Leadwerks 3. look into the GoblinAI.lua script. it is just called GetDistanceToEntity. I wonder how many other undocumented functions there are. Link to comment Share on other sites More sharing options...
Admin Posted June 21, 2013 Share Posted June 21, 2013 Dozens. But if it's not documented, it may change at any time, or may not work correctly. Since we used this in a script, it should be documented. Link to comment Share on other sites More sharing options...
cassius Posted June 21, 2013 Share Posted June 21, 2013 Vec3 position = entity->GetPosition(true); float dist = position.DistanceToPoint(otherentity->GetPosition(true)); amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Admin Posted June 25, 2013 Share Posted June 25, 2013 Confirmed, low priority. Link to comment Share on other sites More sharing options...
Josh Posted October 9, 2013 Share Posted October 9, 2013 Added Entity::GetDistance: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitygetdistance-r800 Entity::DistanceToEntity will remain in the engine as an undocumented command, for backwards compatibility. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts