Logo Platform
logo amplifiers simplified

A few Questions

Reply
Copied to clipboard!
9 years ago
Aug 12, 2015, 11:01:42 AM
Hello.



1) $(HeroLevel)



I would like to make a City Improvement that gives enhancements depending on the level of the hero governing the city.



Is it possible to access the HeroLevel from CityImprovements, so that a calculation like the one for the administrator tomes can be used for City Improvements.







2) Unique Items



There is a command to show the unique text:





So it must be possible to create unique items. I tried the following with partially success:



../EmpireTypeMajor/ClassArmy/ClassUnit/ItemAttributesX

../EmpireTypeMajor/Garrison/ClassUnit/ItemAttributesX



If the item is equipped by a hero leading an army or administrating a city everything works fine. Other heroes can't equip the item.

But if the item is equipped by a hero without duty (stationed in the academy pool), other heroes are able to equip the item.



How do I access the academy heroes to make sure they too doesn't have equiped the item?

Or is there a differnet way to make items unique?
0Send private message
9 years ago
Aug 12, 2015, 12:43:08 PM
Those are some very good questions. Accessing the heroes in te academy could be useful for all manner of bonuses and effects.



Regarding the first question, I believe you can not directly get the value from the hero. You may be able to work with an intermediate value, though.



Checking the way Redsang works, it accesses the hero under the path "./EmpireTypeMajor/Garrison/UnitRankHero", so it might be possible that your city improvement has a descriptor like this







while defining an intermediate value of "CityImprovementBonus" for heroes/units in SimulationDescriptors[Class].xml, and adding







to the hero.

I am not sure if that will work, though.
0Send private message
9 years ago
Aug 12, 2015, 4:00:46 PM
Thank you for the quick answer.



The-Cat-o-Nine-Tales wrote:
Checking the way Redsang works, it accesses the hero under the path "./EmpireTypeMajor/Garrison/UnitRankHero".




Very inspiring. This is the solution to question 2.

With the following flags, an hero-only-item will be allowed to only be equiped once:



../EmpireTypeMajor/UnitRankHero/AttributesX

../EmpireTypeMajor/Garrison/UnitRankHero/AttributesX



So, EmpireTypeMajor/Garrison/ could be the way to access the heroes in the academy. Needs further checks.



A few questions to your solution for problem #1:





The-Cat-o-Nine-Tales wrote:
while defining an intermediate value of "CityImprovementBonus" for heroes/units in SimulationDescriptors[Class].xml


What should be the exact definition entry?



The-Cat-o-Nine-Tales wrote:
and adding to the hero.


Where should this be added?
0Send private message
9 years ago
Aug 12, 2015, 9:16:23 PM
No, as far as I can tell, the "garrison" path is used to access heroes assigned as governors and as army leaders. A Governor counts as part of the cities garrison, and the xml files often refer to "ClassArmy/ClassGarrison" when applying unit bonuses. "ClassGarrison/UnitRankHero" specifies that is should only apply to heroes, not ordinary units.

Sadly, I haven't found any references to the academy yet other than a few references to number of exclusive heroes on the marketplace.



To elaborate on the solution to problem 1, though:

In the file SimulationDescriptors[Class].xml, under the Name="ClassUnit" section, you should add to the SimulationPropertyDescriptors, and you could add the BinarySimulationModifierDescriptor to the SimulationModifierDescriptors of the ClassUnit section.

That would mean that all units could potentially apply a bonus while garrisoned. However, since our building would specify "./ClassCity/Garrison/UnitRankHero" as a path, it should only increase the "CityImprovementBonus" value of the hero, leaving the other units without effect.



Of course, you could also add multiple different ImprovementBonus properties in order to have different improvements give different bonuses.

I can not guarantee this will work, though, as I haven't tried creating such an improvement yet, and I am not sure if the "HeroLevel" reference might break the game because ordinary units do not have such a property. If that does happen, you could move the BinaryModifier into the SimulationDescriptors[UnitRank].xml file.



Good luck with your modding.
0Send private message
9 years ago
Aug 14, 2015, 3:41:51 PM
Hello,



Some answers below:



Heroes in the academy are in the simulation under the following path > ClassEmpire/ClassUnit,UnitRankHero.

If you want to check they have the item equipped in order to disable the equipement for others you will have to add ClassEmpire/ClassUnit,UnitRankHero/ItemX

I confirm you 2 first path seem correct smiley: smile



For the city improvement I don't see any reason why your modifier could not work.

Did you try to implement it?

If it does not work I will take time to investigate.



Don't hesitate to ask if you have any other question.

Cheers,
0Send private message
9 years ago
Aug 17, 2015, 9:48:14 PM
Hallo,



eventually I was free to test your suggested solution.



It worked lol, but only with a few changes.



1) It seems impossible to access the Hero's level from "ClassUnit".

But it is possible from "UnitRankHero"



2) To access "CityImprovementBonus" in section "ClassUnit" the path in the CityImprovement-Descriptor have to be

Path="./ClassCity/UnitHero" not "./ClassCity/Garrison/UnitRankHero"



FINAL SOLUTION (veryfied)



1) new variable in SimulationDescriptors[Class].xml section ClassUnit





2) new modifier for Hero's only in SimulationDescriptors[UnitRank].xml section UnitRankHero





3) modify "CityImprovementBonus" from Improvements like





Now with a working solution I will check a few ideas to optimize it. Maybe it is possible to create an entry in ClassCity called "GovernorLevel". Then it will be easy to access the Hero's level from Improvements etc. without an additional entry in UnitRankHero.



Many thanks for your help in solving the problem.
0Send private message
9 years ago
Aug 18, 2015, 3:05:12 PM
1) That's weird. Two descriptors are present in simulation though.

A new mystery is adding itself to the list.

I will ask about this one though...



2) I should have better explained but ClassCity and Garrison are at the same level. No need for "/" between them.



My pleasure!

I will continue to help modders as much as I can so feel free to ask anything smiley: biggrin
0Send private message
9 years ago
Aug 19, 2015, 1:09:04 AM
Hello.



Pikou wrote:
2) I should have better explained but ClassCity and Garrison are at the same level. No need for "/" between them.
Good to know.



BTW I found constructs like $Property(EmpireTypeMajor/ClassResearch:TechnologyCost).

So I ask myself if it would be possible to use this form of reference in to acces the value of any desired attribute.



But it seems that this constructs are limited to

and



Has anyone more information about this?
0Send private message
9 years ago
Aug 21, 2015, 10:08:41 AM
Formulas like $Property, $Count or $"Anything" only work inside interpreter for cost or prerequisite.

You won't be able to use them inside modifier descriptors.

I will ask a programmer to correct me if I'm wrong though...
0Send private message
?

Click here to login

Reply
Comment