Announcement

Collapse
No announcement yet.

From SAP 2.0 to ? Just another MOD in Progress

Collapse
X
 
  • 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:

    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)
    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
    GovernmentDB(government[0]).RationsExpectation
    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:

    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]
    -Martin
    Civ2 military advisor: "No complaints, Sir!"

    Comment


    • #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

      Comment

      Working...
      X