中国虚拟军事网(VME)- 专注于武装突袭系列虚拟军事游戏

 找回密码
 加入VME

QQ登录

只需一步,快速开始

搜索
查看: 3385|回复: 20

[灌水] 水一个,问问我这种脚本有没有市场。。。

[复制链接]
发表于 2013-5-4 15:01:45 | 显示全部楼层 |阅读模式
一个可以用于aa2和aa3 以及所有mod 的刷兵刷载具脚本

一个可以用于多人游戏和单人游戏的刷兵脚本

一个可以调控刷兵几率,刷兵时间,刷兵次数,刷兵开始条件的脚本

一个可以给刷出的单位移动到某个地方和调整刷兵单位出生位置和出生范围的脚本

虽然兼容所有mod和aa2甚至aa3,但是调用起来却比较复杂。。。

[this,mk1,tg1,50,JB1,75,50,10] exec "shua_class.sqs" 一大串定义 和 预设单位。。。

会不会吓跑很多小白?最长的十个定义罢了。。都是定义些范围数量之类的{:soso_e144:}

本来想偷懒的脚本。。经过sky的提议以后。。我感觉变得有违我最初的想法了。。。那么复杂真的没问题?

顺便问问,谁知道怎么直接读取一个单位的弹药classname?不是背在身上的那一个。而是类似aa2时的这种M_TOW_AT东西。。怎么在游戏中获取?
发表于 2013-5-4 15:36:14 | 显示全部楼层
内容赞
发表于 2013-5-4 18:07:19 | 显示全部楼层
继续努力
 楼主| 发表于 2013-5-4 18:28:53 | 显示全部楼层
qevhytpl 发表于 2013-5-4 18:07
继续努力

顺便问问,谁知道怎么直接读取一个单位的弹药classname?不是背在身上的那一个。而是类似aa2时的这种M_TOW_AT东西。。怎么在游戏中获取?

这玩意有办法搞定么?
发表于 2013-5-4 18:46:10 | 显示全部楼层
上传ArmaHolic和BI forum,多数玩家都会对类似的脚本感兴趣。

多注意采纳信息和对帖子不断的跟新关注,这方面可以参考一下国外的Norrin,kju,UPS etc,国内的sps等。

真的喜欢某种类型的脚本就专注于此,时常更新扩充功能,将其发挥至极致。
 楼主| 发表于 2013-5-4 19:22:59 | 显示全部楼层
FFUR2007SLX2_5 发表于 2013-5-4 18:46
上传ArmaHolic和BI forum,多数玩家都会对类似的脚本感兴趣。

多注意采纳信息和对帖子不断的跟新关注,这 ...

本来都是想搞小白向的脚本。。。现在貌似复杂了

外国论坛不好混。。英语老师死得早,因为我娘教语文
发表于 2013-5-4 21:14:48 | 显示全部楼层
问:
知道一个放在游戏里面的陶氏反坦克悍马车名字是hmv1,或者甚至都没取名字
如何使用最简单或者最变态的脚本方式知道该载具炮架子上面主武器的弹药种类classname是"M_TOW_AT"还是啥

答案1:
公安局户籍科踹门查户口法:
优势:强制、专政、权威、变态、无需争得被调查方的同意
缺陷:准确但不精确,可能找到的答案只是你要的答案的其中之一,或者是默认第一个的那位
复制到你要查的载具的Initialization框里面,进入游戏第一秒你要的答案了就出现了
  1. hint format ["%1", getText (configFile >> "CfgMagazines" >> getArray (configFile >> "CfgVehicles" >> typeOf this >> "Turrets" >> "MainTurret">> "magazines") select 0 >> "ammo")];
复制代码
答案2:
私人侦探犯罪现场取证法:
优势:特别简练、极其精确、专业免费
缺陷:如果被调查方不开火,调查便无从下手
复制到你要查的载具的Initialization框里面,进入游戏这个单位用你想要的弹药开一枪,答案了就出现了
  1. this addEventHandler ["Fired", {hint format ["%1", _this select 4]}];
