|
发表于 2011-4-18 21:40:07
|
显示全部楼层
做了个科技全开的演示给你。
[trigger]
InitUpgradeAll
Events
Game - Map initialization
Local Variables
Entry = "" <String>
MaxLevel = 0 <Integer>
Player = 0 <Integer>
EntryCount = (Catalog Upgrades entry count) <Integer>
i = 0 <Integer>
Conditions
Actions
General - For each integer i from 1 to EntryCount with increment 1, do (Actions)
Actions
Variable - Set Entry = (Catalog Upgrades entry at index i)
General - If (Conditions) then do (Actions) else do (Actions)
If
(Catalog Upgrades entry Entry is a default entry) == false
Then
Variable - Set MaxLevel = (Value of Upgrades Entry "MaxLevel" for player Any Player as an integer)
Player Group - For each player Player in (Active Players) do (Actions)
Actions
Tech Tree - Set lv_entry upgrade level to MaxLevel for player Player
Else
[/trigger]
也许你现在还无法理解这个触发器的全部含义,不过目前只要知道一下原理就是了,那就是遍历数据库中每一个升级,并获取它的id和最高等级,然后用函数来升级他们。并对每一个玩家做一次。
可以看到攻防都升了6级。还有各种反应堆什么的。
|
|