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

 找回密码
 加入VME

QQ登录

只需一步,快速开始

搜索
查看: 4301|回复: 25

[求助] 版主啊。。脚本大大们在不在啊。。。

[复制链接]
发表于 2013-5-28 17:11:01 | 显示全部楼层 |阅读模式
有个问题想问问。。联机时设置了复活的话。。玩家单位预先改一个名字。。然后这个玩家死掉了。。。再复活。。那么这个复活玩家还能被脚本识别原来的名字么? 因为有的任务貌似会删除掉死亡的玩家

比如说有个玩家单位叫 name1 然后有些脚本setpos命令等等与他关联。。

他死掉以后又复活了,那么他还叫name1么? setpos 等等命令还能识别他叫name1然后触发或者调用脚本么??
发表于 2013-5-28 18:10:34 | 显示全部楼层
用eventhandler来处理重生吧。用名字不是很靠谱。 虽然我也没用过。。。 一直都是在单机
 楼主| 发表于 2013-5-28 18:31:51 | 显示全部楼层
2fast 发表于 2013-5-28 18:10
用eventhandler来处理重生吧。用名字不是很靠谱。 虽然我也没用过。。。 一直都是在单机

大神。。就是你了!
http://www.chinavme.com/thread-25216-1-1.html

这个帖子我问过如何读取 classname信息的。。。遇到问题了

比如 你在脚本里是这样写的

((count (configFile >> "CfgVehicles"))-1)

_item=((configFile >> "CfgVehicles") select _i); 算出了总共有多少载具然后定义各个载具的classname

但是你有没有判断载具是哪个阵营的相关办法呢?我还在弄随机刷兵刷支援的相关脚本。。一个一个慢慢写上去太麻烦了。。但是直接读又不会自动区分载具的阵营。。。

能不能加上一些语句添加读取的阵营类别呢?好像有。。但是又不清楚具体是哪个

连大类 都给读出来。。。例如 man all car 之类的。。。。不能正常使用啊。。。你那个脚本我没看懂太多能挑出载具读取的专门给细讲一下么
发表于 2013-5-28 23:46:35 | 显示全部楼层
把触发器的条件改成:组内任意一个成员触发,都可以执行。
发表于 2013-5-29 00:23:27 | 显示全部楼层
下网上载 发表于 2013-5-28 18:31
大神。。就是你了!
http://www.chinavme.com/thread-25216-1-1.html

明天上来写。今天有点忙
 楼主| 发表于 2013-5-29 08:57:01 | 显示全部楼层
2fast 发表于 2013-5-29 00:23
明天上来写。今天有点忙

哟西! 等你来搭救!
发表于 2013-5-29 09:21:58 | 显示全部楼层
本帖最后由 2fast 于 2013-5-29 09:26 编辑
下网上载 发表于 2013-5-29 08:57
哟西! 等你来搭救!


fnc_cfgVehicles_getClass =
{
        private ["_classType","_i","_list","_item","_side"];
        _classType = _this select 0;
        _side = if(count _this>1)then{_this select 1}else{-1};
       
        _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  
                                {
                                        if(_side==-1)then
                                        {
                                                _list set [count _list, configName _item];
                                        }else{
                                                if (getNumber (_item >> "side") == _side) then
                                                {
                                                        _list set [count _list, configName _item];
                                                };
                                        };
                                };
                        };
                };
        };
        _list       
};

用法是
_list = [_type,_side] call fnc_cfgVehicles_getClass;

_type 可以写 "Car"  "Men", "Air" "Ship" "Ammo" "Support"  "Armored"  "Backpacks" 等等种类
_side是写阵营  1是blue, 2是red, 3是civilian,不写的话就是无限制
_list出来的就是载具的名单

没有测试。

跟我之前发的脚本主要区别在于加了
if (getNumber (_item >> "side") == _side) then
{
        _list set [count _list, configName _item];
};

这是读取每个class在config中side的设置,这个决定的载具是属于红蓝还是绿。当然也有平民,逻辑等等其它的值
去six config browser看看载具的Config
http://browser.six-projects.net/ ... F/config?version=69   蓝方载具
http://browser.six-projects.net/ ... F/config?version=69                红方
http://browser.six-projects.net/ ... d/config?version=69    平民
看他们的side值是不是不一样?这就是把他们分开的关键。 getNumber (_item >> "side") 就是读这个值的关键.
 楼主| 发表于 2013-5-29 09:36:09 | 显示全部楼层
2fast 发表于 2013-5-29 09:21
fnc_cfgVehicles_getClass =
{
        private ["_classType","_i","_list","_item","_side"];

十分感激
 楼主| 发表于 2013-5-29 09:43:32 | 显示全部楼层
2fast 发表于 2013-5-29 09:21
fnc_cfgVehicles_getClass =
{
        private ["_classType","_i","_list","_item","_side"];

额。。那个。。SQF脚本需要先运行一次么?还是说直接call fnc_cfgVehicles_getClass 就行?我没加载你那个插件的。。。
发表于 2013-5-29 10:35:02 | 显示全部楼层
先用 call compile preprocessFile运行一遍sqf
以后直接call 就可以了
 楼主| 发表于 2013-5-29 12:58:37 | 显示全部楼层
2fast 发表于 2013-5-29 10:35
先用 call compile preprocessFile运行一遍sqf
以后直接call 就可以了

_call = call compile preprocessFile "add.sqf"
_list = ["men",2] call _call

这样操作?
 楼主| 发表于 2013-5-29 12:59:45 | 显示全部楼层
2fast 发表于 2013-5-29 10:35
先用 call compile preprocessFile运行一遍sqf
以后直接call 就可以了

_call = call compile preprocessFile "add.sqf"
_list = ["men",2] call _call

这样操作?
发表于 2013-5-29 13:33:27 | 显示全部楼层
下网上载 发表于 2013-5-29 12:59
_call = call compile preprocessFile "add.sqf"
_list = ["men",2] call _call

[] call compile preprocessFile "add.sqf"; //只用在任务中跑一次



_list = ["men",2] call fnc_cfgVehicles_getClass;//可以在任何脚本中用,不需要和上面的在一起用
 楼主| 发表于 2013-5-29 14:02:24 | 显示全部楼层
2fast 发表于 2013-5-29 13:33
[] call compile preprocessFile "add.sqf"; //只用在任务中跑一次

再次二十分感谢
 楼主| 发表于 2013-5-29 19:11:24 | 显示全部楼层
2fast 发表于 2013-5-29 13:33
[] call compile preprocessFile "add.sqf"; //只用在任务中跑一次

试过了。。不行啊。。按你的方式用下面的命令读出来看看。。发现是个[] 这个东西。。。。空的?
hintSilent format ["classname:%1",(_list)]
您需要登录后才可以回帖 登录 | 加入VME

本版积分规则

小黑屋|中国虚拟军事网

GMT+8, 2024-6-2 19:04

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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