复制代码
答案3:
此答案是使用sqf脚本码一个faction然后调用,相当准确,相当精确,不易理解,不够简练,需调用sqf,不够易用,
不符合当下浮躁见效快的社会氛围,不够河蟹,应予以坚决取缔。
原理还是基于以上两种方法,好比你家的e家亲、歌华宽带、宽带通、什么通的花哨宽带网络,归根道理都是基于联通和电信的网络而已,
在此不再卖弄。
 楼主| 发表于 2013-5-4 22:18:31 | 显示全部楼层
fromz 发表于 2013-5-4 21:14
问:
知道一个放在游戏里面的陶氏反坦克悍马车名字是hmv1,或者甚至都没取名字
如何使用最简单或者最变态的 ...

好幽默的大神。。。。一号答案足够了
我就是用差不多的方法直接在脚本读取classname然后获取基准单位的classname开始刷兵的
发表于 2013-5-5 00:00:50 | 显示全部楼层
这些我都有自己写好的了{:soso_e113:}
 楼主| 发表于 2013-5-5 00:11:30 | 显示全部楼层
2fast 发表于 2013-5-5 00:00
这些我都有自己写好的了

自己读出来在写的东西适应不了mod啊。。。庞大基数的mod需要一个可以偷懒的脚本
发表于 2013-5-5 02:17:44 | 显示全部楼层
下网上载 发表于 2013-5-5 00:11
自己读出来在写的东西适应不了mod啊。。。庞大基数的mod需要一个可以偷懒的脚本

从config直接读啊。不管什么mod都要写入config的。所以只要从config读就不怕classname出问题
给你几个cfgWeapons的例子。

//[] call fnc_CfgWeapons_getAllWeapons;
//[_type] call fnc_CfgWeapons_getAllItems;        //"Optics","Muzzles","Pointers","Hats","Uniforms","Vests","WeaponMods","All","Others"
//[] call fnc_cfgWeapons_getRifles;
//[] call fnc_cfgWeapons_getMachineGuns;
//[] call fnc_cfgWeapons_getLaunchers;
//[] call fnc_cfgWeapons_getPistols;
//[_wp] call fnc_cfgWeapons_getMags;
//[_wp,_itemType] call fnc_cfgWeapons_getItems;  //"Optics","Muzzles","Pointers","All","Others"
//[] call fnc_cfgWeapons_getGrenades;
//[] call fnc_cfgWeapons_getExplosives
//[_type] call fnc_cfgWeapons_getPic;
//[_type] call fnc_cfgWeapons_getName;
//[_type] call fnc_cfgWeapons_getType;        //1_primary,2_handgun,1+4_primaryAndSecondary,4_secondary
//[_type] call fnc_cfgWeapons_isWeapon;
//[_type] call fnc_cfgWeapons_isUniform;
//[_type] call fnc_cfgWeapons_isVest;
//[_type] call fnc_cfgWeapons_isHat;
//[_type] call fnc_cfgWeapons_isOptics;
//[_type] call fnc_cfgWeapons_isMuzzle;
//[_type] call fnc_cfgWeapons_isPointer;
//[_type] call fnc_cfgWeapons_isItem;
//[_type] call fnc_cfgWeapons_isExplosive;
//[_type] call fnc_cfgWeapons_isGrenade;
//[_type] call fnc_cfgWeapons_getContainerClass;
//[_type] call fnc_cfgWeapons_getSlotInfo;


//all personel weapons
fnc_CfgWeapons_getAllWeapons =
{
        private ["_i","_list","_item"];
       
        _list = [];
        for "_i" from 0 to ((count (configFile >> "CfgWeapons"))-1) do
        {
                _item=((configFile >> "CfgWeapons") select _i);
                if(isClass _item) then                //is class
                {
                        if (getNumber (_item >> "scope") == 2) then  //scope: public
                        {                               
                                if (count(getArray (_item >> "magazines")) !=0 ) then  //Weapon has magazine
                                {
                                        if(getNumber(_item>>"type")!= 65536) then        //weapon is not hardmounted on vehicle
                                        {
                                                _list set [count _list, configName _item];
                                        };
                                };
                        };
                };
        };
        _list       
};

