ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Difference between revisions of "Cameo Sorting"

From ModEnc
Jump to: navigation, search
 
(Naval vehicles and aircraft never appeared on top of the ground tanks)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Cameo Sorting Order ==
+
[[Cameo]]s on the sidebar are sorted according to several factors. Whenever a cameo is added to the tab, the game iterates over all the existing cameos comparing each of them with the new cameo in turn.
  
The order in which the cameos on your sidebar are organized, is determined by these factors (Credit to ImmoMan, who posted them originally):
+
In the examples below, {{Tt|OldCameo}} stands for the cameo that was already there, {{Tt|NewCameo}} is the cameo the game is trying to insert.
  
[[TechLevel]] - increasing from top to bottom, in other words TL=0 (yes, TL=0 works just fine) at the top, TL=10 at the bottom.
+
== Superweapon Cameos ==
 +
If both OldCameo and NewCameo are Superweapons (the actual superweapons, not buildings with a SuperWeapon attached):
 +
; Compare {{f|RechargeTime|link}}
 +
: The on which recharges faster gets priority. If they're equal...
 +
; Compare their {{f|UIName|link}} strings
 +
: If, comparing alphabetically (lexicographically), OldCameo comes first, it gets priority, otherwise NewCameo does.
  
[[Cost]] - If there are two or more objects of the same TL, the cheaper one gets the priority.
+
If one of them is a SuperWeapon and the other one isn't, the SuperWeapon one gets priority.
  
[BuildingTypes] order - if two buildings of the same TL cost the same, the building that has the lower number in that list will go first.
+
== TechnoType Cameos ==
 +
; Compare {{f|AIBasePlanningSide|link}}
 +
: If one cameo's side is the same as the player house's Side, and the other one's isn't, whichever has the same side gets priority. Otherwise...
 +
; If both objects are UnitTypes or AircraftTypes
 +
: Objects without {{f|Naval|yes|link}} get priority over objects with it.
 +
: Objects without {{f|ConsideredAircraft|yes|link}} get priority over objects with it. If they're still equal...
 +
; Compare their {{f|TechLevel|link}}
 +
: Lower TechLevel wins.
 +
; Compare their {{f|Cost|link}} for player's house, taking into account all applicable cost multipliers
 +
: Lower Cost wins.
 +
; Compare their {{f|UIName|link}} strings
 +
: If OldCameo alphabetically sorts first, it wins.  
  
Now that is all what determines the cameo order for infantry/vehicle tabs. Structure/armory tabs have one extra factor:
+
[[Category:General_Editing_Information]]
 
 
[[AIBasePlanningSide]] - takes priority over all other factors. The buildings with the same AI..Side= as your country's side (Allies - 0, Soviet - 1, Yuri - 2) all go first, depending on the other beforementioned factors. The buildings with other AI..Side= go next (regardless of which side they are, only thing that matters is the side is different from yours), and then the buildings which do not have any AI..Side= set at all.
 
 
 
What this means is that when playing as Soviet and getting both Allied and Yuri tech, all the AIBasePlanningSide=1 structures (which is effectively all the soviet structures) go first, and then Allied and Yuri structures go mixed together. Very annoying.
 
 
 
I have tested what happens when I comment out the AI..Side= tags. The results:
 
*All buildings are sorted the same way infantry and vehicles are.
 
*The AI likes to build other sides' powerplants and walls.
 
 
 
So I restored the AI..Side= on all three powerplants and walls, and now:
 
*The AI works perfectly (''it obeys the Prerequisite= on buildings'' ! )
 
*The cameos are all sorted just the way I want it (all powerplants first, then all three refineries, barracks, etc..)
 
*And I still have TechLevel=s 5-10 unused. (I think I should have at least one structure of each TL, for AI triggers.)
 
 
 
 
 
I think the AI behaviour should be tested further.
 
 
 
Does anybody know what other problems arise when you remove AIBasePlanningSide= ? Besides all sides building the object ''if the Prerequisite=s are met''?
 

Latest revision as of 08:06, 5 November 2015

Cameos on the sidebar are sorted according to several factors. Whenever a cameo is added to the tab, the game iterates over all the existing cameos comparing each of them with the new cameo in turn.

In the examples below, OldCameo stands for the cameo that was already there, NewCameo is the cameo the game is trying to insert.

Superweapon Cameos

If both OldCameo and NewCameo are Superweapons (the actual superweapons, not buildings with a SuperWeapon attached):

Compare RechargeTime
The on which recharges faster gets priority. If they're equal...
Compare their UIName strings
If, comparing alphabetically (lexicographically), OldCameo comes first, it gets priority, otherwise NewCameo does.

If one of them is a SuperWeapon and the other one isn't, the SuperWeapon one gets priority.

TechnoType Cameos

Compare AIBasePlanningSide
If one cameo's side is the same as the player house's Side, and the other one's isn't, whichever has the same side gets priority. Otherwise...
If both objects are UnitTypes or AircraftTypes
Objects without Naval=yes get priority over objects with it.
Objects without ConsideredAircraft=yes get priority over objects with it. If they're still equal...
Compare their TechLevel
Lower TechLevel wins.
Compare their Cost for player's house, taking into account all applicable cost multipliers
Lower Cost wins.
Compare their UIName strings
If OldCameo alphabetically sorts first, it wins.