Advertisement

Author Topic: Holster script (ACCEPTED)  (Read 3818 times)

0 Members and 1 Guest are viewing this topic.

Offline Cheetah

  • Former Staff
  • ****
Holster script (ACCEPTED)
« on: 25 Sep 2007, 20:16:55 »
General information

Looking for a method to enable the player to conceal weapons? Look no further, with this method - consisting of three script files, you will be able to do just that!

Check the readme and demo mission for more information.

Update: version 1.01 released!

Update: version 1.02 released!

Update: version 1.03 released!
« Last Edit: 04 Oct 2007, 19:03:45 by Cheetah »
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Holster script
« Reply #1 on: 25 Sep 2007, 22:03:51 »
I'm glad you didn't allow AK-74 swallowing with this script, since you limited it to hiding pistols. Hmm, though it would have been fun to create a spray of vomit particles ;P

Instead of having an array of pistol classes, check that the weapon inherits from PistolCore, using the method I explained in another thread. This will allow the script to holster any pistol from any addon.
« Last Edit: 25 Sep 2007, 22:05:59 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Holster script
« Reply #2 on: 26 Sep 2007, 06:11:12 »
Hi Cheetah.  Cool script.  This will be useful.

I think I solved the issue of having to select the weapon again before you can fire, by adding SelectWeapon command to this line of code:

Code: [Select]
if ((isHolster select 2) != 0) then { _unit addWeapon _saveWeapon; _unit selectWeapon _saveWeapon; };

Try it out.
« Last Edit: 26 Sep 2007, 06:23:20 by johnnyboy »
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Cheetah

  • Former Staff
  • ****
Re: Holster script
« Reply #3 on: 26 Sep 2007, 08:51:33 »
Hey johnnyboy, sounds good!

Going to start rescripting it now to prevent the use of multiple scriptfiles. Should make it even easier to use  ::)
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Cheetah

  • Former Staff
  • ****
Re: Holster script
« Reply #4 on: 27 Sep 2007, 00:32:01 »
Alright, new version attached.

Only one file required to make it work now. Other info is in the readme.

@Spooner,

Next up: checking if the config file can be used to get pistol classes.

EDIT: can't find a way to use the config file.. so it is ready for release.
« Last Edit: 28 Sep 2007, 19:44:46 by Cheetah »
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Holster script (ACCEPTED)
« Reply #5 on: 28 Sep 2007, 22:36:39 »
Couldn't make it easier than this - just use something like:
Code: [Select]
_gun = "M9";
if ([_gun] call isPistol) then...

This is the function:
Code: [Select]
isPistol =
{
_unknownWeaponClass = _this select 0;

_unknownConfig = configFile >> "CfgWeapons" >> _unknownWeaponClass;
_pistolConfig = configFile >> "CfgWeapons" >> "PistolCore";

_isPistol = false;
while {isClass _unknownConfig} do
{
    if (_unknownConfig == _pistolConfig) exitWith
    {
        _isPistol = true;
    };

    _unknownConfig = inheritsFrom _unknownConfig;
};

_isPistol; // Return.
};
« Last Edit: 28 Sep 2007, 22:41:07 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Cheetah

  • Former Staff
  • ****
Re: Holster script (ACCEPTED)
« Reply #6 on: 28 Sep 2007, 23:50:52 »
Updated to v1.02

Fixed a bug and added the config file pistol check (thanks Spooner!) - see readme, download in first post.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Holster script (ACCEPTED)
« Reply #7 on: 28 Sep 2007, 23:59:32 »
ED updated with new version  ;)

Offline Cheetah

  • Former Staff
  • ****
Re: Holster script (ACCEPTED)
« Reply #8 on: 04 Oct 2007, 19:07:42 »
Updated to 1.03.

Improved demo mission and added info to the readme and script header.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Blanco

  • Former Staff
  • ****
Re: Holster script (ACCEPTED)
« Reply #9 on: 06 Oct 2007, 13:39:17 »
Nice script but in some situations there's a little problem. (that can be solved with a timer or so)
Unholster the weapon, kill one soldier, holster the weapon before the second soldeir can see you and you will be captive again.

Anyway, nice script  :)
Search or search or search before you ask.

Offline Cheetah

  • Former Staff
  • ****
Re: Holster script (ACCEPTED)
« Reply #10 on: 07 Oct 2007, 22:29:54 »
Ahh well, that has more to do with a simple 'show-how-to-implement-it' ;).

There are a lot more and better ways to do it, as you say you can cheat now.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline axle900

  • Members
  • *
Re: Holster script (ACCEPTED)
« Reply #11 on: 23 Jul 2009, 03:47:43 »
can some one tell me where to place this so my units can holster their sidearm splease help

Offline Dazakiwi

  • Members
  • *
Re: Holster script (ACCEPTED)
« Reply #12 on: 13 Dec 2009, 03:21:13 »
The download link is down, will this script work in Arma2? will it ported to A2?