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

 找回密码
 加入VME

QQ登录

只需一步,快速开始

搜索
查看: 3013|回复: 22

[求助] 如何把N多个各自行动的小组的单位,串联起来的模块或脚本啊 ?

[复制链接]
发表于 2014-8-15 12:10:20 | 显示全部楼层 |阅读模式
比如每个小组都有自己的行动路线,如何把所有的小组串联起来,成为一个大组,(举例设置警报响,触发器设置:设置一个大组Z1,条件设置:Count Units Z1 < 3,效果设置蓝方警报---).想让大组Z1(包括N个小组)任意3个人死亡,触发警报,这个大组该如何设置。///////如果设置(警报启动蓝方[蓝方为例],目标未出现在范围内,效果警报),大组Z1任何一个人死亡可触发警报触发器,但许要F2连线,这个时候,触发器该如何连线。
发表于 2014-8-15 12:17:20 | 显示全部楼层
本帖最后由 yyxhx 于 2014-8-15 12:26 编辑

首先我想给楼主提个建议:排版!!!!!!!看的我眼都花了!!!!!!

//填写到Init.sqf中
YourGroupList = [小组1, 小组2, 小组3, 小组4, 小组5, 小组6];

SUR_fnc_countBigGroupUnits = {
        private ["_count", "_countAll"];
        _countAll = 0;
       
        for "_i" from 0 to ((count YourGroupList) - 1) do {
                _count = count Units (YourGroupList select _i);
                _countAll = _countAll + _count;
        };
       
        _countAll;
};


//剩余人数小于3做法
waitUntil {([] call SUR_fnc_countBigGroupUnits) < 3};

触发警报


//死亡人数大于等于3做法
private ["_allCount"];

_allCount = [] call SUR_fnc_countBigGroupUnits;


waitUntil {([] call SUR_fnc_countBigGroupUnits) <= (_allCount - 3)};

触发警报

/*

如果想要在触发器中用的话,把“触发警报”改为:alentActived = true;
触发器条件改为:this and alentActived

*/
 楼主| 发表于 2014-8-15 14:21:20 来自手机 | 显示全部楼层
突然发现一个问题,如果不安排小组1,小组2,把它改基地模块,把模块命名,也可把模块当成小组使用?
发表于 2014-8-15 15:07:06 | 显示全部楼层
cnliuchang 发表于 2014-8-15 14:21
突然发现一个问题,如果不安排小组1,小组2,把它改基地模块,把模块命名,也可把模块当成小组使用?

不可以
发表于 2014-8-15 15:10:50 | 显示全部楼层
cnliuchang 发表于 2014-8-15 14:21
突然发现一个问题,如果不安排小组1,小组2,把它改基地模块,把模块命名,也可把模块当成小组使用?

如果你想用基地模块的话

YourGroupList = [];
{
        if ((_x distance 模块坐标,参见编辑器左下角) < 基地大小,最好设大一点,只要不把无关东西包括进去,能多大多大) then {
                YourGroupList = YourGroupList + [group _x];
        };
}forEach allUnits;
 楼主| 发表于 2014-8-15 18:42:10 | 显示全部楼层
yyxhx 发表于 2014-8-15 15:10
如果你想用基地模块的话

YourGroupList = [];

非常感谢
 楼主| 发表于 2014-8-15 20:00:23 | 显示全部楼层
yyxhx 发表于 2014-8-15 15:10
如果你想用基地模块的话

YourGroupList = [];

非常感谢,举例,放至一个基地模块,a:200 b:200,没放任何单位,想做到模块内的敌人死亡大于3人时,触发警报,您看我这样写对吗?还有一些疑问?您帮我看看?
ourGroupList=NIKE


//填写到Init.sqf中
NIKE = [x.y.z];  //模块(NIKE)模块坐标  范围A:200 ,B:200 ,圆形


{
        if ((_x distance x.y.z) < 200) then {
                NIKE= NIKE + [group _x];
        };
}forEach allUnits;


SUR_fnc_countBigGroupUnits = {
        private ["_count", "_countAll"];
        _countAll = 0;
        
        for "_i" from 0 to ((count NIKE) - 1) do {
                _count = count Units (NIKE select _i);
                _countAll = _countAll + _count;
        };
        
        _countAll;
};


//剩余人数小于3做法
waitUntil {([] call SUR_fnc_countBigGroupUnits) < 3};//疑问:  输入到触发器条件里,效果:剩余人数小于3做法,还是留在Init.sqf,在地图里布不设置任何触发器?

触发警报


//死亡人数大于等于3做法
private ["_allCount"];

_allCount = [] call SUR_fnc_countBigGroupUnits;


waitUntil {([] call SUR_fnc_countBigGroupUnits) <= (_allCount - 3)};//疑问:输入到触发器条件里,效果:剩余人数大于3做法,还是留在Init.sqf,在地图里布不设置任何触发器?




触发警报
/*

如果想要在触发器中用的话,把“触发警报”改为:alentActived = true;//这样个应该写到触发器里的“被触发时”?
触发器条件改为:this and alentActived

*/
发表于 2014-8-15 20:40:05 | 显示全部楼层
cnliuchang 发表于 2014-8-15 20:00
非常感谢,举例,放至一个基地模块,a:200 b:200,没放任何单位,想做到模块内的敌人死亡大于3人时,触发 ...

通通写道init.sqf中。
nike是模块名字吧?
把“模块坐标,参见编辑器左下角”改为(getPos nike)即可,其他nike通通改回来

