Logo Platform
logo amplifiers simplified

Cyclic Loop/Path Issue

Reply
Copied to clipboard!
10 years ago
Jan 4, 2015, 12:41:43 PM
Hello there,



This is targeted at EL Developers or more experienced modders. I get a cyclic loop warning about MilitaryUpkeepIntermediate and a complaint in the diagnostics log about unable to find "CurrentEra" for the following XML added to SimulationDescriptors.Class. I'm baffled as to where the cyclic loop is (the game loads fine but I'm fairly certain the calculation isn't working as intended since upkeep seems stuck at 0) unless I'm misunderstanding how the engine reads modifiers. I based it off of an example in the file (PersonalStrengthRelationIntermediate). Also there definitely is a variable CurrentEra in EmpireTypeMajor as far as I can tell. The reference method via path is the same as the other usages which have no complaints, so I'm confused as to why the log says it can't find that. Unless I'm using Path wrong (which is possible since the pdf documentation doesn't go into binary operation paths, but I did find some examples in the file)

[code]





































[/code]



Thanks!



Edit:

So I think I've narrowed it down to this line given that I replaced CurrentEra with AllUnitCount (commented out the other CurrentEra code) and it changed to complaining about AllUnitCount even though now there is an upkeep. Argh

[code]



[/code]
0Send private message
10 years ago
Jan 4, 2015, 1:20:32 PM
Are you sure that $(currentera) returns an integer? If not, that should not work.



Also maybe you can instead use a line like



$Property(ClassUnit:AttributeArmor) gt 0



to check for era , where you'll use era instead of armor. And add a simulationmodifierdescriptor for each era seperately. GT must be "greater than" while LE should be "less or equal".



Personally never used that so it could just be useless. Just trying to helpsmiley: smile
0Send private message
10 years ago
Jan 4, 2015, 1:51:21 PM
So the problem with cyclical loops and not found was due to paths being incorrect, having an extra '/' at the end of the path. My fault. Although something else still seems to be wrong logic wise since upkeep costs are 0. Hmm...

What I have so far



[code]



































[/code]
0Send private message
10 years ago
Jan 4, 2015, 4:13:16 PM
So after further thinking, I attempted to use InterpreterPrequisites in the Value field (why not try?) but that predictably didn't work. Also, I thought of using the one method that accepts a path for the value field and basically creating another variable in ClassUnit to hold that value using count. Didn't work (Invalid target name: (CurrentEraIntermediate) on object Unit#1.). I found out there is not a single example of CountSimulationModiferDescription in the Simulation folder, even though it is in the pdf. Writing based on the example in the pdf didn't work.



[code]



[/code]



So it's back to the hard way of implementing what should have been a simple formula. I've more or less made the observation that it is impossible to set a path for the value as far as I can tell. As a workaround this requires whatever is setting the value to be modified to update an extra variable reference added to ClassUnit as well (which creates duplicate memory references and makes life harder imho).



(Also, XML sucks, JSON is far superior)
0Send private message
10 years ago
Jan 5, 2015, 6:27:48 AM
So my original problem has been resolved now using workarounds. Part of the upkeep has to be calculated at the Empire level and won't show up on the unit card upkeep cost instead, but it works.
0Send private message
?

Click here to login

Reply
Comment