Jump to content
aerandir

i need help with a script mission

Recommended Posts

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.

Link to comment
Share on other sites

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;

 

Link to comment
Share on other sites

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;

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...