Faustmouse
Deity
- Joined
- Jan 31, 2012
- Messages
- 3,524
You don't need an event. Missions use the event mechanism. You make a mission and have code that does what you want. Look at the Herd folder Horse units for the XML and the CvEventManager for the python code it uses. Sorry if this is a bit brief but it is way past my bed time and it looks like it will be cool enough to sleep tonight!
That was a bit too brief for me I'm afraid

I was looking at My_Mods/Herds but there is only the Beastmaster, but no Horse unit. Inside it there is a UNITCLASS_TAMED_HORSE_PAIR but I couldn't find a specific mission there. I also couldn't find a CvEventManager. I've looked at every file in the Python Folder und also in the Event Folder.
This is was I have in the MissionInfo:
Spoiler :
Code:
<MissionInfo>
<Type>MISSION_LAUNCH_LUNAR_ROVER</Type>
<Description>TXT_KEY_MISSION_LAUNCH_LUNAR_ROVER</Description>
<Help/>
<Help>TXT_KEY_MISSION_LAUNCH_LUNAR_ROVER_HELP</Help>
<Waypoint>NONE</Waypoint>
<EntityEventType>NONE</EntityEventType>
<iTime>0</iTime>
<bTarget>0</bTarget>
<bBuild>0</bBuild>
<bSound>0</bSound>
<bVisible>1</bVisible>
<Button>Art/Interface/Buttons/Units/button_neanderthal.dds</Button>
</MissionInfo>
And this for the Outcome:
Spoiler :
Code:
<OutcomeInfo>
<Type>OUTCOME_LAUNCH_LUNAR_ROVER</Type>
<Description>TXT_KEY_LAUNCH_LUNAR_ROVER</Description>
<Message>TXT_KEY_OUTCOME_LAUNCH_LUNAR_ROVER_MESSAGE</Message>
<PrereqTech>TECH_LUNAR_BASES</PrereqTech>
<bNeutralTerritory>0</bNeutralTerritory>
<bHostileTerritory>0</bHostileTerritory>
<bCity>0</bCity>
</OutcomeInfo>
And then I think you need an "action" tag on the unit in question. At least that was the chase with the mission to upgrade a Ship to a Bulldozer.
Spoiler :
Code:
<Actions>
<Action>
<MissionType>MISSION_LAUNCH_LUNAR_ROVER</MissionType>
<iCost>
<Adapt>
<ID>ADAPT_DEFAULT</ID>
<Constant>15</Constant>
</Adapt>
</iCost>
[B]#That assignes cost to the unit I guess.[/B]
<ActionOutcomes>
<Outcome>
<OutcomeType>OUTCOME_LAUNCH_LUNAR_ROVER</OutcomeType>
<iChance>100</iChance>
<UnitType>UNIT_LUNAR_ROVER</UnitType>
[B]# This says always (100%) do something with the Unit Rover. [/B]
[I]<bUnitToCity>
<Constant>0</Constant>
</bUnitToCity>
<PlotCondition>
<Not>
<Is>TAG_ANARCHY</Is>
</Not>
</PlotCondition>
</Outcome>
</ActionOutcomes>
</Action>
</Actions>[/I]
Can you change the bUnitToCity to bUnitToPlot? And then set as PlotCondition to a list of all 5 lunar terrains?
-----------
There are no screenshots yet. It wouldn't be too interesting, because I just copied unit graphics and buttons from other buildings and units. At some point I have to ask Toffer or Sparth if they could make them prettier