fnc_CfgWeapons_getAllItems =
{
        private ["_i","_list","_item","_type","_optics","_muzzles","_pointers","_hats","_uniforms",
                        "_vests","_others","_infoType"];
        _type = _this select 0;
       
        _optics = [];
        _muzzles = [];
        _pointers = [];
        _hats = [];
        _uniforms = [];
        _vests = [];
        _others = [];
        for "_i" from 0 to ((count (configFile >> "CfgWeapons"))-1) do
        {
                _item=((configFile >> "CfgWeapons") select _i);
                if(isClass _item) then                //is class
                {
                        if (getNumber (_item >> "scope") == 2) then  //scope: public
                        {       
                                if(getNumber (_item >> "type") == 131072) then        //is inherited from itemCore
                                {
                                        if (isClass (_item>>"ItemInfo")) then         //is an item
                                        {
                                                _infoType = (getNumber(_item>>"ItemInfo">>"Type"));
                                                switch (_infoType) do
                                                {
                                                        case 201: {_optics                 set [count _optics, configName _item];};
                                                        case 101: {_muzzles         set [count _muzzles, configName _item];};
                                                        case 301: {_pointers         set [count _pointers, configName _item];};
                                                        case 605: {_hats                 set [count _hats, configName _item];};
                                                        case 801: {_uniforms         set [count _uniforms, configName _item];};
                                                        case 701: {_vests                 set [count _vests, configName _item];};
                                                        default          {_others                 set [count _others, configName _item];};
                                                };
                                        };               
                                };
                        };
                };
        };
       
        _list = [];
        switch (_type) do
        {
                case "Optics"                : {_list = _optics;};
                case "Muzzles"                : {_list = _muzzles;};
                case "Pointers"                : {_list = _pointers;};
                case "Hats"                        : {_list = _hats;};
                case "Uniforms"                : {_list = _uniforms;};
                case "Vests"                : {_list = _vests;};
                case "All"                        : {_list = _optics+_muzzles+_pointers+_hats+_uniforms+_vests;};
                case "WeaponMods"        : {_list = _optics+_muzzles+_pointers;};
                case "Others"                : {_list = _others;};
                default                                 {};
        };
        _list
};

fnc_cfgWeapons_getRifles =
{
        private ["_weapons","_list","_i","_item","_type"];
        _weapons = [] call fnc_CfgWeapons_getAllWeapons;
        _list = [];
        for "_i" from 0 to ((count _weapons)-1) do
        {
                _item=(configFile >> "CfgWeapons" >> (_weapons select _i));
        _type = getNumber (_item >> "type");
                if(_type==1) then        //primary slot weapon
                {
                        _list set [count _list, configName _item];
                };
        };       
        _list
};

fnc_cfgWeapons_getMachineGuns =
{
        private ["_weapons","_list","_i","_item","_type"];
        _weapons = [] call fnc_CfgWeapons_getAllWeapons;
        _list = [];
        for "_i" from 0 to ((count _weapons)-1) do
        {
                _item=(configFile >> "CfgWeapons" >> (_weapons select _i));
        _type = getNumber (_item >> "type");
                if(_type==1+4) then        //primary slot and secondary slot weapon
                {
                        _list set [count _list, configName _item];
                };
        };       
        _list
};

fnc_cfgWeapons_getLaunchers =
{
        private ["_weapons","_list","_i","_item","_type"];
        _weapons = [] call fnc_CfgWeapons_getAllWeapons;
        _list = [];
        for "_i" from 0 to ((count _weapons)-1) do
        {
                _item=(configFile >> "CfgWeapons" >> (_weapons select _i));
        _type = getNumber (_item >> "type");
                if(_type==4) then        //secondary slot weapon
                {
                        _list set [count _list, configName _item];
                };
        };       
        _list
};

fnc_cfgWeapons_getPistols =
{
        private ["_weapons","_list","_i","_item","_type"];
        _weapons = [] call fnc_CfgWeapons_getAllWeapons;
        _list = [];
        for "_i" from 0 to ((count _weapons)-1) do
        {
                _item=(configFile >> "CfgWeapons" >> (_weapons select _i));
        _type = getNumber (_item >> "type");
                if(_type==2) then        //handgun slot weapon
                {
                        _list set [count _list, configName _item];
                };
        };       
        _list
};

