Jump to content
  • 0

HOWTO remove 'EJECT' from actionMenu?


mgm

Question

Greetings,

 

Our AI taxi drivers worried about potential staggering insurance costs urgent help please! :)

 

I managed to get rid off 'getOut' actionMenu item by locking the vehicle at all times as long as it is not at full stop. Unfortunately clumsy (malicious) players can still manage jumping out of a 120km/h vehicle by means of 'EJECT'ing.

 

I read EJECT is part of the engine thus cannot ever be removed but there is no end to scripter magic and workarounds, almost anything is possible hence this thread. So my question is:

 

Is it possible to remove 'EJECT' from actionMenu using some magic?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

 

have you tried :

_veh setVehicleLock "LOCKEDPLAYER";

or do a loop like following :

playerMustStayInVehicle = true; 
while { playerMustStayInVehicle } do 
{ 
    waituntil {vehicle player == player}; 
      player moveInDriver thevehicle; 
         sleep 1; 
};  

Thanks for your reply.

 

I am aware of the 2nd code chunk however it is about re-positioning player which is not my goal. My goal is removing the button called EJECT.

I have not tried the 1st bit, I will give it a go and see if it EJECTs the EJECT actionMenu option - thanks.

Link to comment
Share on other sites

  • 0

Try this:

while{true}do{	private ["_vehP","_EHID"];
	waitUntil{UIsleep 1; vehicle player != player};
	_vehP = vehicle player;
	_EHID = _vehP addEventHandler ["GetOut", {	private["_veh","_pos","_unit","_turret"];
		_veh = _this select 0;
		_pos = _this select 1;
		_unit = _this select 2;
		_turret = _this select 3;
		if(alive _veh && alive _unit && (isEngineOn _veh && abs speed _veh > 3))then[{
			if(count _turret > 0)then{
				_unit moveInTurret [_veh,_turret];
			}else{
				switch(toLower _pos)do{
					case "cargo"	:{_unit moveInCargo _veh};
					case "driver"	:{_unit moveInDriver _veh};
					default{_unit moveInTurret [_veh,_turret]};
				};
			};
		},{
			_veh removeEventHandler ["GetOut", _veh getVariable "EHID_getOut"];
		}];
	}];
	_vehP setVariable ["EHID_getOut", _EHID];
	waitUntil{UIsleep 1; vehicle player == player};
	_vehP setVariable ["EHID_getOut", nil];
};
Greez KiloSwiss
Link to comment
Share on other sites

  • 0

Try this:

while{true}do{	private ["_vehP","_EHID"];
	waitUntil{UIsleep 1; vehicle player != player};
<snip>
};
Greez KiloSwiss

 

I appreciate the input but if I understand correctly this piece of code is also about RE-POSITIONING the player/unit.

I don't want to reposition anyone, I want to modify the GUI & remove the EJECT text/option from actionMenu.

 

I read in one of the other forums => "EJECT is part of the engine thus impossible to remove it".

I don't know if that is reliable information though because it is just a dude posting in armaholic or BI forums [i.e.: it is NOT official BI employee].

 

So my question is (the same really) does anyone know how to remove EJECT from the actionMenu?

 

Thanks

Link to comment
Share on other sites

  • 0

You can't remove hardcoded addActions via scripts.

And my script does not reposition anyone, it puts every player back into the exact seat, where he tried to "eject" or "getOut" from.

Try it in the editor (change the line with the conditions so it works on every vehicle standing around), and see for Yourself.

Oh and would You kindly remove that retarded fullquote please?!

Thanks in advance mgm, we both know You're better than that.

Greez KiloSwiss

Link to comment
Share on other sites

  • 0

re quote - Ahh you are the anti-fullquote guy! lol  okay done.

 

re code - "And my script does not reposition anyone, it puts every player back into the exact seat, where he tried to "eject" or "getOut" from."

 

maybe it's because midnight here and I've been up since 5AM but when I read the above sentence I sense a logic problem.

do you kindly put people's ass BACK to the spot where it was just before them ejecting or do you not.

if you do, you are repositioning them i.e.: you are changing their 3D pos coordinates in game world.

 

 

 

 

http://www.merriam-webster.com/dictionary/reposition

 

 

2reposition

 
 
 
verb re·po·si·tion \ˌrē-pə-ˈzi-shən\
Definition of REPOSITION
transitive verb
1
:  to change the position of <<<<<<<<<<<<<<<<<<<<<<<<<<<< I'm talking about this meaning of the verb.
 
Link to comment
Share on other sites

  • 0

There seems to be a little missunderstanding from my side.

I meant, that players don't get a new position assigned in the vehicle, because the script moves them back to their previous place.

That's how I did understand/interpret "repositioning" from Your earlier post.

My solution is still reliable, because the EH fires in the very same frame as the player attempts to leave the vehicle, You can barely see any kind of repositioning (talking about the right meaning this time) from the outside.

Try it out and You will see.

I do understand that You want the "eject" and "getOut" options to be removed completely from the action menu, but as I wrote before, this is not possible via scripting and even if You could remove those options from the action menu, people can still use their direct keybinds for those actions, and that's the point where a "getOut" EH is the only scriptable way to keep players "stuck" in a vehicle.

Greez KiloSwiss

Link to comment
Share on other sites

  • 0

There seems to be a little missunderstanding from my side.

I meant, that players don't get a new position assigned in the vehicle, because the script moves them back to their previous place.

That's how I did understand/interpret "repositioning" from Your earlier post.

My solution is still reliable, because the EH fires in the very same frame as the player attempts to leave the vehicle, You can barely see any kind of repositioning (talking about the right meaning this time) from the outside.

Try it out and You will see.

I do understand that You want the "eject" and "getOut" options to be removed completely from the action menu, but as I wrote before, this is not possible via scripting and even if You could remove those options from the action menu, people can still use their direct keybinds for those actions, and that's the point where a "getOut" EH is the only scriptable way to keep players "stuck" in a vehicle.

Greez KiloSwiss

No way to remove but possible to "undo" it within the same frame. Ok got it, thanks a lot. I will cease my quest to remove that button and just use your method then.

Thanks a lot!

Link to comment
Share on other sites

  • 0

You can in fact disable the whole UI (action menu, weapon/ammo/firemode, etc.), but as i wrote before, the actions are still available via. keybinds.

That could be blocked via displayEventHandler "keydown", but it would possibly break other things and is a bit too complicated to implement and You would have to create a new custom UI for the weapon and vehicle info.

It's doable, but not worth the efford IMHO.

Have Fun

Greez KiloSwiss

Link to comment
Share on other sites

  • 0

gotcha thanks! I will not implement a new UI at this time - indeed does not sound like worth the effort.

 

as I said, I am already locking doors during the journey in the interest of passenger safety.

sadly EJECT option is ever present in actionMenu and is relatively easy to accidentally activate.

 

what I wanted to do was to prevent people from accidentally "eject"ing from vehicles by removing the EJECT option at high speeds.

[disabling keyboard shortcut is completely out of scope - if one is so determined to eject, I think they should be able to do so at any speed]

 

I will implement an accidental eject recovery feature in which AI driver will wait for the (potentially-)accidentally ejected passenger to get back in. if he does not, within a threshold time peried driver will conclude it was an intentional eject and he will leave the scene. I'll test and see how this goes...

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...