Fandom

武装突袭 Wiki

CreateSimpleTask

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

  Arguments of this scripting command don't have to be local to the client the command is executed onEffects of this scripting command are not broadcasted over the network and remain local to the client the command is executed on

点击图片可看到更多讯息

开始使用于

游戏:
Arma 2
版本:
1.00

描述

描述:
Creates a new Task. The task effect is local, it will only exist on PC it was added.

基本句法

句法:
person createSimpleTask [name, parentTask]
参数:
person: Object - Unit to add this new task

[name, parentTask]: Array

name: String

parentTask (Optional): Task
返回值:
Task - the new task

范例

范例1:
_currentTask = player createSimpleTask ["NewTask"];

范例2:
_childTask = player createSimpleTask ["ChildTask", _currentTask];

额外资讯

多人游戏:
-
也可以看看:

TaskssimpleTasksbriefingremoveSimpleTasksetSimpleTaskDescriptionsetSimpleTaskDestinationsetTaskStatesetTaskResulttaskState

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Posted on July 02, 2011 - 11:45 (GMT+1)
Lou Montana

  • Creating child will position the new task just under the parent task.
  • Creating another "normal" (parent) task will create a new line above the others. Think of it if you want ordered objectives.
  • Succeeding parent task will automatically succeed childs, whatever their taskState was set to. (I.E. If a task is set as a child to another, it will be completed when its parent is complete.. no matter if the child task really was or not).
  • This command has to be executed again for it to be applied for JIP players - no server sync

Full step by step code from beginning to end:
Step 1: create a new simpleTask A_SIMPLE_TASK = player createSimpleTask [(localize "STR_aSimpleTask")]; You may create a task at any given point in time. You just need to be aware of the fact, that you've created the task for a single unit (the player). So if you make use of teamSwitch, respawn or similiar, you need to think about how to manage this, so all of these units will have up to date tasks assigned to them. Second, it's a good practice to use a stringtable, even if you do not plan (yet) to offer translations.
Step 2: task destination
A_SIMPLE_TASK setSimpleTaskDestination _destination; variable/pointer-to-your-task setSimpleTaskDestination some-position. That's it.
Step 3: task description A_SIMPLE_TASK setSimpleTaskDescription [

  (localize "STR_aSimpleTaskLongText"),
  (localize "STR_aSimpleTask"),
  (localize "STR_aSimpleTaskWaypointLabel")

]; Again, no magic involved here. You take your task, the command setSimpleTaskDescription an pass an array with three strings in it. The first string is the long description text, the second is the name/title of the task and the last one will show up on-screen on the waypoint in cadet mode.
Step 4: set and update task states A_SIMPLE_TASK setTaskState "CREATED"; And that's it. Here a minimal working example: A_SIMPLE_TASK = player createSimpleTask ["simple task title"]; A_SIMPLE_TASK setSimpleTaskDestination (position player); A_SIMPLE_TASK setSimpleTaskDescription [

  "simple task long description",
  "simple task title",
  "simple task waypoint label"

]; A_SIMPLE_TASK setTaskState "CREATED"; And then later in the mission: A_SIMPLE_TASK setTaskState "SUCCEEDED"; If you want to keep the player in the loop about the status of tasks, you may always do this: [ objNull, objNull, A_SIMPLE_TASK, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";


Bottom Section

更多维基

随机维基