//get magazine types of a specific weapon
fnc_cfgWeapons_getMags =
{
        private ["_wp","_muzzles","_mags","_mags1"];
        _wp = _this select 0;        //classname of weapon
       
        //primary mags
        _mags = getArray (configFile >> "CfgWeapons" >> _wp >> "magazines");
        _muzzles = getArray (configFile >> "CfgWeapons" >> _wp >> "muzzles");
        //secondary magazines
        {
                _mags1 = getArray (configFile >> "CfgWeapons" >> _wp >> _x >> "magazines");  
                {
                        if(!(_x in _mags))then{
                                _mags set [count _mags,_x];
                        };
                }forEach _mags1;       
        }forEach _muzzles;

        //return magazines
        _mags
};

//get weapon associated items
//(no checking on whether weapon actually have "WeaponSlotsInfo" class
fnc_cfgWeapons_getItems =
{
        private ["_wp","_itemType","_optics","_muzzles","_pointers","_list"];
        _wp = _this select 0;        //weapon classname
        _itemType = _this select 1;        //"Optics","Muzzles","Pointers","All"
               
        _optics = getArray(configFile>>"CfgWeapons">>_wp>>"WeaponSlotsInfo">>"CowsSlot">>"compatibleitems");
        _muzzles = getArray(configFile>>"CfgWeapons">>_wp>>"WeaponSlotsInfo">>"MuzzleSlot">>"compatibleitems");
        _pointers = getArray(configFile>>"CfgWeapons">>_wp>>"WeaponSlotsInfo">>"PointerSlot">>"compatibleitems");
        _list = [];
        switch(_itemType)do
        {
                case "Optics"        : {_list = _optics;};
                case "Muzzles"        : {_list = _muzzles;};
                case "Pointers"        : {_list = _pointers;};
                case "All"                : {_list = _optics+_muzzles+_pointers;};
                default                  {_list = _optics+_muzzles+_pointers;};
        };
        _list
};

//get all grenades
fnc_cfgWeapons_getGrenades =
{
        private ["_list"];
        _list = ["Throw"] call fnc_cfgWeapons_getMags;
        _list
};

//get all explosives
fnc_cfgWeapons_getExplosives =
{
        private ["_list"];
        _list = ["Put"] call fnc_cfgWeapons_getMags;
        _list
};

//get picture
fnc_cfgWeapons_getPic =
{
        getText(configFile >> "CfgWeapons" >> (_this select 0) >> "picture")
};

//get name
fnc_cfgWeapons_getName =
{
        getText(configFile >> "CfgWeapons" >> (_this select 0) >> "displayName")
};

//get weapon type
fnc_cfgWeapons_getType =
{
        getNumber (configFile>>"CfgWeapons">>(_this select 0)>>"type")
};

//check if class is weapon (personel weapon)
fnc_cfgWeapons_isWeapon =
{
        private ["_isWeapon","_listWeapon"];
        _isWeapon = false;
        _listWeapon = [] call fnc_CfgWeapons_getAllWeapons;
        _isWeapon = (_this select 0) in _listWeapon;
        _isWeapon
};

//check if class is uniforms
fnc_cfgWeapons_isUniform =
{
        private ["_isUniform","_listUniform"];
        _isUniform = false;
        _listUniform = ["Uniforms"] call fnc_CfgWeapons_getAllItems;
        _isUniform = (_this select 0) in _listUniform;
        _isUniform
};


//check if class is Vests
fnc_cfgWeapons_isVest =
{
        private ["_isVest","_listVest"];
        _isVest = false;
        _listVest = ["Vests"] call fnc_CfgWeapons_getAllItems;
        _isVest = (_this select 0) in _listVest;
        _isVest
};

//check if class is Hats
fnc_cfgWeapons_isHat =
{
        private ["_isHat","_listHat"];
        _isHat = false;
        _listHat = ["Hats"] call fnc_CfgWeapons_getAllItems;
        _isHat = (_this select 0) in _listHat;
        _isHat
};

