Announcement

Collapse
No announcement yet.

CTP1: SLIC 1.1 EXTRAS

Collapse
X
Collapse
  •  

  • CTP1: SLIC 1.1 EXTRAS

    By Winnie Lee
    June 4, 1999

    Note: This is the Developer's Corner, a part of the C:CTP section of Apolyton, where members of the C:CTP development team express their views on ctp-related topics.

    It's a wee bit lonely out here, since more than half the team's away on holidays, so I thought I'd sneak in a little bit more information on SLIC. Mind you, this is not aimed at programmers and programmer-type people - this is just a little bit of random easy stuff. It's for those who may not necessarily want to go through the whole rigmarole of writing a scenario, but would like a couple of little cool SLIC things in their games. So advanced users, don't flame me for the simplicity - this isn't for you!

    Right off the bat, I usually start by modifying the text files in ctp_data/default/gamedata. There is some documentation on how to modify text files, so I won't go into that here. Generally, the things that get changed are enabling and obsoleting advances, costs, unit movement, restrictions, government modifiers, terrain values, improvement effects, wonder effects, and a whole lot of text strings. These changes are pretty easy - as long as you keep quotes around text and keep the lines in order, these are relatively harmless changes. The only general guideline is to avoid really huge numbers (like when an order of magnitude becomes trivial), and negative numbers (unless you see other negative numbers being used).

    It's the stuff that SLIC can do that makes it a little risky. You can control almost everything in the game through SLIC, either directly or with some kind of work-around (my favourite method). MrOgre (Joe Rumsey), our illustrious programmer and SLIC guru, has posted some great documentation on using SLIC. He has also posted a lot of examples that people have asked for in the forum. I hope that this will be useful to someone out there, but more importantly, that it will generate more suggestions for things that we can add to SLIC. At the very worst, it's kind of fun to play with this stuff.

    TERRAIN

    Here's something that Joe didn't put in the SLIC documentation (ha ha, Joe, you owe me a Coke):

    Code:
     0 TERRAIN_TYPE_FOREST
     1 TERRAIN_TYPE_PLAINS
     2 TERRAIN_TYPE_TUNDRA
     3 TERRAIN_TYPE_GLACIER
     4 TERRAIN_TYPE_GRASSLAND
     5 TERRAIN_TYPE_DESERT
     6 TERRAIN_TYPE_SWAMP
     7 TERRAIN_TYPE_JUNGLE
     8 TERRAIN_TYPE_MOUNTAIN
     9 TERRAIN_TYPE_HILL
    10 TERRAIN_TYPE_WATER_SHALLOW
    11 TERRAIN_TYPE_WATER_DEEP
    12 TERRAIN_TYPE_WATER_VOLCANO
    13 TERRAIN_TYPE_SPACE
    14 TERRAIN_TYPE_WATER_BEACH
    15 TERRAIN_TYPE_WATER_SHELF
    16 TERRAIN_TYPE_WATER_TRENCH
    17 TERRAIN_TYPE_WATER_RIFT
    18 TERRAIN_TYPE_DEAD
    19 TERRAIN_TYPE_BROWN_HILL
    20 TERRAIN_TYPE_BROWN_MOUNTAIN
    21 TERRAIN_TYPE_WHITE_HILL
    22 TERRAIN_TYPE_WHITE_MOUNTAIN
    23 TERRAIN_TYPE_DEAD_HILL

    The number preceding each terrain type is the terrain index. The terrain index can be used for nifty little tricks like this:

    Code:
    Trigger 'ChangeTerrainToGlacier' when (unit.moved && unit.type == UnitType("UNIT_ABOLITIONIST")) {
    	Terraform(unit.location, 3);
    	//terrain index 3 is glacier
    }

    The abolitionist, being the frosty female that she is, will turn every tile she steps on into glacier. You can use the Terraform(location, terrain_index) function with the PlantGood(location) function too - for example, if you want to make the Cyber Ninja a fertility goddess instead of the Ice Queen, -

    Code:
    Trigger 'ChangeTerrainAndAddGoods' when (unit.moved && unit.type == UnitType("UNIT_CYBER_NINJA")) {
    	Terrform(unit.location, 4);
    	//terrain index 4 is grassland	
    	PlantGood(unit.location);
    	//after the terrain has terraformed, plant a good there
    }

    - Which will turn every tile the Cyber Ninja steps on into grassland, and then plant tobacco or poppies on the same tile.

    Here's another thing you can do:

    Code:
    TypeLocation last_tile_unit_was_on;
    Trigger 'GetLastLocation' when (g.player == 1 && unit.moved && unit.type == UnitType("UNIT_SETTLER")) {
    	DisableTrigger('GetLastLocation');
    	//only run this trigger once
    	ExtractLocation(unit.location, last_tile_unit_was_on);
    	//get the very first tile that the settler moved to
    	year_start = 1;
    	//start counting turns
    }
    Code:
    Trigger 'InitTurn' when (g.player == 1) {
    	If(year_start) {
    		Year_start = year_start + 1;
    		//when the unit moves, start incrementing the turns
    	}
    	If(year_start == 6) {
    		Terraform(last_tile_unit_was_on, 3);
    		//when 5 turns have passed, turn that tile into glacier	
    	}
    }

    So the very first tile that the settler moves to is saved as last_tile_unit_was_on. Five turns later, that tile turns into glacier.

    BTW, if you just want to see these triggers work, cut and paste them into script.slc (make a backup copy before doing so!!!), start a new game, and cheat yourself an Abolitionist or a Cyber Ninja, then move them around. However, this is my little cheaty way to see things in a hurry. The right way to do this is to put the triggers in a file called scenario.slc, and place it in the directory with the saved game like this:

    ctp_program/ctp/save/game/folder_with_saved_game/default/gamedata/scenario.slc

    That way, it will only happen when you load a saved game from that folder. Otherwise, if you leave the triggers in script.slc, it will happen in every game.

    You may want to think twice about changing land into water or vice versa, because it may not work the way you thought it would. Why? Well, let's say you have a single tile island. Eight beach tiles surround that single tile. Those 8 beach tiles are themselves surrounded by 16 trench or shelf tiles. Trench and rift tiles are surrounded by deep water - 24, to be exact. Changing any of these tiles to land requires that you also change its surrounding tiles for a smooth transition.

    One more thing: TERRAIN_TYPE_DEAD_HILL doesn't exist, so don't use 23 as the terrain index - it'll give you a black hole that can be traveled like any other tile, but like dead tiles, has no production, food, or gold. Of course, you can change all this in terrain.txt, which would allow you to have a black tile with whatever gold, production, food, or movement that you choose. [Just thought I'd let you know.]

    CUSTOMISING C:CTP

    Here are a couple of ways to customise the way the game works. Let's say you want to have the diplomacy screen open when you click on a foreign unit. You could do:

    Code:
    Trigger 'OpenDiplomacyScreen' when (g.player == 1 && clicked.unit && unit.owner != 1) {
    	OpenDiplomacy();
    }

    This is only useful in single player games, where the human player is player 1. I like this option, but only when I'm not playing bloodlust on.

    You could also use a sound cue to tell you which units are yours and which ones are not:

    Code:
    Trigger 'PlayUnitSound' when (g.player == 1 && clicked.unit) {
    	If(unit.owner != 1) {
    		PlaySound("SOUND_ID_GIANT_SQUID");
    	}
    }

    If you click on units that are not yours, you will hear the squid sound. You can also add sounds of your own (units that are not mine say, "Bite me"). To do this, you need to do 2 things: first, copy the .wav files into ctp_data/default/sound, then open up sounds.txt located in ctp_data/default/gamedata. There is the number "1048" at the top - the total number of sounds. If you're adding one new sound, change the number to "1049". Give the sound an ID - like "SOUND_ID_BITE_ME". In quotes, put the .wav file name: "bite_me.wav". So your sounds.txt file should look something like this:

    Code:
    #sounds.txt (SoundDB)
    1049
    #
    SOUND_ID_BITE_ME		"bite_me.wav"
    #
    SOUND_ID_NONE			" "
    Etc.

    Again, and I can not stress this enough, MAKE A BACKUP COPY OF ALL THE FILES YOU PLAN TO CHANGE BEFORE CHANGING ANYTHING!

      Posting comments is disabled.

    Latest Articles

    Collapse

    • CTP1: STRATEGY TIPS FOR THE ADVANCED PLAYER II
      by Martin Gühmann

      By Brad Santos
      June 23, 1999

      Note: This is the Developer's Corner, a part of the C:CTP section of Apolyton, where members of the C:CTP development team discuss ctp-related topics.

      For many first time players of Civilization: Call to Power, the sound of sinister cackling as an unseen Slaver kidnaps another citizen from an unsuspecting city is enough to cause an anxiety attack. The reason for this strong emotional reaction is simple… Along with the addition of a 1000 year Science Fiction game era and a completely new stacked combat system, the introduction of Special Units is one of the most fundamental differences between CTP and its mighty predecessor, Civ2. Players who stayed up playing Civ2 for hundreds of hours in the dead of night are now forced to learn the basics of unconventional warfare under a new game system. Players may feel like Arnold Schwarzeneggar in Predator, facing an invisible enemy of unknown capabilities. That can be intimidating.

      Don't worry. Change is good. As Arny pointed out in the same movie, "if it bleeds (you) can kill it". Once you get familiar with the Special Units you will learn to love them all like little computer sprite brothers….or you will never conquer the world again!

      ...
      April 23, 2012, 17:18
    • CTP1: DESIGNING GOOD MULTIPLAYER MAPS
      by Martin Gühmann

      By Brad Santos
      June 10, 1999

      Note: This is the Developer's Corner, a part of the C:CTP section of Apolyton, where members of the C:CTP development team discuss ctp-related topics.

      In the stillness of an ancient morning, the oar driven ships of a mighty war-fleet drive across heaving channel seas to scrape against the sands of a foreign shore. Wooden ramps crash down into foaming surf. The clatter of hooves and the ringing of iron fills the air as your invasion force thunders ashore.

      Your army looks magnificent: Cavalry and Archers arrayed in stacks of nine. Samurai and Pikeman eager to storm the enemy's walled cities. You can already taste victory… picture the face of your mysterious internet opponent as your sandaled foot crashes down on his hopes of world conquest….

      ...
      April 23, 2012, 17:09
    • CTP1: SLIC 1.1 EXTRAS
      by Martin Gühmann

      By Winnie Lee
      June 4, 1999

      Note: This is the Developer's Corner, a part of the C:CTP section of Apolyton, where members of the C:CTP development team express their views on ctp-related topics.

      It's a wee bit lonely out here, since more than half the team's away on holidays, so I thought I'd sneak in a little bit more information on SLIC. Mind you, this is not aimed at programmers and programmer-type people - this is just a little bit of random easy stuff. It's for those who may not necessarily want to go through the whole rigmarole of writing a scenario, but would like a couple of little cool SLIC things in their games. So advanced users, don't flame me for the simplicity - this isn't for you!

      ...
      April 23, 2012, 17:02
    • CTP1: THE 36 CHAMBERS OF DR. NO
      by Martin Gühmann

      By Brad Santos (a.k.a Dr. No)
      May 27, 1999

      Note: This is the Developer's Corner, a part of the C:CTP section of Apolyton, where members of the C:CTP development team express their views on ctp-related topics.

      Turn 472. The World teeters on the brink of another catastrophic war.…

      Turkish Fusion Tanks are massing along your Southern Border. The ominous sound of descending Space fighters fills the air as the powerful Egyptian technocrat makes yet another outrageous demand. Your depleted treasury can't afford to foot the bill for an Alien Life Project, let alone a two-front war. Then, just as things are starting to look really bad, the Ozone layer gives way and you are forced to watch in stunned horror as the gleaming towers of your capitol city disappear beneath the waves of a titanic flood.

      ...
      April 23, 2012, 16:49
    • CTP1: THE VALUE OF SCHOOL-FOLLOW UP by WW
      by Martin Gühmann

      By William Westwater
      May 20, 1999

      Note: A discussion on the recent column by William Westwater begun on our forums. WW in response posted an example with numbers. We post it here, along with Celestial Dawn's reply.

      Main Article
      Follow up by CD

      Let’s consider a concrete examples:
      Civilization:
      Rations 7.5 per pop
      Happiness: 75
      Crime: 10%
      Science contribution: 50%

      City 1:
      Pop 5. Pop are currently on:
      Forest 20 P, 5 F
      Forest 20 P, 5 F
      Shallow with Net 10 P 20 F, 5 G
      Shallow with Net 10 P 20 F, 5 G
      Shallow with Net 10 P 20 F, 5 G
      Total: 70 P, 70 F, 15 G
      Total after crime: 63.5 P, 63.5, F, 13.5 G
      Food Eaten: 22.5 F

      Should I build a marketplace, marketplace with merchant, an academy, or an academy with scientist if I want science?

      ...
      April 21, 2012, 17:00
    • CTP1: THE VALUE OF SCHOOL-FOLLOW UP by CD
      by Celestial_Dawn

      By Celestial_Dawn
      May 20, 1999

      Note: A discussion on the recent column by William Westwater begun on our forums. WW in response posted an example with numbers. We post it here, along with Celestial Dawn's reply.

      Main Article
      Follow up by WW

      Mr Westwater

      Section I - Your initial Assumptions

      I'm afraid that your concrete example isn't quite concrete.

      ...
      April 21, 2012, 16:51
    Working...
    X