Jump to content
Ramsen V

Cannot disable map clicked move command for player vehicle

Recommended Posts

Evening all,

 

In my mission I am the commander of an APC vehicle and I use my own High Command system I created and also make use of the Orbat module but if click on the Orbat Icon or click on a group I want to activated for my high command (using onMapSingleClick) the vehicle I am in starts driving there!?

 

I have tried:

 

_veh = vehicle player;

 

_veh move getPos player; // Did not work.

{doStop _x} forEach crew _veh; // Did not work.

{_x doMove getPos player} forEach crew _veh; // Did not work, crew exited the vehicle, got back in and continued to drive to my 'map click'

_veh setFuel 0; // Worked, but as soon as I set the fuel to 1 again the vehicle just drives to the mapclick i done ten minutes earlier!

{_x disableAI "PATH"} forEach crew _veh // Worked, but same as setFuel 1 above when enableAI "PATH" is set.

 

I just cannot stop the vehicle from moving to my map click? It's like a map click move command overrides all other commands?

 

So, a seriously annoying issue that I really need fixing so as to be able to access Orbat or use onMapSingleClick (for my high command script) without the vehicle moving to wherever I clicked!!

 

Any suggestions or solutions welcome.

 

Thank you for reading.

 

Cheers.

 

 

Share this post


Link to post
Share on other sites

BUMP

 

If it is not possible to cancel the mapClick move order for vehicles please let me know.

 

The only way I can do it is the usual way, which is to select the driver and command him to stop using the menus!

 

I think there is a commandStop script command I have not tried that yet? I may try that latter when I'm back on Arma. Also I need to double check that the code is not running within the onMapSingleClick code otherwise it will not work unless passing the params before hand and then using _this select.

 

But again any help would be appreciated as I'm still stuck on this at the moment.

 

Cheers.

Share this post


Link to post
Share on other sites
On 9/2/2023 at 12:22 AM, Ramsen V said:

 I am the commander of an APC vehicle and I use my own High Command system I created and also make use of the Orbat module

but if click on the Orbat Icon or click on a group I want to activated for my high command (using onMapSingleClick) the vehicle I am in starts driving there!?

So, a seriously annoying issue that I really need fixing so as to be able to access Orbat or use onMapSingleClick (for my high command script) without the vehicle moving to wherever I clicked!!

 

2 hours ago, Ramsen V said:

If it is not possible to cancel the mapClick move order for vehicles please let me know.

 

The only way I can do it is the usual way, which is to select the driver and command him to stop using the menus!

Also I need to double check that the code is not running within the onMapSingleClick code otherwise it will not work unless passing the params before hand and then using _this select.

 

Well. If you want help, you should share some info, not imagine the readers understand what you are scripting!

SP or MP?

Mod(s)?

What's your own high command system???

What's your onMapSingleClick code ?  and what for?

 

For instance, onMapSingleClick command is not stackable. That means the last one will crush the previous ones. It's preferable using the MEH "mapSingleClick"

 

Share this post


Link to post
Share on other sites
11 hours ago, Ramsen V said:

f it is not possible to cancel the mapClick move order for vehicles please let me know.

 

It is possible.  Commander clicking on map to tell the driver where to go is default engine behavior.  onMapSingleClick uses a true/false flag at the end of the code to tell the engine whether the map click code completes the click sequence or not.  By default it passes false, indicating not complete, so default engine behavior will follow.  You pass true, and it prevents the engine from carrying out default map click behavior.  See example 4 on the page.

Share this post


Link to post
Share on other sites

@opusfmspol Thank you for your explanation, I did check out those examples before, but looking at the examples 4 - 6 has got me thinking, I'm not sure if it will solve the issue because it is, as you say, default engine behavior, I am not on Arma now but will try a few more things later. Thx.

 

@pierremgi I do apologize, I should have not confused everyone by mentioning the rest of the code which is not really relevant in this case. My high command code and the Orbat Icon are activated after the map click is made which is where the problem lies. The reason I mentioned the code was because (as a player commander in AI driven vehicle) I wanted to try and stop the vehicle after the default map click move command activates, which I want reserved for the onMapSingleClick script command and the Orbat function/icon. EDIT: Sorry forgot to mention this is a single player mission.

 

Anyhow, thanks for the mission event handle 'mapSingleClick' I will try this and few more things later when I'm back in the editor. It may not be possible because, as the guy above said, it is default engine behavior so I may not be able to get round it...

 

Thank you both again.

Cheers.

Edited by Ramsen V
Added information

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

×