//check if class is item (excluding weapons, unitforms, vests, hats and weaponItems)
fnc_cfgWeapons_isItem =
{
        private ["_isItem","_listWeaponMods","_listItems","_listAllItems"];
        _isItem = false;
        _listAllItems = ["Others"] call fnc_CfgWeapons_getAllItems;
        _listWeaponMods = ["WeaponMods"] call fnc_CfgWeapons_getAllItems;
        _listItems = _listAllItems + _listWeaponMods;
        _isItem = (_this select 0) in _listItems;
        _isItem
};

//check if class is optics
fnc_cfgWeapons_isOptics =
{
        private ["_isOptics","_listOptics"];
        _isOptics = false;
        _listOptics = ["Optics"] call fnc_CfgWeapons_getAllItems;
        _isOptics = (_this select 0) in _listOptics;
        _isOptics
};

//check if class is Muzzle
fnc_cfgWeapons_isMuzzle =
{
        private ["_isMuzzle","_listMuzzles"];
        _isMuzzle = false;
        _listMuzzles = ["Muzzles"] call fnc_CfgWeapons_getAllItems;
        _isMuzzle = (_this select 0) in _listMuzzles;
        _isMuzzle
};

//check if class is Pointer
fnc_cfgWeapons_isPointer =
{
        private ["_isPointer","_listPointers"];
        _isPointer = false;
        _listPointers = ["Pointers"] call fnc_CfgWeapons_getAllItems;
        _isPointer = (_this select 0) in _listPointers;
        _isPointer
};

//check if class is Grenade
fnc_cfgWeapons_isGrenade =
{
        private ["_isGrenade","_listGrenade"];
        _isGrenade = false;
        _listGrenade = ["Grenade"] call fnc_CfgWeapons_getGrenades;
        _isGrenade = (_this select 0) in _listGrenade;
        _isGrenade
};

//check if class is Explosive
fnc_cfgWeapons_isExplosive =
{
        private ["_isExplosive","_listExplosive"];
        _isExplosive = false;
        _listExplosive = ["Explosive"] call fnc_CfgWeapons_getExplosives;
        _isExplosive = (_this select 0) in _listExplosive;
        _isExplosive
};

//get container class string of the class (vest or uniforms)
fnc_cfgWeapons_getContainerClass =
{
        getText(configFile >> "CfgWeapons">>(_this select 0)>>"ItemInfo">>"containerclass")
};

//get slots info of the weapon
fnc_cfgWeapons_getSlotInfo =
{
        getArray (configFile >> "CfgWeapons" >> (_this select 0) >> "WeaponSlotsInfo" >> "allowedslots")
};
发表于 2013-5-5 02:18:45 | 显示全部楼层
cfgVehicles

//[_classType] call fnc_cfgVehicles_getClass;                //"Men","Car","Ship","Air","Armored","Support","Ammo","Backpacks"
//[] call fnc_cfgVehicles_getAllBackpacks;
//[_side] call fnc_cfgVehicles_getMen;                                //West,East,Resistance,Civilian
//[_vehType] call fnc_cfgVehicles_getVehCargoSize;        //maybe replaced by emptyPositions
//[_vehType] call fnc_cfgVehicles_getVehTurretsNum;//maybe replaced by emptyPositions
//[_vehType] call fnc_cfgVehicles_getName;
//[_vehType] call fnc_cfgVehicles_getPic;
//[_vehType] call fnc_cfgVehicles_getMaxLoad;        //for backpacks

//get list of classnames by vehicleClass
//"Men","Car","Ship","Air","Armored","Support","Ammo","Backpacks"
fnc_cfgVehicles_getClass =
{
        private ["_classType","_i","_list","_item"];
        _classType = _this select 0;
       
        _list = [];
        for "_i" from 0 to ((count (configFile >> "CfgVehicles"))-1) do
        {
                _item=((configFile >> "CfgVehicles") select _i);
                if(isClass _item) then               
                {
                        if (getNumber (_item >> "scope") == 2) then  //scope: public
                        {
                                if (getText (_item >> "vehicleClass") == _classType) then  
                                {
                                        _list set [count _list, configName _item];
                                };
                        };
                };
        };
        _list       
};

fnc_cfgVehicles_getAllBackpacks =
{
        ["Backpacks"] call fnc_cfgVehicles_getClass
};

