Dancing Hoskuld
Deity
Is it possible to have an outcome not valid if a building is present? If so is it in the unit or on the outcome infos or on the mission?
You could use the plot condition on the outcome (in the unit or combat type info) by querying with the Has tag (and inverting it with Not).Is it possible to have an outcome not valid if a building is present? If so is it in the unit or on the outcome infos or on the mission?
You could use the plot condition on the outcome (in the unit or combat type info) by querying with the Has tag (and inverting it with Not).
getCost()->evaluate(pUnit->getGameObject())
No, pUnit->getGameObject() is the right context and you will notice that it is already used in several places in that code.@AIAndy: I'm thinking that evaluating iCost with the unit gameobject as context is not right, as I'm getting memory access exceptions when calling
Code:getCost()->evaluate(pUnit->getGameObject())
What other context would make sense here, I'm not too familiar with how OutcomeMissions work with the Outcome system.
No, pUnit->getGameObject() is the right context and you will notice that it is already used in several places in that code.
Make sure you deal properly with the integer expression being NULL when there is no iCost in the XML.
bHostileTerritory=1 means this outcome is possible on the territory of a state with which you are at war with.In the Outcome infos file is bHostileTerritory =1 mean not (your nation or any nation of your team or any vassal of you or any team member)
@AIAndy I am currently working on some Python that will cause a building to be build in the capital after any combat (win, loose or withdraw) with an animal. I assume I will need to do something special so that we don't get OOS errors and will use the code we already have for how the Colonist and Pioneer add buildings.
Each animal combat will build a hierarchy of myth buildings eg Dart Frog could build "Earth Myth", "Amphibian Myth" and "Poison Myth". If the "Earth Myth" has been built then the "Amphibian Myth" would be built and so on until all the buildings have been built after which combat with Dart Frogs wont have any extra affect. This is in addition to the Kill Outcomes.
I was wondering if this were possible to do in the dll quicker.
If it is done in Python then the list of buildings would be held in Python but they would be in the XML otherwise.
I have very immediate plans in the works to implement that Great Hunter btw... just in case you're getting tired of waiting for me and that's what this project is about. I've figured out I can probably manage the UI side of it too since I should be able to control the display from the dll alone. Pretty much have plotted the project out and should be able to implement it quickly, perhaps even over this weekend.
The combat result Python events should be synced so it should be fine making game state changes in reaction to them.@AIAndy I am currently working on some Python that will cause a building to be build in the capital after any combat (win, loose or withdraw) with an animal. I assume I will need to do something special so that we don't get OOS errors and will use the code we already have for how the Colonist and Pioneer add buildings.
Each animal combat will build a hierarchy of myth buildings eg Dart Frog could build "Earth Myth", "Amphibian Myth" and "Poison Myth". If the "Earth Myth" has been built then the "Amphibian Myth" would be built and so on until all the buildings have been built after which combat with Dart Frogs wont have any extra affect. This is in addition to the Kill Outcomes.
I was wondering if this were possible to do in the dll quicker.
If it is done in Python then the list of buildings would be held in Python but they would be in the XML otherwise.
<Outcome>
<OutcomeType>OUTCOME_BEAR_POWER</OutcomeType>
<iChance>5</iChance>
<PythonName>BearWithMeModule</PythonName>
<Python>
def isPossible(unit, plot):
return unit.isHuman()
def doOutcome(unit, plot, eDefPlayer, eDefUnitType):
unit.changeExperience100(1000, -1, False, False, False)
def getDisplay(unit, plot):
return u"Bear POWER"
def getAIValue(unit, plot):
return 1
</Python>
</Outcome>
I experimented a bit with direct interactions with the Python DLL.
As a result it is now possible to code outcome effects in Python and include that code right in the XML for the outcome (now means when someone next checks in the compiled DLL).