No announcement yet.

From SAP 2.0 to ? Just another MOD in Progress

  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by Pedrunn
    Did you tested it, Martin?
    The functions are tested and does work as advertised, the whole code has only a problem to seperate Anarchy and Tyranny as all the three values I can get with these functions are the same in the standart game.

    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:

    int_t MGNumOfGovsInThisMod;
    	MGNumOfGovsInThisMod = 12; //In the default game.
    	MGNumOfGovsInThisMod = 12; //In the default game.
    	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)
    Looks like you never used a text editor to see what is in the ctp2.exe. These functions are found in Locutus SLIC2 documentation, well he had no idea of their argument lists, but the obvious solution is the right solution.

    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
    Can we do for UniDB, TerrainDB, PersonalityBD, StrategyDB, etc...? [/QUOTE]

    If you like to find tons of instances open the Great_Library.txt and you will find something like this:

    <L:DATABASE_CONCEPTS,CONCEPT_GOLD>Gold<e> increase of {WonderDB(Wonder[0]).BonusGold} Gold  for Empire
    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}
    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}
    Cost: {BuildingDB(Building[0]).ProductionCost} <L:DATABASE_CONCEPTS,CONCEPT_PRODUCTION>Production<e>
    Upkeep: {BuildingDB(Building[0]).Upkeep} <L:DATABASE_CONCEPTS,CONCEPT_GOLD>Gold<e>
    Civ2 military advisor: "No complaints, Sir!"


    • #17
      "Kill a man and you are a murder.
      Kill thousands and you are a conquer.
      Kill all and you are a God!"
      -Jean Rostand