fnc_cfgVehicles_getMen =
{
        private ["_side","_numSide","_menList","_list","_x"];
        _side = _this select 0;
        _numSide = -1;
        if(_side == East)then{_numSide = 0;};
        if(_side == West)then{_numSide = 1;};
        if(_side == Resistance)then{_numSide = 2;};
        if(_side == Civilian)then{_numSide = 3;};
       
        _menList = ["Men"] call fnc_cfgVehicles_getClass;
        _list = [];
        {
                if(getNumber(configFile>>"CfgVehicles">>_x>>"side") == _numSide) then
                {
                        _list set [count _list, _x];
                };
        }forEach _menList;
        _list
};


fnc_cfgVehicles_getVehCargoSize =
{
        private ["_vehType","_cargo"];
        _vehType = _this select 0;
        _cargo = getNumber (configFile>>"CfgVehicles">>_vehType>>"transportSoldier");  
        _cargo
};

fnc_cfgVehicles_getVehTurretsNum =
{
        private ["_vehType","_turrets","_numTurrets"];
        _vehType = _this select 0;
        _turrets = configFile>>"CfgVehicles">>_vehType>>"turrets";  
        _numTurrets = count _turrets;
        _numTurrets
};

//get name
fnc_cfgVehicles_getName =
{
        getText(configFile >> "CfgVehicles" >> (_this select 0) >> "displayName")
};

//get pic
fnc_cfgVehicles_getPic =
{
        getText(configFile >> "CfgVehicles" >> (_this select 0) >> "picture")
};

//get container class string of the class (backpacks)
fnc_cfgVehicles_getMaxLoad =
{
        getNumber(configFile >> "cfgVehicles">>(_this select 0)>>"maximumload")
};

发表于 2013-5-5 02:19:13 | 显示全部楼层
cfgMagazines

//[] call fnc_cfgMagazines_getAllMags;
//[_type] call fnc_cfgMagazines_getPic;
//[_type] call fnc_cfgMagazines_getName;
//[_type] call fnc_cfgMagazines_isMagazine;


fnc_cfgMagazines_getAllMags =
{
        private ["_i","_item","_allMags","_type"];
        _allMags = [];
        for "_i" from 0 to ((count (configFile>>"CfgMagazines"))-1) do
        {
                _item = ((configFile >> "CfgMagazines") select _i);
                if (isClass _item) then
                {
                        if (getnumber (_item >> "scope") == 2) then  // public
                        {
                                _type = getnumber (_item >> "type");
                                if(_type!=0) then        //valid magazines
                                {
                                        _allMags set [count _allMags,configName _item];
                                };
                        };
                };
        };
        _allMags
};

//get picture
fnc_cfgMagazines_getPic =
{
        private ["_type"];
        _type = _this select 0;
        getText(configFile >> "CfgMagazines" >> _type >> "picture")
};

//get name
fnc_cfgMagazines_getName =
{
        private ["_type"];
        _type = _this select 0;
        getText(configFile >> "CfgMagazines" >> _type >> "displayName")
};

//check if it is magazine
fnc_cfgMagazines_isMagazine =
{
        private ["_isMag","_listMag"];
        _listMag = [] call fnc_cfgMagazines_getAllMags;
        _isMag = (_this select 0) in _listMag;
        _isMag
};
 楼主| 发表于 2013-5-5 02:37:58 | 显示全部楼层
2fast 发表于 2013-5-5 02:19
cfgMagazines

//[] call fnc_cfgMagazines_getAllMags;

似乎很吊的样子,有成品的测试任务吗?给我一个我看看具体是怎么读取单位classname然后调用的
发表于 2013-5-5 10:24:58 | 显示全部楼层
MOD文件夹不要改名,所有脚本都在data文件夹里。 进入单人游戏之后在暂停菜单按YQ_MOD,进游戏之后你会多出两个action。一个是选武器,一个是选衣服

我目前还在完善这个插件,今后可能会发布,你就玩玩看吧

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入VME

x
您需要登录后才可以回帖 登录 | 加入VME

本版积分规则

小黑屋|中国虚拟军事网

GMT+8, 2024-5-3 20:33

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表