如果deadstate失败的话考虑换种方法:单位死亡后生成另一个单位<DeadReplacement>xxx</DeadReplacement> techtreey.xml 该科技只需在techtreey.xml存在1次即可,因为1秒钟会运行500次 <Tech name="LoopTech" type="Normal"> <ResearchPoints>0.0000</ResearchPoints> <Status>OBTAINABLE</Status> <Icon>ui\units\ironclad_icon</Icon> <Flag>Volatile</Flag> <Flag>YPInfiniteTech</Flag> <Effects> <Effect type ='TechStatus' status ='unobtainable'>LoopTech</Effect> </Effects> </Tech>
下面是判断单位数量的科技,开局生成一个DeadStateTool1;10秒后死亡,然后变成DeadStateTool2;判断DeadStateTool2数量>=1;
<Tech name ='Deadstate1' type ='Normal'> <DBID>5271</DBID> <Status>OBTAINABLE</Status> <ResearchPoints>0.0000</ResearchPoints> <Flag>Shadow</Flag> <Flag>CountsTowardEconomicScore</Flag> <Prereqs> <typecount unit="DeadStateTool2" count="1.00" state="anyState" operator="gte"/> <TechStatus status ='Active'>Fortressize</TechStatus> </Prereqs> <Effects> <Effect type ='TextOutput'>999700</Effect> </Effects> </Tech>
stringtabley.xml提示 <String _locID="999700">Deadstate1</String>
protoy.xml单位 <Unit id ='1590' name ='DeadStateTool1'> <ObstructionRadiusX>0.4900</ObstructionRadiusX> <ObstructionRadiusZ>0.4900</ObstructionRadiusZ> <FormationCategory>Body</FormationCategory> <MaxVelocity>4.5000</MaxVelocity> <MaxRunVelocity>6.0000</MaxRunVelocity> <MovementType>air</MovementType> <Lifespan>10.0</Lifespan> <TurnRate>18.0000</TurnRate> <InitialHitpoints>90.0000</InitialHitpoints> <MaxHitpoints>90.0000</MaxHitpoints> <LOS>16.0000</LOS> <UnitAIType>HandCombative</UnitAIType> <TrainPoints>30.0000</TrainPoints> <DeadReplacement>DeadStateTool2</DeadReplacement> <Bounty>0.0000</Bounty> <BuildBounty>0.0000</BuildBounty> <AnimFile>effects\projectiles\musket_ball.xml</AnimFile> <Icon>MOD\flag\setting\flag_icon_64</Icon> <PortraitIcon>MOD\flag\setting\flag_portrait</PortraitIcon> <UnitType>EmbellishmentClass</UnitType> <UnitType>TestClass</UnitType> <UnitType>Unit</UnitType> <UnitType>Unattackable</UnitType> <Flag>CollidesWithProjectiles</Flag> <Flag>ApplyHandicapTraining</Flag> <Flag>CorpseDecays</Flag> <Flag>ShowGarrisonButton</Flag> <Flag>DontRotateObstruction</Flag> <Flag>ObscuredByUnits</Flag> <Flag>Tracked</Flag> <Flag>Wanders</Flag> <Flag>Invulnerable</Flag> <Flag>NotSelectable</Flag> <Flag>DoNotShowOnMiniMap</Flag> <Command page ='10' column ='1'>Stop</Command> <Command page ='10' column ='0'>Garrison</Command> <Command page ='10' column ='2'>Delete</Command> </Unit>
<Unit id ='1590' name ='DeadStateTool2'> <ObstructionRadiusX>0.4900</ObstructionRadiusX> <ObstructionRadiusZ>0.4900</ObstructionRadiusZ> <FormationCategory>Body</FormationCategory> <MaxVelocity>4.5000</MaxVelocity> <MaxRunVelocity>6.0000</MaxRunVelocity> <MovementType>air</MovementType> <Lifespan>2000.0</Lifespan> <TurnRate>18.0000</TurnRate> <InitialHitpoints>90.0000</InitialHitpoints> <MaxHitpoints>90.0000</MaxHitpoints> <LOS>16.0000</LOS> <UnitAIType>HandCombative</UnitAIType> <TrainPoints>30.0000</TrainPoints> <Bounty>0.0000</Bounty> <BuildBounty>0.0000</BuildBounty> <AnimFile>effects\projectiles\musket_ball.xml</AnimFile> <Icon>MOD\flag\setting\flag_icon_64</Icon> <PortraitIcon>MOD\flag\setting\flag_portrait</PortraitIcon> <UnitType>EmbellishmentClass</UnitType> <UnitType>TestClass</UnitType> <UnitType>Unit</UnitType> <UnitType>Unattackable</UnitType> <Flag>CollidesWithProjectiles</Flag> <Flag>ApplyHandicapTraining</Flag> <Flag>CorpseDecays</Flag> <Flag>ShowGarrisonButton</Flag> <Flag>DontRotateObstruction</Flag> <Flag>ObscuredByUnits</Flag> <Flag>Tracked</Flag> <Flag>Wanders</Flag> <Flag>Invulnerable</Flag> <Flag>NotSelectable</Flag> <Flag>DoNotShowOnMiniMap</Flag> <Command page ='10' column ='1'>Stop</Command> <Command page ='10' column ='0'>Garrison</Command> <Command page ='10' column ='2'>Delete</Command> </Unit>
|