Jump to content
Sign in to follow this  
Softegg

Finding mines anywhere on island

Recommended Posts

is there a way to detect all mines on the whole island?

i placed a mine somewhere, named it: mine1

typeof mine1 returns: ""

so, how to search mines with nearestobject[player,"object"]?

my idea is:

finding a mine with:

nearestobject[_posi,"MineMine"]

setting a marker at this point

setting _posi at mine-posi

removing mine

searching next mine

Share this post


Link to post
Share on other sites
is there a way to detect all mines on the whole island?

i placed a mine somewhere, named it: mine1

typeof mine1 returns: ""

so, how to search mines with nearestobject[player,"object"]?

my idea is:

finding a mine with:

nearestobject[_posi,"MineMine"]

setting a marker at this point

setting _posi at mine-posi

removing mine

searching next mine

This should work, if you use the standard OFP antitank mine object:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#checkmine

_death= nearestobject [player, "MINE"]

? player distance _death < 1.5 : goto "explode"

~.5

goto "checkmine"

#explode

Boom="Heat105" CamCreate (getpos player)

player setdammage 99999999

exit

Share this post


Link to post
Share on other sites

k,

nearestobject[_posi,"Mine"]

works.

but i need to scan the hole island in steps of 64m, cause nearestobject seems to find things at about 50-75m maximum distance.

Share this post


Link to post
Share on other sites

Hi,

I noticed on some MP, Battlefield 1985 maps. A marker is displayed on the map when a player plants a mine.

You could DePbo to find out how, as I dont know how to detect when a mine is layed?

So if you maintained an array of all the the mines planted, you could use the "obj1 distance obj2" command?

Or you could hold an array of all the [X,Y] positions and use:

_Distance=Sqrt(((_MineXPos-_PlayerXPos)^2)+((_MineYPos-_PlayerYPos)^2))

Although I'm not sure how quick this would be compared to nearest object, if you had lots of mines and scanned ever 0.5 seconds.

Share this post


Link to post
Share on other sites

is there a mine detecting addon in progress or does such thing already exist in ofp? rock.gif would be usefull for the coc mines

md8-1a.jpg

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×