Jump to content
Sign in to follow this  
nullsystems

OnSingleMapClick for planes..never on target?

Recommended Posts

Hi all, real simple:

Got a lil problem with OnSingleMapClick.

I have a plane which goes to the location clicked on the map...

However, its always slightly off by about 50 meters either way.

Do you have any idea why?

When I try it with a heli, it can be as much as 100 meters away.

How odd lol

Share this post


Link to post
Share on other sites

onMapSingleClick "pilot1 domove _pos"

Also, how can I store that position into a variable?

Thank you in advance!

Share this post


Link to post
Share on other sites

I got the same problem.

I want a chopper to land at a smokesignale, the smokesignale is "correcte" but the chopper lands 50-100 metres to short of LZ.

Share this post


Link to post
Share on other sites

It's because of the movement precision.

Different types of classes have different movement precision.

Here are the values:

Car, Motorcycle: 10

Tank: 5

Man: 1

Air: 100

Plane: 200

Ship: 25

...etc., i won't list them all - you can see that in the main config (not only in the main config).

So, i think this has something to do with your problem.

Cou can try different behaviours/combat modes, and see whether it makes any difference, but the best would be if you could change the mission so it won't matter when the unit is slightly off the desired position because you never know what can be standing in the way, etc..

Share this post


Link to post
Share on other sites

Nice explanation, that makes sense. Thank you.

Ive noticed the longer the "run up " the better precision there is to landings etc.

Any ideas on the onmapclick variable setup?

Share this post


Link to post
Share on other sites
Any ideas on the onmapclick variable setup?

Sorry, but I only got it working for singelplayer, not multiplayer.

Hoping someone could help me with that to.

Trying to use datakill heli-script, but it only works in SP. Not on a dedicated server.

Share this post


Link to post
Share on other sites
Any ideas on the onmapclick variable setup?

Sorry, but I only got it working for singelplayer, not multiplayer.

Hoping someone could help me with that to.

Trying to use datakill heli-script, but it only works in SP. Not on a dedicated server.

What is the problem? Is it that your mapclick doesn't work, or that it is the script which is run from it doesn't work?

As i understand it, the onMapSingleClick command is local to wehre it was run - if you use this command on player1 computer, then it will run the desired script only when player1 clicks into the map.

So, there shouldn't be ANY problems in MP.

I think your problem lies somewhere in that "datakill" script.

Maybe if you would post it, we could see where the problem is.

Share this post


Link to post
Share on other sites
Any ideas on the onmapclick variable setup?

I am not sure i understand what is your question.

Would this help? onMapSingleClick

...or are you asking for something else?

Share this post


Link to post
Share on other sites

When you get the pos (_pos), in your script, set the var to = that. then set the Var PublicVariable "Var" and every one in the MP game will be able to find the position.

ie,

MapClickPos = _pos;

PublicVariable "MapClickPos";

Hope that helps

Cheers

GC

Share this post


Link to post
Share on other sites

oki, I'm no good at scripting, but this was the last thing I have tried.

I use datakill script and then I have modified it a bit to suite me.

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

MapClickPos = _pos

PublicVariable "MapClickPos"

"lz" setMarkerPos MapClickPos

"lz" setMarkerType "Pickup"

air1 move getMarkerPos "lz"

smoke = "SmokeShellGreen" createVehicle (getMarkerPos "lz")

air1 flyinheight 40

air1 SetSpeedMode "FAST"

air1 setBehaviour "CARELESS"

@moveToCompleted air1

~4

hint "Evac on the way"

air1 flyinheight 0

#End

hint "Evac ready"

exit

This does not work in SP, I haven't had the time to test it on a dedicated server yet. Could someone enlighten me??!!

Best retard NoBrainer

Share this post


Link to post
Share on other sites

Agree with Cloughy's posting.

The publicvar is good enough for storing the value on the serverside or publish to all clients as needed...

Share this post


Link to post
Share on other sites

If you want your chopper to land at a precise area you can use an invisible H, and of course the land command (flyInHeight by itself is a very questionable method for landing a chopper, it immediately forces the chopper to the ground without the pilot positioning the chopper over a suitable area to land).

Share this post


Link to post
Share on other sites
If you want your chopper to land at a precise area you can use an invisible H, and of course the land command (flyInHeight by itself is a very questionable method for landing a chopper, it immediately forces the chopper to the ground without the pilot positioning the chopper over a suitable area to land).

so if I place the invisible H where the marker is and then tell the chopper to alnd at it, it may work??

Share this post


Link to post
Share on other sites

Yea AI pilots always use the nearest unobstructed H when landing (if there's one close enough).

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  

×