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

 找回密码
 加入VME

QQ登录

只需一步,快速开始

搜索
查看: 2639|回复: 7

[求助]请教如何编辑空降啊???????????

[复制链接]
发表于 2007-3-21 22:40:59 | 显示全部楼层 |阅读模式
我会编辑一队人上车下车...上飞机和下飞机...可不知道怎么编辑空降啊..帮帮忙
发表于 2007-3-21 23:11:52 | 显示全部楼层

这个要用脚本的,要用到EJECT指令和unassignVehicle 指令

发表于 2007-3-21 23:23:32 | 显示全部楼层

Parachuting空降跳伞动作的制作
1.       创建小队

2.       创建直升机

3.       指定队员的开始位置在UH60-MG里

4.       制作.sqs脚本文件

5.       给UH60-MG创建Waypoints和实施脚本文件

3K和FREE-SNIPER提醒大家:


因为前面已经讲过如何添加UNITS,OBJECTS等等细节,所以这里我们将不在详细述说,同时大家也可以对照英文来看翻译,顺便提高一下英语水平.嘿嘿


This tutorial will teach you how to implement parachute drops in your own missions. We have had a lot of requests for this tutorial and it's indeed one of the coolest things to do in a mission. Start of by starting the editor and loading the island of your choice (we used Everon for the example mission).

在这个教程中,我们将教大家如何在自己的任务加入跳伞动作,

选一个你喜欢的地图,细节略过(这里我们还用Everon)。

==========================================================

Creating the infantry group you want to parachute:

First you'll have to create an infantry group, either by using the group tool (F2) or by placing your units and using the group tool to group them. Once you have created your group, give the leader a name in the Name field. In this tutorial we will use L1. You will also have give the group a group name so it can be identified later on. To do this go into the group leader's properties and in the Initialization field type:

grp = group this


Where it says grp, you can place the name of your choice, but for this tutorial we will use grp.

先来做个小队(用我们以前提到过的2种方法里的任何一个都行);做完以后,别忘了给队长取个名字(这里我们就叫他L1吧,见T2);

然后再给小队取个名字,选中队长,在Units窗口里的Initialization旁输入

grp = group this


(你可以把grp改成其它名字)。

===============================================

Creating the helicopter to use for the transportation:


To create the helicopter you will need to press F1 first, to select the Units tool. Then double-click somewhere on the map, which will open up the Units window. In the Side drop down menu, choose West, since we will be using a NATO UH60-MG helicopter. After this select Air from the Class drop down menu. Next we'll go to the Units drop down menu and select the UH60-MG. You also need give the helicopter a name. In this tutorial we used helo1.

You have now created a UH60-MG named helo1.


接下来做个直升机--按F1, Side: West, Class: Air, Unit: UH60-MG, 取名为helo1.

====================================================

Commanding the infantry group to start out in the UH60-MG:

The easiest way to command the infantry squad to board the UH60-MG is to type the command for it in their Initialization field:

this moveincargo helo1


helo1 is the name of the designated vehicle, the UH60-MG in this case.

Note: since the squad's leader already has a command in his Init, you will have to use a special sign (;) and a space to add a second independent command. The command line now runs like this:


grp = group this; this moveincargo helo1


指定队员的开始位置在UH60-MG里:.


让队员坐在飞机里的最简单方法就是在所有队员的Initialization里输入

this moveincargo helo1.

注:因为在队长的Initialization旁原先就有一条命令grp = group this, 所以我们要用分号和空格来把这两个命令分开:

grp = group this; this moveincargo helo1

注意:在这个任务中,helo1就是UH60-MG的名字.所以不要写成

this moveincargo UH60-MG

=====================================================

Creating the script file (.sqs) which will order the units to eject

You will have to create a script file which will tell the infantry group to disembark in midair. To do this, you must first create a Wordpad file with any name, ending with the file extension .sqs. For this tutorial, we will use the script name AlphaExit.sqs. Put the following in the text file:

_aunits = units L1

_i = 0

_Max = count _aunits

#Here

(_aunits select _i) action ["EJECT",helo1]

unassignvehicle (_aunits select _i)

_i=_i+1

~1

?_Max>_i:goto "Here"

exit


Definition of the script file:


This script may look difficult, but it really isn't that hard to understand, because you'll only have to edit 2 words:


_aunits = units L1 -------------- In this line, where it has the L1 you put in the name of the infantry squad's leader. This line will create an array (some sort of table) with all the unit ID numbers of the squad's members in it (the mission automatically gives all units such a number. You can locate it in the mission.sqm file if you wish). This array will be used later on.

(_aunits select _i) action ["EJECT",helo1] -- In this line, all you have to edit is the word helo1. Instead of that you can put the name of the helicopter name you used. This command line will first select a unit ID# from the array _aunits and then order this unit to eject the helicopter. The value of _i will increment by 1 every time the script has given its orders to a unit.


For those of you who would like to fully understand the rest of the lines too, check the below definitions:


_i = 0 -- This will set the local variable (local variables are only used in the script itself and not any other part of the mission) _i to 0, which is its initial value.

