Jump to content
Sign in to follow this  
fish44

Measuring distance in OPF

Recommended Posts

I want to set up a firing range for sniper training, and would like to place targets a precise distances from the shooter. 100, 200, 300m etc.

Is there an easy way to do this in the editor.?

Is there a constant distance in a grid box?

Thanks,

Share this post


Link to post
Share on other sites

I think the standard grid size is 128x128 metres, since the standard island size is 12,8 km.

Another, "secret" trick is to go into map mode in the game, hold down Shift+Alt (or Ctrl, try the combos if the 1st doesn't work) and click on a place with left mouse button, and then click on the other spot. You'll get the distance in meters showing in a white text. Only tested in FDF as of yet, but might be an in-built feature, dunno.

Share this post


Link to post
Share on other sites

Probably the easiest way is to edit the coordinates in mission.sqm with notepad.

Share this post


Link to post
Share on other sites
Probably the easiest way is to edit the coordinates in mission.sqm with notepad.

Thanks,

Can you give me a bit more infor as to how i would do it that way?

Share this post


Link to post
Share on other sites

Well you make a new mission, place a suitable amount of targets, save it, open the mission.sqm in notepad and copy paste the coordinates from the first one, adding 100m more everytime on one axis. First coordinate is west-east, second height above sea-level and the third south-north. Then reload the mission and that's it.

If you must have the shooting range at an odd angle it will be easier to make a script than calculate the coordinates by hand.

Share this post


Link to post
Share on other sites

An easiest way is to use the "distance" command that returns the distance between to objects :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player distance object1 will return the distance between the player and an object called "object1". Just use a radio trigger (alpha for example, 0-0-1), repeatable, with this on its on activation line :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["%1", player distance object1]

And you'll get the distance of the object on screen.

Share this post


Link to post
Share on other sites

The simplest way to do this is to start a mission in cadet mode and then exit it and go back into the editor. Create a waypoint at whatever you estimate to be the right distance and then start the mission. Your cadet orange waypoint box will display the distance to your waypoint and you go from there.

Share this post


Link to post
Share on other sites

Well thanks for all the replies. Actually it was quite easy in the end with the advice from 'The Architect'..The grid within the editor has squares 100x100m. And his waypoint advice confirmed that. I also could have put a trigger on the map, and made i 100x100, That gives me precise distance in all directions.

So now that i have that one sorted, how can i put more than one rifle in a mission so that the soldier can choose from them for his practice? Can i adjust the contents of a ammunition case for example.

Share this post


Link to post
Share on other sites

Hmmmm, an oldie question.

Well. Use the "addweapon" and "addmagazine" commands for the soldier itself, and "addweaponcargo" and "addmagazinecargo" for vehicles and ammo crates.

For i.e. adding a machine gunner M16, 5 mags and 1 grenade. Place mags before the gun so that they're loaded at the beginning. "Removeallweapons" (removes everything: mags, binos, NVGs, weapons), "removeweapon" (removes the certain weapon), "removemagazine" (removes a certain type of mag) and "removemagazines" (same as before, but removes all the mags with the classname) aren't necesserily needed, depending on the default loadout of the unit.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">removeallweapons this; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addweapon "M16";; this addmagazine "handgrenade"

Same, but for an ammo crate/vehicle. 10x amounts

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addmagazinecargo ["M16", 50]; this addweaponcargo ["M16", 10]; this addmagazinecargo ["Handgrenade", 10]

For different classname, either try by trial and error (not recommended) or check community Biki and addon readmes for weapon/magazine classnames.

Share this post


Link to post
Share on other sites

Thanks BlackScorpion,

The second code sample cracked it for me.

Just removed all weapons from my guys, then placed an empty ammunition case, and populated it with M24's M21's and SVD dragnov's, and some magazines. Works like a treat.

Range is 100 to 700m at 100m intervals, and 1000m.

Anyone wants it PM me. it uses the WGL mod.

thumbs-up.gif

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  

×