aerandir Posted September 16, 2020 Report Share Posted September 16, 2020 Hi all! I try to do a missions for EM4 but have some difficults with scripting. Can anyone help me with this? This is my script fail : ############## float dx, dy, dz; float px, py, pz; debris01.GetPosition(dx, dy, dz); injuredUnderDebris.GetPosition(px, py, pz); if ( Math::dist(dx,dy,dz, px, py, pz) < MIN_DEBRIS_DIST ) { return false; } return true; ############# (Error: Can't call GameObject::GetPosition(dx,dy,dz) in current scope) How can edit this for work? thanks for you comments. Quote Link to comment Share on other sites More sharing options...
itchboy Posted September 17, 2020 Report Share Posted September 17, 2020 There is a much more efficient method that doesn't involve Vectors or float values if you are merely looking to get the distance between 2 objects (irrespective of angle or direction): if (debris01.GetBoundingRadiusDistXYToObject(&injuredUnderDebris) > MIN_DEBRIS_DIST) return false; return true; Quote Link to comment Share on other sites More sharing options...
aerandir Posted September 17, 2020 Author Report Share Posted September 17, 2020 Thanks for the reply but Failed "&injuredUnderDebris" I'm trying to adapt mission scripts from EM3 to EM4 but they all give an error when searching for positions (X Y Z). How I could make them work in EM4? I'm too bad with the scripts... Quote Link to comment Share on other sites More sharing options...
itchboy Posted September 18, 2020 Report Share Posted September 18, 2020 My bad, the parenthesis portion of GetBoundingBoxXYZ only accepts "Actor" variables, not person ones. I will need to see the full code and I'll probably rewrite the whole thing for you if you can send me a "test version" of the mod through private message. If you are interested in adopting Em3 to Em4 as a mod, please let me know. I am willing to provide assistance wherever I can because I have been waiting years for somebody to try. I thought it over for an entire day. Here's another way to find distance. Vector injuredPos = injuredUnderDebris.GetPosition(); Vector debrisPos = debris01.GetPosition(); float distance = Math::dist(injuredPos.x, injuredPos.y, debrisPos.x, debrisPos.y); if (distance > MIN_DEBRIS_DIST) return false; return true; Quote Link to comment Share on other sites More sharing options...