Jump to content
Sign in to follow this  
Kydoimos

Stop Player Being Able to Give Commands to Driver!

Recommended Posts

Hi all - how can you stop the player giving commands to the driver in an offroad, if you're the gunner? For instance, if the AI is driving somewhere, the player can drive them elsewhere...

Share this post


Link to post
Share on other sites

Put the player in a different group or make the driver higher rank.

Share this post


Link to post
Share on other sites

Tried that! Didn't work. I'm on Dev branch - could this be something they're trying out? It's potentially mission breaking for me! Thanks for the response though!

Share this post


Link to post
Share on other sites

Having a similar situation in which a higher ranking AI officer (and groupleader) is driver while the player is in the gunner position. While the groupleader issues the order to move to the next waypoint the player has to give the actual command to move the car, totally weird. oO I'm running stable 1.24.

Share this post


Link to post
Share on other sites

Not in the same group doesn't work?

Share this post


Link to post
Share on other sites

There is a poor mans work around.

in init.sqf put

disableserialization;  
player setvariable ["blocked",[]];
waitUntil {!isNull findDisplay 46}; 
_block_key = (findDisplay 46) displayAddEventHandler ["KeyDown"," if ((_this select 1) in (player getvariable 'blocked' )) then {true} else {false}"];
[] execvm "block.sqf";

save as block.sqf

while {alive player} do {
if ( (assignedVehicleRole player select 0)   == "TURRET") then {
         player setvariable ["blocked",[16,17,18,30,31,32]];		
} else {
player setvariable ["blocked",[]];
  };// end if
  sleep 0.1;
};// endwhile

The problem will be if players remap their keys.

It should be possible to block that but as yet I haven't seen it done in A3.

Share this post


Link to post
Share on other sites

But the problem with that approach is that the driver still won't do a single move without the gunner's command. At least that's the case when both are in the same group.

Share this post


Link to post
Share on other sites

Correct I hadn't retested when I was in the same group.

I guess you would have to remove the driver or gunner from the group as well.

I'm sure this wasn't a problem in A2, I'm sure I remember being driven around by the AI while I was a gunner.

I just tested A2 and as long as your not grouped you can't give orders and AI follows WP.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Thanks for the workaround F2k Sel - can anyone think of a way of making something like that work - even if the player remaps their keys? Also, even if you're not in the same group, the gunner can control the driver! Seems sort of crazy to me!

Share this post


Link to post
Share on other sites

Have you tried to make the driver enemy and setcaptive? You shouldn't be able to give him orders, or not?

Share this post


Link to post
Share on other sites

That could work - but might cause a few other issues in context - thanks for the suggestion, barbolani! I'll try it!

Share this post


Link to post
Share on other sites
Have you tried to make the driver enemy and setcaptive? You shouldn't be able to give him orders, or not?

Ha! ARRRGH! Nope! You can order OPFOR as BLUFOR! Lol!

Share this post


Link to post
Share on other sites
Ha! ARRRGH! Nope! You can order OPFOR as BLUFOR! Lol!

Well, that is kind of funny. :D

Share this post


Link to post
Share on other sites

I think I'm going to have to re-write my mission and wait for a fix!

---------- Post added at 07:10 ---------- Previous post was at 07:08 ----------

I tried blocking the keys, but as I use the arrow keys, not (W,A,S,Z) it didn't really work. Plus, some people will have handheld controllers etc. - a good idea in principle though!

Share this post


Link to post
Share on other sites

It's not a bug, it's a 'feature'. In a vehicle without a commander position, the gunner position doubles as commander. It's not likely to change.

Share this post


Link to post
Share on other sites

Thanks, 2nd Ranger - I'll have to re-think things, cheers!

Share this post


Link to post
Share on other sites
It's not a bug, it's a 'feature'. In a vehicle without a commander position, the gunner position doubles as commander. It's not likely to change.

I still think there is a bug.

If you place a vehicle with crew and you're the gunner and it has a commander the commander has control, as expected.

If you remove yourself from the group the commander still has control, as expected.

However if you get in a vehicle or are moved into a vehicle this is where it falls apart.

The vehicle will not move unless it's ordered to do so by the player even if the AI is leader and has commander and also has waypoints to follow.

If the whole group is AI it will move on it's own, as expected.

What I think should happen is that an AI driver should attempt to follow waypoints unless the player issues orders, this is how it worked in A2 I think.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Even better, IMO, would be to have a way to disable player commands to the driver. For cutscenes, convoy missions, etc. Yeah - I must admit, seems a little bit buggy.

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  

×