_Max = count _aunits -- This will count the amount of unit ID#s in the array _aunits. This is done because the script then knows how many units there are in the squad and thus how many times it will have to loop the eject command. It will give the amount the variable name _Max.

#Here -- This creates a 'marker' in the script which can be referred to using the goto command. For those of you familiar with web design, it's like a named anchor.

unassignvehicle (_aunits select _i) -- This unassigns the unit from the vehicle, meaning the helicopter can be used by other soldiers again. While a vehicle is assigned to a unit, no one else can use it.

_i=_i+1 -- This increases the value of _i by 1 everytime the script passes this point (performs a loop)

~1 -- Like we explained before, this command will delay the script for 1 second before carrying on.

?_Max>_i:goto "Here" -- This will make the script go back to the #Here marker as long as the script has not ordered all units to eject yet (thus as long as _Max is not bigger than the amount of units in the squad _i)

exit -- This will exit the script.

After you have created the script file, save it to you mission’s directory.


要想命令队员跳伞,我们得做一个.sqs脚本文件。文件名可以随便起,这里我们叫它AlphaExit.sqs, 在里面输入:

_aunits = units L1  --------(此命令会建立一个序列表,里面有全部队员的ID号码--任务会自动给队员编号;这里的L1就是队长)

_i = 0

_Max = count _aunits ------(此命令会算出在序列_aunits里一共有几个ID号,这样脚本就会知道在此小队里一共有多少人,也就是说跳伞的命令应该被重复几次)

#Here

(_aunits select _i) action ["EJECT",helo1] -------(此命令首先会从序列_aunits里面选出一个队员的ID号,然后命令他跳伞,每当一个                                                            队员接到跳伞的命令后,_i的值就会加1)

unassignvehicle (_aunits select _i)

_i=_i+1

~1

?_Max>_i:goto "Here"


exit


把这个.sqs文件放在任务文件夹里。

=========================================

Creating the necessary waypoints for the UH60-MG, and executing the script file:


First you need to click on the UH60-MG and hit F4 to select the Waypoint tool. Next double click somewhere on the map where you want your first WP to be. In this tutorial, we will have 3 waypoints; 1 telling the UH60-MG to move to a spot and fly a bit higher, another one to move to a spot and execute the script file you made and a third WP that will tell the UH60-MG to move away from the area.


Once you have created your first WP, double click somewhere else on the map where you want your units to start their paratrooping. In this WP's properties, make the WP Type Move. Now in the second WP's properties, in the On Activation field, type this:


player exec "AlphaExit.sqs"


This will make the player unit execute the script. You can use any unit name here, but using player here is the best option since he is the last one to die (the script will be of no use to you when you are dead). Where it says AlphaExit.sqs, you can put the name of the script you made, in this case AlphaExit.sqs.


Note: The minimum height for a parachute operation is around 75-80 meter, but there is a great risk of injury when you perform a jump that low. So try sticking around 110-125 meters high. To command the helicopter to fly higher than its standard flight height, type this in its Initialization field, or a WP's On Activation field (we chose to put in the first WP).


helo1 flyinheight 120


Where it says helo1 you can put the name of your helicopter. And where it says 120, put the height (in meters) you want the helicopter to fly at.


That's it, you have now created your very first helicopter parachute jump!


给UH60-MG创建Waypoints和实施脚本文件。

我们需要放3个WP:

第一个放在飞机前,属性为Move, 在On Activation旁输入

helo1 flyinheight 125


这样飞机一起飞就会升到125米高的地方(见T3)

第二个放在小队旁边,属性为Move, 在On Activation旁输入player exec "AlphaExit.sqs";(见T4)第三个可以随便放,选Move.

注:75-80米是允许跳伞的最低高度,很容易受伤,所以最好定在110-125米的高空。

发表于 2007-3-21 23:28:53 | 显示全部楼层

参考上面的,我以前就是按上面的空降成功的,我的.sqs文件如下

_aunits = units L1

_i = 0

_Max = count _aunits

#Here

(_aunits select _i) action ["EJECT",helo1]

unassignvehicle (_aunits select _i)

_i=_i+1

~1

?_Max>_i:goto "Here"

发表于 2007-3-22 10:56:07 | 显示全部楼层
[em06]
发表于 2007-3-22 13:18:49 | 显示全部楼层
看见这个贴,我忽然想起自己以前一次非常失败的空降.一开始我是用脚本让一队士兵从行驶的车辆上陆续跳下,感觉很不错,就想到让直升机超低空贴地飞行,高度1~2米,让特种队员陆续跳下,构思很不错,结果~~~~~~~~~~~~~~~~~全摔死了.
发表于 2007-3-22 14:12:16 | 显示全部楼层

就是让AI高空空降 也总是有一两个倒霉蛋没打开降落伞...

[em42]
 楼主| 发表于 2007-3-22 15:45:09 | 显示全部楼层

好复杂..有简单的吗??

就是不用我们先编辑好特定任务的

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

本版积分规则

小黑屋|中国虚拟军事网

GMT+8, 2024-5-2 22:26

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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