找回密码
 点一下
查看: 1161|回复: 1

怎么让技能在使用的时候角色头顶出现文字提示啊(比如技能名称)

[复制链接]
发表于 2010-11-13 00:48:46 | 显示全部楼层 |阅读模式
另外请问有没有致命一击这个技能实现的帖子呢。。
发表于 2010-11-13 18:39:44 | 显示全部楼层
这要看你是固定某个技能飘字还是所有技能使用的是有飘字了。

固定技能的话可以使用数据编辑器来实现。参考战役里拾取晶矿时候的飘字Actor。


如果要所有技能都飘字你必须使用触发器。


我这里给个演示。

要注意SC2里很多东西都属于技能,包括攻击移动,所以如果你不想连走路都飘字的话,最好在条件里做个过滤。


简单地说以下给你个实现方法。

难点有2个,一个是如何获得技能名字。实际上SC2本身并没有获得技能名的函数。你需要查询Catalog才能获得。Catalog的查询方法见我这个帖子。
http://bbs.islga.org/read-htm-tid-38662.html

不过就算看不明白也没关系,我在这个演示里面做了个函数,可以直接从技能ID来获取技能名。如果你看不明白Catalog的使用方法可以直接把我地图里这个函数复制去。
[trigger]
Get Ability Name Path
    Options: Function
    Return Type: String
    Parameters
        Ability = No Game Link <Game Link - Ability>
    Grammar Text: Get Ability Name Path(Ability)
    Hint Text: (None)
    Custom Script Code
    Local Variables
    Actions
        General - Return (Value of Abilities (String(Ability)) "Name" for player Any Player)
[/trigger]

然后难点2在于如何捕捉所有技能的发动。

其实如果你用纯触发器的话只能捕捉指定技能,而捕捉任意技能是有窍门的。也就是AbilityCommand里的Ability参数必须是""(即空字符串,注意不能是null)。



[trigger]
Float Text
    Events
        Unit - Any Unit uses (("", 0)) at Generic3 - Execute stage (Ignore shared abilities)
    Local Variables
    Conditions
    Actions
        Text Tag - Create a text tag with the text (Game text for (Get Ability Name Path((Ability of (Triggering ability))))) for (All players), using a font size of 48, at (Position of (Triggering unit)) and height offset 1.0, initially Visible, and fog of war enforcement set to false
        Text Tag - Attach (Last created text tag) to (Triggering unit) with height offset 3.0
        Text Tag - Set Text color(s) for (Last created text tag) to (100%, 50%, 0%)
        Text Tag - Set Duration time for (Last created text tag) to 7.0 seconds
        Text Tag - Set Fade Duration time for (Last created text tag) to 4.0 seconds
        Text Tag - Set the velocity of (Last created text tag) to 0.5 coordinates per second at an angle of 90.0 degrees from horizontal
[/trigger]

注意这样创建出来的字是会随着客户端而变化的,你看我图上是Yamato Gun,如果你客户端是中文版那就会显示为大和炮了。

地图下载在图片下面
Screenshot2010-11-13 18_37_55.jpg

FloatAbilityName.SC2Map

16 KB, 下载次数: 13

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-22 19:18 , Processed in 0.153007 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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