ENDLESS™ Legend is a turn-based 4X fantasy-strategy game, where you control every aspect of your civilization as you struggle to save your homeworld Auriga. Create your own Legend!
From looking at the various code examples, interpreterprerequisites seem like the only way I might be able to make it work.
It seems that the Quests basically use an "if" statement. If this condition is true then apply these values.
I was hoping I could do something similar to this:
Example code from Quest Definitions [FromInteract]
[code]
.../ClassEmpire,AffinityBrokenLords
$MaxProperty(EmpireTypeMajor/ClassCity:Population) ge 6
$MaxProperty(EmpireTypeMajor/ClassCity:Population) ge 8
...
[/code]
Where I would do something like
[code]
InterpreterPrerequisite Flags="Prerequisite">$MaxProperty(EmpireTypeMajor/ClassCity:Population) ge $MaxProperty(EmpireTypeMajor/ClassCity:CMGarrisonCount
Indeed, interpreter prerequisite can be seen as an "if" because in the quests it is used to check some specific situations. If the condition is ok and it ends the step a reward can be given. But this is very specific to the quest.
There is no way to apply something directly after an interpreter prerequisite through xml :/
Pikou wrote: Indeed, interpreter prerequisite can be seen as an "if" because in the quests it is used to check some specific situations. If the condition is ok and it ends the step a reward can be given. But this is very specific to the quest.
There is no way to apply something directly after an interpreter prerequisite through xml :/
Could you have a "fake quest" that didn't have any GUI elements, and activated for each city every turn? If the condition was true the city gets an approval bonus?
So you cant make quest that affect anything below empire level?
There were a few ideas i had hoped to try at some point... (ie: Boost a cities production of a resource for a set of turns, Completing a current production item on a city, make a city immune to siege negative effects for a period, etc)
Pretty disappointing that you cant implement anything beyond simple addition/subtraction/multiplication/division as well. Was really interested in making the approval thing work out and doing alot of testing on it.
The only other thought i had was- could you basically skip the Quest->City interaction by introducing new variables at the Empire Level?
Could you create an array on the empire level that pulled info from the city level (ie, each cities approval ratings) at each turn end? This array could interact with the quest at the beginning of each turn and store information in another array at the empire level. Then each city would modify approval ratings based on the new array.
How do the quests that check for district level upgrades work from the empire level?
Well... As you have already discover we does not give you a whole coding framework to work with...
Indeed, quest can be used to make some sort of programming. Like you said, if you use wisely the prerequisites and the quest action you could do some sort of interactivity.
Basically Quest are designed to work on an empire. It is not owned by the object which triggered it, but by the empire which own the object. That does not means that you cannot target a specific city inside the quest.
The available actions are indeed limited by what our designers asked us to give them (and by how much time we have to invest in the quest system too...). As for now, there is no action in the quest framework which is able to activate a booster, give a building to a city or simply boost some resource gain on a defined city. But it does not mean that we cannot do it...
Now back at what you want to create.
If I understand correctly the idea is:
-> Check that a defined condition is respected on a city and then boost the "Approval" of the defined city.
Well, when I read that I want to say: "Yes sure you can"... but unfortunately forcing the activation of a booster on a targeted city in a quest is not currently possible. The only thing I can think of for now is giving some "Luxury" which allow the approval to be increased when the player will activate the luxury booster.
I will talk with Pikou about it and we will try to include this our overtime work as I am kind of baffled we didn't already implement it^^. It should not be too difficult to do and will increase the possibilities of the quest system.
We'll keep you informed about the status of the new action.
Thanks for sharing your thoughts and taking the time to do stuff with our game!!! it is always rewarding to see people pushing our system a little further ^^
By the way, Pikou just forwarded me your PM. I will look into it and try to write you an answer about a solution (or at least I hope I can find one ^^).
Here is a short description of what you want to do, so other people can understand the whole thing.
The idea is to modify the approval of a city based on the population and the number of unit in the garrison.
Here is the formula you come with:
[CODE]
=IF ((POPCOUNT-1)-POLICECOUNT)<1)
THEN
ApprovalBonus = (15*(POPCOUNT-1))-(POPCOUNT*7.5)
ELSE
ApprovalBonus = (15*POLICECOUNT)-(POPCOUNT*7.5)) where POPCOUNT is capped at 14 and POLICECOUNT is capped at 8.
[/CODE]
The police count is the number of units in the garrison.
Here is my solution which is basically what you have done with one or two modifications.
[Code]
In the file: SimulationDescriptors[Class].xml
Add these lines in the SimulationDescriptor named ClassCity between the xml tag "SimulationPropertyDescriptors".
Add these lines int he SimulationDescriptor named ClassCity between the xml tag "SimulationModifierDescriptors"
[/Code]
Remarks:
- I have skipped all the paths because we are always working on the city so no need to use them. You can put them in if you want to be fully explicit.
- I have added the UnitSlotCount property on the city to avoid error when other part of the code use the city class descriptor only (for economic projection we don't need the garrison part normally...)
1) When garrisoning units, if the units move an approval state (say from strike to happy), the bar doesn't change colors or the text update until I advance turns. I assume this is because its part of the endturn calculations... any way I can make it update midturn?
2) I want to decrease the upkeep cost of units in garrison without decreasing the upkeep cost of units outside of garrisons. Any suggestions?
1) Well. that's the problem with approval. It's not possible to compute the whole approval stuff in the simulation so we have to launch an algorithm every time the Approval value change.
Apparently, we have not bound the approval computation on the modification of the number of unit in the garrison. I'll see if I can do something about that for a futur patch.
2) Yep easily. You can:
-> Add a modifier on the city class descriptor which reduce the upkeep of all the unit under the city with the path : ClassCity/ClassUnit
-> Add a modifier on the empire class which reduce the upkeep of all the unit under all the city with the path : ClassEmpire/ClassCity/ClassUnit
-> Same with an improvement : ../ClassCity/ClassUnit
I have a bigger issue unfortunately. The update broke my mod (or made it give a weird bug).
Mod worked fine. When game updated i copied all the new files and made the same changes to them.
I used a file comparator to make sure the files were exactly the same except for my line additions.
The issue occurs with Broken Lords. You cant increase population (gold is spent but population stays at one).
The normal game works fine, but loading the mod doesnt.
I have narrowed down the culprit to be the Simulation[Class] file (it works when replaced with normal one).
So i redid the Simulation[Class] file. I started with the standard file and added the below lines to it... and again it broke the BL population increase.
...and unfortunately i dont have the un-updated Simulation[Class] file to compare against.
Caotico09
Newcomer
Caotico09
Newcomer
100g2g ptsReport comment
Why do you report Caotico09?
Are you sure you want to block Caotico09 ?
BlockCancelAre you sure you want to unblock Caotico09 ?
UnblockCancelDEVPikou
Dev
DEVPikou
Dev
19 600g2g ptsReport comment
Why do you report Pikou?
Are you sure you want to block Pikou ?
BlockCancelAre you sure you want to unblock Pikou ?
UnblockCancelCaotico09
Newcomer
Caotico09
Newcomer
100g2g ptsReport comment
Why do you report Caotico09?
Are you sure you want to block Caotico09 ?
BlockCancelAre you sure you want to unblock Caotico09 ?
UnblockCancelDEVPikou
Dev
DEVPikou
Dev
19 600g2g ptsReport comment
Why do you report Pikou?
Are you sure you want to block Pikou ?
BlockCancelAre you sure you want to unblock Pikou ?
UnblockCancelCaotico09
Newcomer
Caotico09
Newcomer
100g2g ptsReport comment
Why do you report Caotico09?
Are you sure you want to block Caotico09 ?
BlockCancelAre you sure you want to unblock Caotico09 ?
UnblockCancelDEVPikou
Dev
DEVPikou
Dev
19 600g2g ptsReport comment
Why do you report Pikou?
Are you sure you want to block Pikou ?
BlockCancelAre you sure you want to unblock Pikou ?
UnblockCancelCaotico09
Newcomer
Caotico09
Newcomer
100g2g ptsReport comment
Why do you report Caotico09?
Are you sure you want to block Caotico09 ?
BlockCancelAre you sure you want to unblock Caotico09 ?
UnblockCancelDEVThorTillas
Dev
Florian - Lead programmer on Humankind
DEVThorTillas
Dev
30 200g2g ptsReport comment
Why do you report ThorTillas?
Are you sure you want to block ThorTillas ?
BlockCancelAre you sure you want to unblock ThorTillas ?
UnblockCancelDEVThorTillas
Dev
Florian - Lead programmer on Humankind
DEVThorTillas
Dev
30 200g2g ptsReport comment
Why do you report ThorTillas?
Are you sure you want to block ThorTillas ?
BlockCancelAre you sure you want to unblock ThorTillas ?
UnblockCancelDEVThorTillas
Dev
Florian - Lead programmer on Humankind
DEVThorTillas
Dev
30 200g2g ptsReport comment
Why do you report ThorTillas?
Are you sure you want to block ThorTillas ?
BlockCancelAre you sure you want to unblock ThorTillas ?
UnblockCancelCaotico09
Newcomer
Caotico09
Newcomer
100g2g ptsReport comment
Why do you report Caotico09?
Are you sure you want to block Caotico09 ?
BlockCancelAre you sure you want to unblock Caotico09 ?
UnblockCancelElucidus
Newcomer
Elucidus
Newcomer
6 000g2g ptsReport comment
Why do you report Elucidus?
Are you sure you want to block Elucidus ?
BlockCancelAre you sure you want to unblock Elucidus ?
UnblockCancelCaotico09
Newcomer
Caotico09
Newcomer
100g2g ptsReport comment
Why do you report Caotico09?
Are you sure you want to block Caotico09 ?
BlockCancelAre you sure you want to unblock Caotico09 ?
UnblockCancelDEVThorTillas
Dev
Florian - Lead programmer on Humankind
DEVThorTillas
Dev
30 200g2g ptsReport comment
Why do you report ThorTillas?
Are you sure you want to block ThorTillas ?
BlockCancelAre you sure you want to unblock ThorTillas ?
UnblockCancelCaotico09
Newcomer
Caotico09
Newcomer
100g2g ptsReport comment
Why do you report Caotico09?
Are you sure you want to block Caotico09 ?
BlockCancelAre you sure you want to unblock Caotico09 ?
UnblockCancelDEVThorTillas
Dev
Florian - Lead programmer on Humankind
DEVThorTillas
Dev
30 200g2g ptsReport comment
Why do you report ThorTillas?
Are you sure you want to block ThorTillas ?
BlockCancelAre you sure you want to unblock ThorTillas ?
UnblockCancel