Originally posted by Pedrunn
Did you tested it, Martin?
Did you tested it, Martin?
Well and the code as posted does not work as the initialisation of the MGNumOfGovsInThisMod variable is missing. So here is the full code I hope:
Code:
int_t MGNumOfGovsInThisMod; HandleEvent(BeginTurn)'MG_Initialize'pre{ MGNumOfGovsInThisMod = 12; //In the default game. } HandleEvent(ArmyClicked)'MG_Initialize2'pre{ MGNumOfGovsInThisMod = 12; //In the default game. } HandleEvent(CityClicked)'MG_Initialize3'pre{ MGNumOfGovsInThisMod = 12; //In the default game. } int_f MG_GetPlayerGovernment(int_t thePlayer){ int_t i; int_t MGPlayer; MGPlayer = thePlayer; for(i = 0; i < MGNumOfGovsInThisMod; i = i+1){ government[0] = i; if(PlayerWorkdayExp(MGPlayer) == GovernmentDB(government[0]).WorkdayExpectation && PlayerWagesExp (MGPlayer) == GovernmentDB(government[0]).WagesExpectation && PlayerRationsExp(MGPlayer) == GovernmentDB(government[0]).RationsExpectation){ return i; } } return -1; }
Originally posted by Pedrunn
Since i see a lot of function i have never seen like PlayerWorkdayExp(MGPlayer), PlayerWagesExp (MGPlayer) and PlayerRationsExp(MGPlayer)
Since i see a lot of function i have never seen like PlayerWorkdayExp(MGPlayer), PlayerWagesExp (MGPlayer) and PlayerRationsExp(MGPlayer)
Originally posted by Pedrunn
and i did not knew we could read text flags like you did in GovernmentDB(government[0]).WorkdayExpectation GovernmentDB(government[0]).WagesExpectation
GovernmentDB(government[0]).RationsExpectation
and i did not knew we could read text flags like you did in GovernmentDB(government[0]).WorkdayExpectation GovernmentDB(government[0]).WagesExpectation
GovernmentDB(government[0]).RationsExpectation
If you like to find tons of instances open the Great_Library.txt and you will find something like this:
Code:
[WONDER_PYRAMIDS_STATISTICS] Gives: <L:DATABASE_CONCEPTS,CONCEPT_GOLD>Gold<e> increase of {WonderDB(Wonder[0]).BonusGold} Gold for Empire [END] [UNIT_CYBER_NINJA_STATISTICS] Attack: {UnitDB(UnitRecord[0]).Attack / 100} Ranged: {UnitDB(UnitRecord[0]).ZBRangeAttack} Defense: {UnitDB(UnitRecord[0]).Defense / 100} Armor: {UnitDB(UnitRecord[0]).Armor / 100} Damage: {UnitDB(UnitRecord[0]).Firepower} Vision: {UnitDB(UnitRecord[0]).VisionRange} Movement: {UnitDB(UnitRecord[0]).MaxMovePoints / 10000} Max HP: {UnitDB(UnitRecord[0]).MaxHP} Costs: {UnitDB(UnitRecord[0]).ShieldCost} Upkeep: {UnitDB(UnitRecord[0]).ShieldHunger} Shields Food Hunger: {UnitDB(UnitRecord[0]).FoodHunger} [END] [GOVERNMENT_DEMOCRACY_STATISTICS] Science Rank: {GovernmentDB(Government[0]).ScienceRank} Economic Rank: {GovernmentDB(Government[0]).GoldRank} Crime Levels: {GovernmentDB(Government[0]).CommerceRank} Military Support: {GovernmentDB(Government[0]).MilitaryRank} National Loyalty: {GovernmentDB(Government[0]).LoyaltyRank} Martial Law: {GovernmentDB(Government[0]).MartialLawRank} Anti-Pollution: {GovernmentDB(Government[0]).PollutionRank} [END] [IMPROVE_ACADEMY_PREREQ] Requires: <L:DATABASE_ADVANCES,ADVANCE_PHILOSOPHY>Philosophy<e> Cost: {BuildingDB(Building[0]).ProductionCost} <L:DATABASE_CONCEPTS,CONCEPT_PRODUCTION>Production<e> Upkeep: {BuildingDB(Building[0]).Upkeep} <L:DATABASE_CONCEPTS,CONCEPT_GOLD>Gold<e> [END]
Comment