触发器爱放不放,如果你有功能需要触发器实现的话,就把“触发警报”改为alentActived = true;
触发器中条件那一栏加一个 and alentActived
比如原来是this改为this and alentActived
 楼主| 发表于 2014-8-15 21:18:23 | 显示全部楼层
yyxhx 发表于 2014-8-15 20:40
通通写道init.sqf中。
nike是模块名字吧?
把“模块坐标,参见编辑器左下角”改为(getPos nike)即可, ...

OK 非常感谢
 楼主| 发表于 2014-8-15 23:47:58 | 显示全部楼层
yyxhx 发表于 2014-8-15 20:40
通通写道init.sqf中。
nike是模块名字吧?
把“模块坐标,参见编辑器左下角”改为(getPos nike)即可, ...

想让图中模块里的任何一个人死亡,触发警报,您再帮我看看,哪里还有错误。刚才试了试还是没有成功。打扰您了 我实在是太笨啦,不好意思,只能不耻下问了 谢谢您?

YourGroupList=nike ”还有写进去init吗?“

YourGroupList = [这个中括号里不填任何东西吗?];
{
        if ((_x distance getPos nike是getPos nike,还是左下角X.Y.Z,还是坐标024056“) < 100A轴,B轴各100,在这里填写<100对吗“) then {
                YourGroupList = YourGroupList + [group _x];
        };
}forEach allUnits;


SUR_fnc_countBigGroupUnits = {
        private ["_count", "_countAll"];
        _countAll = 0;
        
        for "_i" from 0 to ((count YourGroupList) - 1) do {
                _count = count Units (YourGroupList select _i);
                _countAll = _countAll + _count;
        };
        
        _countAll;
};


//剩余人数小于1做法
waitUntil {([] call SUR_fnc_countBigGroupUnits) < 1};

//触发警报


//死亡人数大于等于1做法
private ["_allCount"];

_allCount = [] call SUR_fnc_countBigGroupUnits;


waitUntil {([] call SUR_fnc_countBigGroupUnits) <= (_allCount - 1)};



本帖子中包含更多资源

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

x
发表于 2014-8-16 08:23:22 | 显示全部楼层
cnliuchang 发表于 2014-8-15 23:47
想让图中模块里的任何一个人死亡,触发警报,您再帮我看看,哪里还有错误。刚才试了试还是没有成功。打扰 ...

YourGroupList=nike ”还有写进去init吗?“   //不用

YourGroupList = [这个中括号里不填任何东西吗?];  //是的
{
         if ((_x distance getPos nike”是getPos nike,还是左下角X.Y.Z,还是坐标024056“) < 100”A轴,B轴各100,在这里填写<100对吗“) then {   //getPos,是100
 楼主| 发表于 2014-8-16 13:44:30 | 显示全部楼层
yyxhx 发表于 2014-8-16 08:23
YourGroupList=nike ”还有写进去init吗?“   //不用

YourGroupList = [这个中括号里不填任何东西吗 ...


YourGroupList = [];
{
        if ((_x distance 100 ) < 100) then {
                YourGroupList = YourGroupList + [group _x];
        };
}forEach allUnits;//这么写对吗,可是如何判定它是nike,下面的我写的对吗
SUR_fnc_countBigGroupUnits = {
        private ["_count", "_countAll"];
        _countAll = 0;
        
        for "_i" from 0 to ((count YourGroupList) - 1) do {
                _count = count Units (YourGroupList select _i);
                _countAll = _countAll + _count;
        };
        
        _countAll;
};




//剩余人数小于1做法
waitUntil {([] call SUR_fnc_countBigGroupUnits) < 1};



//死亡人数大于等于3做法
private ["_allCount"];

_allCount = [] call SUR_fnc_countBigGroupUnits;


waitUntil {([] call SUR_fnc_countBigGroupUnits) <= (_allCount - 1)};
 楼主| 发表于 2014-8-16 14:07:09 | 显示全部楼层
yyxhx 发表于 2014-8-16 08:23
YourGroupList=nike ”还有写进去init吗?“   //不用

YourGroupList = [这个中括号里不填任何东西吗 ...

YourGroupList = [];
{
        if ((_x distance 100 ) < 100) then { //距离100,在这里写蓝色的写100,游戏里出错,看来我还是没写对,谢谢您再帮我除除错               
             YourGroupList = YourGroupList + [group _x];这个X用改动吗?
        };
}forEach allUnits

您在把我看看西面的 哪里有错,这脚本 本身我就 一头雾水的。这么麻烦您我实在不还意思了 !!谢谢
发表于 2014-8-16 14:18:42 | 显示全部楼层
cnliuchang 发表于 2014-8-16 14:07
YourGroupList = [];
{
        if ((_x distance 100 ) < 100) then { //距离100,在这里写蓝色的写10 ...

把蓝色100改为(getPos nike)
_x不用改
 楼主| 发表于 2014-8-16 14:54:51 | 显示全部楼层
yyxhx 发表于 2014-8-16 14:18
把蓝色100改为(getPos nike)
_x不用改


{
        if ((_x distance getPos nike ) < 100) then {
                YourGroupList = YourGroupList + [group _x];
        };
}forEach allUnits;
您需要登录后才可以回帖 登录 | 加入VME

本版积分规则

小黑屋|中国虚拟军事网

GMT+8, 2024-5-7 08:20

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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