请选择 进入手机版 | 继续访问电脑版

 找回密码
 点一下
查看: 1685|回复: 5

手把手系列 API解析 【脚本解析之任务目标(Objective)】BY 月

[复制链接]
发表于 2010-5-14 17:12:22 | 显示全部楼层 |阅读模式
Objective主要用在战役中的任务目标设定,这样就可以做出节奏紧凑,丰富多彩的任务体验啦。
这里主要把Objective相关的本地API介绍一下。有什么不对,请大家指出来,我们共同进步啊。
其中Example都没有添加,大家有什么好例子也可以推荐啊,谢谢。

原帖:http://bbs.sc2mod.net/read.php?tid-99.html






native int ObjectiveCreate3 (
textinName,
textinDescription,
int inState,
bool inVisible,
bool inPrimary
);
功能
创建一个待完成的任务目标
参数
text inName】:任务目标的名字,显示出来的名字
text inDescription】:任务目标的描述,鼠标上ToolTips显示的文字
int inState】:任务目标的状态
bool inVisible】:是否可见
bool inPrimary】:是否是主要任务目标
返回值
int】:创建的任务目标ID
Example


native int ObjectiveLastCreated ();
功能
获取最近一次创建的任务目标
参数
返回值
int】:创建的任务目标ID
Example


native void ObjectiveDestroy (int inObjective);
功能
摧毁一个任务目标
参数
int inObjective】:待摧毁的任务目标ID
返回值
Example


native void ObjectiveDestroyAll (playergroupinPlayers);
功能
摧毁用户组的所有任务目标
参数
playergroup inPlayers】:用户组
返回值
Example


native void ObjectiveShow (int inObjective, playergroup inPlayers, boolinShow);
功能
显示/隐藏 某个用户组的某个任务目标
参数
int inObjective】:待显示的任务目标ID
playergroup inPlayers】:用户组
bool inShow】:是否显示
返回值
Example


native bool ObjectiveVisible (int inObjective, intinPlayer);
功能
获取某个用户的某个任务目标是否被显示着
参数
int inObjective】:待检测的任务目标ID
int inPlayer】:用户
返回值
true】:显示
false】:未显示
Example



native void ObjectiveSetName (int inObjective, text inName);
功能
设置某个任务目标的名字
参数
int inObjective】:要设置的任务目标ID
text inName】:要设置的名字
返回值
Example


native text ObjectiveGetName (int inObjective);
功能
获取某个任务目标的名字
参数
int inObjective】:任务目标ID
返回值
text】:任务目标的名字
Example
native void ObjectiveSetDescription (int inObjective, text inText);
功能
设置某个任务目标的描述
参数
int inObjective】:要设置的任务目标ID
text inText】:要设置的任务目标的描述内容
返回值
Example


native text ObjectiveGetDescription (intinObjective);
功能
获取某个任务目标的描述
参数
int inObjective】:任务目标ID
返回值
text】:任务目标的描述
Example
native void ObjectiveSetState (int inObjective, intinState);
功能
设置某个任务目标的状态
参数
int inObjective】:要设置的任务目标ID
int inState】:要设置的任务目标的状态
返回值
Example


native int ObjectiveGetState (int inObjective);
功能
获取某个任务目标的状态
参数
int inObjective】:任务目标ID
返回值
int】:任务目标的状态
Example


native void ObjectiveSetPlayerGroup (int inObjective, playergroup inPlayers);
功能
设置某个任务目标的用户组
参数
int inObjective】:要设置的任务目标ID
playergroup inPlayers】:要设置的任务目标的用户组
返回值
Example


native playergroup ObjectiveGetPlayerGroup (intinObjective);
功能
获取某个任务目标的用户组
参数
int inObjective】:任务目标ID
返回值
playergroup】:任务目标的用户组
Example


native void ObjectiveSetPrimary (int inObjective, boolinPrimary);
功能
设置某个任务目标是否主要任务目标
参数
int inObjective】:要设置的任务目标ID
bool inPrimary】:任务目标是否是主要任务目标
返回值
Example


native bool ObjectiveGetPrimary (int inObjective);
功能
获取某个任务目标是否是主要任务目标
参数
int inObjective】:任务目标ID
返回值
true】:任务目标是主要任务
false】:任务目标不是主要任务
Example


发表于 2010-5-14 17:56:50 | 显示全部楼层
还以为是视频呢,
“手把手”。
回复

使用道具 举报

发表于 2010-5-14 18:07:41 | 显示全部楼层
大概素还米完成。正在制作中吧……
回复

使用道具 举报

 楼主| 发表于 2010-5-14 18:16:27 | 显示全部楼层

回 1楼(jpg) 的帖子

计划是先把API讲解一边,然后才是例程。否则做出来教程的基础可能会不好。
回复

使用道具 举报

发表于 2010-5-23 16:05:46 | 显示全部楼层
哎?LS呢?

啊啊,我说什么好。不要突然删贴啊喂。
回复

使用道具 举报

发表于 2010-5-23 20:32:01 | 显示全部楼层
寒心那个组织 这个我们听起来终于米有精神分裂的感觉了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-3-29 23:17 , Processed in 0.048236 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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