............Unit - A unit Is issued an order targeting an object
//当一个单位接收到一个指定物件的指令
......Conditions
............(Issued order) Equal to (Order(sleep))
//指令為sleep
......Actions
............Set GroupSleep_MajorTarget = (Target unit of issued order)
//将指令指定的单位存在GroupSleep_MajorTarget这个变数中
Group Sleep
....Events
........Unit - A unit Starts the effect of an ability
//当一个单位使得一项技能开始生效
....Conditions
........(Ability being cast) Equal to Group Sleep
//使用的技能為Group Sleep
....Actions
........Unit Group - Pick every unit in (Units within 300.00 of (Position of GroupSleep_MajorTarget)) and do (Actions)
//选取GroupSleep_MajorTarget这个单位附近300范围的所有单位并执行Loop Action内的所有动作
...........Loop - Actions
................Unit - Create 1 Sleep Caster for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 0.00 degrees
//產生一个单位于施法者(触发的单位)旁边,设定所有者為拥有施法者的玩家
................Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
//设定刚刚產生的单位生命时间為2.00(长度自己决定,足够施放AMS即可) ................Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked unit)
Q:假设在一张 RPG 地图中, 给每一位玩家一个工人, 让玩家选英雄
Event
.....Unit - A unit enters
Action
......Unit - Create 1 for Trigging Player at center of
facing ......
为什麼单位进入该Region时没有反应?
设定错误。由于引发事件的是单位,而不是玩家,所以 Trigging Player 无法表明到底是哪一个玩家。正确的设定方式如下:
Event
......Unit - A unit enters
Action
......Unit - Create 1 for (Owner of (Trigging Unit)) at center of facing ......
Q:请问如何加入随机效果?
在设定Trigger时,用If/Then/Else做设定,例如:
PaladinSkill:
Events
......Unit - A unit Is attacked
//一个单位遭受攻击
Conditions
......(Unit-type of (Attacking unit)) Equal to Paladin
//攻击者為Paladin Actions
......If (All Conditions are True) then do (Then Actions) else do (Else Actions)
............If - Conditions
..................(Random integer number between 1 and 10) Equal to 1
GAME CACHE 是用 TRIGGER EDITOR 来操作的~~下面说说相关 ACTIONS 的含义~
1]创建一个缓存~~想要使用缓存~~当然要先创建啦~~
Game Cache - Create a game cache from MapName.w3v
这就是一个创建 CACHE 语句~~后面的 MapName.w3v 是你创建的 CACHE 的名字~~:)~~
2]创建以后~~就可以用他来保存资料了~~
Game Cache - Store Unit as Lable of Category in (Last created game cache)
这是一个 保存单位 的语句~~在 Unit 处选好需要保存的单位~~填写好 标识(Lable) 和 分类(Category) ~~最后 选择将 单位保存到 哪个 CACHE 里面~~其中 标识 和 分类是可以随意填写的~~:)~~
类似的~~还有下面一些类型的数据可以保存到 CACHE 里面~~使用方法同上!
Game Cache - Store Real as Lable of Category in (Last created game cache)
Game Cache - Store Integer as Lable of Category in (Last created game cache)
Game Cache - Store Boolean as Lable of Category in (Last created game cache)
Game Cache - Store String as Lable of Category in (Last created game cache)
另外~~
Game Cache - Restore lable of Category from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing 0.00
Game Cache - Restore lable of Category from (Last created game cache) for Player 1 (Red) at (Center of (Playable map area)) facing (Position of (Triggering unit))
这个语句是专门用于 取出一个被保存的单位且放置在地图上的~~
最后~~如果想清除 CACHE 中的数据可以使用下面两个语句~~
Game Cache - Clear (Last created game cache)
清除所有数据~~
Game Cache - Clear all labels of Category in (Last created game cache)
清除某一类的数据~~
Q:嗯,如何动态改变中立商店/酒馆里卖的东西呢?
Neutral Building - Add 物品/单位 to (商店/酒馆) with 初始存货数 in stock and a max stock of 最大存货数
首先,在平衡常数中将您的自定义英雄添加到“科技 - 等价物 - 英雄”列表里面去,这样的话就能保证每升一级主基地只能造一个了。
然后还要添加一条 Trigger :
Player - Limit training of xxx to 1 for Player n (其中“ xxx ”为该自定义英雄的单位类型)
这样您的英雄就只能造一个了
Q:如何让死掉的树复活呢?
很简单的,用 Destructible - Resurrect 即可。
以上就是我们关于触发器和一些其他问题的一些介绍,所以我们在面对这些设置的时候首先就需要把以上的这些问题搞明白,这样对症下药的话我想鞥狗给大家节省很多时间,当然一些额问题出现得比较特殊,所以我们还需要把那些比较特殊的问题也记录一下。之后我们对触发器的设置就有更多的解决办法,当然还有jass的一些问题我们也可以在以上找到将解决的办法。