Welcome, Guest Thursday 24th April 2014, 02:37:54
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: Holster script (ACCEPTED)  (Read 3635 times)
0 Members and 1 Guest are viewing this topic.
Cheetah
Missions Depot Staff
*****
Offline Offline



« on: 25 Sep 2007, 19: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!

* script_holster_v1_03_cheetah.zip (5.74 KB - downloaded 445 times.)
« Last Edit: 04 Oct 2007, 18:03:45 by Cheetah » Logged

Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!
Spooner
*
Offline Offline


Mostly useless


WWW
« Reply #1 on: 25 Sep 2007, 21: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, 21:05:59 by Spooner » Logged

[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)
johnnyboy
OFPEC Patron
****
Offline Offline

Matan los Pantalones!!!


« Reply #2 on: 26 Sep 2007, 05: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:
if ((isHolster select 2) != 0) then { _unit addWeapon _saveWeapon; _unit selectWeapon _saveWeapon; };

Try it out.
« Last Edit: 26 Sep 2007, 05:23:20 by johnnyboy » Logged

El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...
Cheetah
Missions Depot Staff
*****
Offline Offline



« Reply #3 on: 26 Sep 2007, 07: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  Roll Eyes
Logged

Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!
Cheetah
Missions Depot Staff
*****
Offline Offline



« Reply #4 on: 26 Sep 2007, 23: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, 18:44:46 by Cheetah » Logged

Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!
Spooner
*
Offline Offline


Mostly useless


WWW
« Reply #5 on: 28 Sep 2007, 21:36:39 »

Couldn't make it easier than this - just use something like:
Code:
_gun = "M9";
if ([_gun] call isPistol) then...

This is the function:
Code:
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, 21:41:07 by Spooner » Logged

[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)
Cheetah
Missions Depot Staff
*****
Offline Offline



« Reply #6 on: 28 Sep 2007, 22:50:52 »

Updated to v1.02

Fixed a bug and added the config file pistol check (thanks Spooner!) - see readme, download in first post.
Logged

Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!
Mandoble
Editors Depot
Administrator
*****
Offline Offline



WWW
« Reply #7 on: 28 Sep 2007, 22:59:32 »

ED updated with new version  Wink
Logged

Cheetah
Missions Depot Staff
*****
Offline Offline



« Reply #8 on: 04 Oct 2007, 18:07:42 »

Updated to 1.03.

Improved demo mission and added info to the readme and script header.
Logged

Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!
Blanco
Former Staff
****
Offline Offline



« Reply #9 on: 06 Oct 2007, 12: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  Smiley
Logged

Search or search or search before you ask.
Cheetah
Missions Depot Staff
*****
Offline Offline



« Reply #10 on: 07 Oct 2007, 21:29:54 »

Ahh well, that has more to do with a simple 'show-how-to-implement-it' Wink.

There are a lot more and better ways to do it, as you say you can cheat now.
Logged

Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!
axle900
*
Offline Offline


« Reply #11 on: 23 Jul 2009, 02:47:43 »

can some one tell me where to place this so my units can holster their sidearm splease help
Logged
Dazakiwi
*
Offline Offline


« 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?

Logged
Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: