Jump to content

Recommended Posts

I know how to disable it tru options, but if I publish my misssion, i ll have to ask everyone who download it to change theier keybinds?

  • Like 1

Share this post


Link to post
Share on other sites
18 minutes ago, brunohxcx said:

keybinds

I would suggest you to open a new topic about it.

 

I'll try to check this also.

Share this post


Link to post
Share on other sites

Hey George, I was testing your Holster Script and it is one of the bests, only surpassed by ACE 3. Of course ACE has a dream team of coders.

 

Anyway, If you could check their implementation maybe you can get to fix this:

 

If you are prone and press H to holster/unholster your weapon, your character stands up and plays the standing weapon switch animation... potentially revealing you to the enemy.

 

In Ace, if you are prone and press the holster/unholster your player character does the animation in the prone position.

 

This is probably also happening in the CROUCH position too.

 

Other than that it is a smooth implementation!

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, LSValmont said:

If you are prone and press H to holster/unholster your weapon, your character stands up and plays the standing weapon switch animation

 

Thanks for the information ,

i will check about , because i think that is not like this if i remember right and the default key is not H but with key 5 .

Might be this from a different script ?

Share this post


Link to post
Share on other sites
11 minutes ago, GEORGE FLOROS GR said:

 

Thanks for the information ,

i will check about , because i think that is not like this if i remember right and the default key is not H but with key 5 .

Might be this from a different script ?

 

