全部用系统自带的触发即可,但如果想要省事,可以自己合成触发
触发1用Player Controls Socket检测是否已建造贸易站;然后利用Covert将堡垒转换成玩家x; <Condition name="Player Controls Socket"> <Param name="PlayerID" dispName="$$22301$$Player" VarType="player">1</Param> <Param name="Socket" dispName="$$32975$$Socket" VarType="unit">default</Param> <Expression>trPlayerControlsSocket(%PlayerID%, "%Socket%")</Expression> </Condition>
<Effect name="Convert"> <Param name="SrcObject" dispName="$$22421$$Unit" varType="unit">default</Param> <Param name="PlayerID" dispName="$$22301$$Player" varType="player">1</Param> <Command>trUnitSelectClear();</Command> <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command> <Command>trUnitConvert(%PlayerID%);</Command> </Effect>
触发2设定循环,用Timer设定延时,同时用Units Owned检测堡垒是否爲玩家x的建筑,最后生成单位,可以用Unit Create或者Army Deploy(如果使用Army,需要先在地图定义军队) <Condition name="Timer"> <Param name="Param1" dispName="$$22291$$Seconds" VarType="long">0</Param> <Expression>(trTime()-cActivationTime) >= %Param1%</Expression> </Condition>
<Condition name="Units Owned"> <Param name="Player" dispName="$$22301$$Player" varType="player">1</Param> <Param name="SrcObject" dispName="$$22295$$Source Units" VarType="unit">default</Param> <Command>trUnitSelectClear();</Command> <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command> <Expression>trUnitIsOwnedBy(%Player%)</Expression> </Condition>
<Effect name="Unit Create"> <Param name="PlayerID" dispName="$$22301$$Player" varType="player">1</Param> <Param name="ProtoName" dispName="$$22434$$ProtoName" varType="protounit">Villager</Param> <Param name="ScenName" dispName="$$20509$$Name" varType="string">Default</Param> <Param name="Location" dispName="" varType="area">0,0,0</Param> <Param name="Heading" dispName="$$22432$$Heading" varType="long">0</Param> <Command>trUnitCreate("%ProtoName%", "%ScenName%", %Location%, %Heading%, %PlayerID%);</Command> </Effect>
<Effect name="Unit Create Multi"> <Param name="PlayerID" dispName="$$22301$$Player" varType="player">1</Param> <Param name="ProtoName" dispName="$$22434$$ProtoName" varType="protounit">Villager</Param> <Param name="Location" dispName="" varType="area">0,0,0</Param> <Param name="Count" dispName="$$22435$$Count" varType="long">0</Param> <Param name="Heading" dispName="$$22432$$Heading" varType="long">0</Param> <Command>for (i=0; <%Count%)</Command> <Command> trUnitCreate("%ProtoName%", "default", %Location%, %Heading%,, %PlayerID%);</Command> </Effect> Army Deploy使用方法可参考:https://www.aoebbs.net/thread-1683-1-1.html <Effect name="Army Deploy"> <Param name="SrcArmy" dispName="$$22348$$Army" VarType="group">default</Param> <Param name="ProtoName" dispName="$$22434$$ProtoName" varType="protounit">Villager</Param> <Param name="Location" dispName="" varType="area">0,0,0</Param> <Param name="Count" dispName="$$22435$$Count" varType="long">0</Param> <Param name="Heading" dispName="$$22432$$Heading" varType="long">0</Param> <Param name="Clear" dispName="$$22464$$Clear Existing Units:" varType="bool">true</Param> <Command>trArmyDispatch("%SrcArmy%", "%ProtoName%", %Count%, %Location%, %Heading%, %Clear%);</Command> </Effect>
此处可选,用于检测堡垒是否被摧毁,然后关闭触发2;不过由于触发2检测了堡垒的控制权是否为玩家x,堡垒被摧毁后,即使不关闭触发2,也不会再次生成单位
test.age3Yscn
如果要设定堡垒在被控制前不允许攻击,可以参考假玩家设定https://www.aoebbs.net/thread-828-1-1.html
|