I think I changed the key to H

    (findDisplay 46) displayAddEventHandler ["KeyDown", {
    if(_this select 1 == 0x23) // key H        DIK_H 
    then {

 

But that should not change functionality I think. Unless you are using ACE, the H key is perfect for Holster =)

 

Another little thing... If you use your holster script on BIS save enabled missions, the Holster will not work anymore after a save reload. 

 

Thats all I've to report Sir. Valmont out.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, LSValmont said:

Thats all

 

I will check this once i can , thanks for the feedback !   :icon14:

  • Like 1

Share this post


Link to post
Share on other sites
On 16/12/2018 at 8:50 PM, LSValmont said:

Thats all I've to report Sir. Valmont out.

 

You were right about and i will try to fix this and as for the save , load , i have forgot to add :

disableSerialization;

this should fix the issue.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks George!

 

What about the issue where if you are prone/crouching and you unholster your weapon your character stands up...?

  • Like 1

Share this post


Link to post
Share on other sites
49 minutes ago, LSValmont said:

What about the issue where if you are prone/crouching

 

This is what i was saying , i need to check this.

Share this post


Link to post
Share on other sites
4 hours ago, GEORGE FLOROS GR said:

 

This is what i was saying , i need to check this.

 

Sorry I didn't catch that... I am still with the hangover from the holidays =)

 

By the way as I said before in ACE if you press the unholster key while prone you unholster your main weapon without standing up so it works perfectly there and could be use as an example maybe. 

  • Like 1

Share this post


Link to post
Share on other sites
Just now, LSValmont said:

any updates

 

Hello there LSValmont !

 

I tried a bit actually , but still did'nt succeed in !

I need to dig this more !

  • Thanks 1

Share this post


Link to post
Share on other sites

This still does not work for saved games. As soon as you reload a saved game it stops working. I tried adding disableSerialization; on top but still the same thing. =(

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, LSValmont said:

This still does not work for saved games. As soon as you reload a saved game it stops working. I tried adding disableSerialization;

 

I tried a little bit but i can't figure out .

So if someone knows it would be helpful !

Thanks !

disableSerialization;
waitUntil {!(isNull (findDisplay 46))};
_display = findDisplay 46;
		
GF_Holster = (uiNamespace getVariable "Var_GF_Holster") ,_display displayAddEventHandler["KeyDown", 
	{
	params ["_display", "_key", "_shift", "_ctrl", "_alt"];
	
	if(_key isEqualto 0x06) // key 5		DIK_5 
	then {

		if (currentWeapon player != "" )then{
			//________________ Weapon on the back ________________	
			player action ["SWITCHWEAPON",player,player,-1];
			waitUntil {currentWeapon player isEqualto "" or {primaryWeapon player isEqualto "" && handgunWeapon player isEqualto ""}};
			hint"Weapon on the back";
			}else{
			//________________ Weapon in front ________________			
			player action ["SWITCHWEAPON",player,player,0];
			hint"Weapon in front";
			};
		};
	}];

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Myself, I prefer it through addAction like this guy did.

 

/*_______________________________________

Author: Phantom Wolf

Parameters: Nil

Syntax: [] execVM "PW_holsterAction.sqf";

Usage: init.sqf, onPlayerRespawn.sqf or via Trigger

__________________________________________*/


waitUntil {(!isNull player) and (alive player)};

player addAction [ "<t color='#FF1493'>Holster Weapon" , { player action [ "hideWeapon", player, player, 101 ] }, [], 1, false, true, "", "currentWeapon player != '' && vehicle player == player", -1, false ];
player addAction [ "<t color='#FF1493'>Weapon in hands", { player action [ "hideWeapon", player, player, 0 ] },   [], 1, false, true, "", "currentWeapon player == '' && vehicle player == player && { primaryWeapon player != '' } ", -1, false ];

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, major-stiffy said:

Myself, I prefer it through addAction like this guy did.

 

Thank you for the suggestion Major, but actually what I liked about this script is the fact that you don't clutter your addAction menu with more actions on an already crowded place and I had absolutely nothing mapped to the H key. 

  • Like 1

Share this post


Link to post
Share on other sites
15 hours ago, GEORGE FLOROS GR said:

 

I tried a little bit but i can't figure out .

So if someone knows it would be helpful !

Thanks !


disableSerialization;
waitUntil {!(isNull (findDisplay 46))};
_display = findDisplay 46;
		
GF_Holster = (uiNamespace getVariable "Var_GF_Holster") ,_display displayAddEventHandler["KeyDown", 
	{
	params ["_display", "_key", "_shift", "_ctrl", "_alt"];
	
	if(_key isEqualto 0x06) // key 5		DIK_5 
	then {

		if (currentWeapon player != "" )then{
			//________________ Weapon on the back ________________	
			player action ["SWITCHWEAPON",player,player,-1];
			waitUntil {currentWeapon player isEqualto "" or {primaryWeapon player isEqualto "" && handgunWeapon player isEqualto ""}};
			hint"Weapon on the back";
			}else{
			//________________ Weapon in front ________________			
			player action ["SWITCHWEAPON",player,player,0];
			hint"Weapon in front";
			};
		};
	}];

 

 

Perhaps one of the legends can help you:

 

4 hours ago, Grumpy Old Man said:

 

 

On 3/23/2019 at 11:43 AM, Larrow said:

 

 

11 minutes ago, pierremgi said:

 

  • Like 1

Share this post


Link to post
Share on other sites

You omitted  @GEORGE FLOROS GR  It's seems to me your code is his (GF).

Anyway, try:

0 = [] spawn {
  disableSerialization;
  waitUntil {!(isNull (findDisplay 46))};
  _display = findDisplay 46;
  _display displayAddEventHandler["KeyDown", {
     params ["_display", "_key", "_shift", "_ctrl", "_alt"];
     if(_key isEqualto 0x06) then {
       if (currentWeapon player != "" )then{
        player action ["SWITCHWEAPON",player,player,-1];
        waitUntil {currentWeapon player isEqualto "" or {primaryWeapon player isEqualto "" && handgunWeapon player isEqualto ""}};
        hint"Weapon on the back";
       }else{
         player action ["SWITCHWEAPON",player,player,0];
         hint"Weapon in front";
       };
    };
  }];
};

 

  • Thanks 2

Share this post


Link to post
Share on other sites

Thank you very much Pierre !  :thumbs-up:

To be honest this was what i was about to test !

  • Like 1

Share this post


Link to post
Share on other sites
14 minutes ago, pierremgi said:

try

 

I was running the code from the initPlayerlocal and i also tried from the init , but still after saving in MP and entering the mission again , it is still not working.

Might be that i'm doing something wrong ?

Share this post


Link to post
Share on other sites

No clue on which scripts re-run in these cases:
SP save, exit, load continue;

MP return to looby, choose another slot, or keep the same, back to the game;

MP save (admin?) exit (hosted/dedicated server), load and continue.

 

And I never saw any documentation about that.

 

Perhaps, here, with EH playerConnected ?

  • Like 1

Share this post


Link to post
Share on other sites
40 minutes ago, pierremgi said:

Perhaps, here, with EH playerConnected ?

 

This is working !

 

Thanks again Pierre !

 

I just removed the " 0 = " from the code :

 

init.sqf

addMissionEventHandler ["PlayerConnected", {
	params ["_id", "_uid", "_name", "_jip", "_owner"];
	
	_owner execVM "GF_Holster\GF_Holster.sqf";
	if(isServer) exitwith{};
	_jip execVM "GF_Holster\GF_Holster.sqf";
	
}];

 

GF_Holster.sqf

[] spawn {
  disableSerialization;
  waitUntil {!(isNull (findDisplay 46))};
  _display = findDisplay 46;
  _display displayAddEventHandler["KeyDown", {
     params ["_display", "_key", "_shift", "_ctrl", "_alt"];
     if(_key isEqualto 0x06) then {
       if (currentWeapon player != "" )then{
        player action ["SWITCHWEAPON",player,player,-1];
        waitUntil {currentWeapon player isEqualto "" or {primaryWeapon player isEqualto "" && handgunWeapon player isEqualto ""}};
        hint"Weapon on the back";
       }else{
         player action ["SWITCHWEAPON",player,player,0];
         hint"Weapon in front";
       };
    };
  }];
};

 

  • Like 2

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

×