Announcement

Collapse
No announcement yet.

Wanna share your SLIC functions?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wanna share your SLIC functions?

    Here is one simple SLIC that I have created to give a free Nuke unit in the capitol city upon discovery of Quantum Physics.

    Code:
    TypeLocation human_player_capitol;
    
    Trigger 'NewNuke' when (discovery.type && IsHumanPlayer(player.1) && HasAdvance(player.1, ID_ADVANCE_QUANTUM_MECHANICS)) {
      ExtractLocation(player.capitol, human_player_capitol);
      CreateUnit(player.1, UnitType("UNIT_NUKE"), human_player_capitol, 0);
      DisableTrigger('NewNuke');
    }
    I later found that after discovering the advance and you saved the game to play in future, the trigger activated again upon the next discovery. So I added another trigger to solve the problem.

    Code:
    Trigger 'CheckAdvances' when (IsHumanPlayer(g.player) && HasAdvance(g.player, ID_ADVANCE_QUANTUM_MECHANICS)) {
      DisableTrigger('NewNuke');
    }
    Hope these is of benefit to you people.


    [This message has been edited by Dreamer (edited January 02, 2000).]

  • #2
    Hi, Dreamer. This is great idea--I have limited knowledge of Slic, so I have basically nothing to share, but I was thinking the other day how nice it would be if there was a thread where many Slic functions could be posted, instead of being so scattered through various threads...
    I'll dig around later and post some stuff I've seen around.

    Later.
    Existence is Futile.

    Comment


    • #3
      Just in case those who are using the above mentioned slic function as an example to create naval units, you need to put the created units 1 tile square away from your capitol city.
      Code:
      // Example :-
      CreateUnit(player.1, UnitType("UNIT_AIRCRAFT_CARRIER"), human_player_capitol, 1);
      If your capitol is on land and not a coastal city, sorry you'll not get any units create cos the function treat the city location as a land terrian.

      I'll be looking into future enhancement to these soon.

      [This message has been edited by Dreamer (edited January 02, 2000).]

      Comment


      • #4
        I am also looking into creating guerrilla units around city upon captured by enemy just like Civ2 did. Anyone wanna share some thoughts on this?

        Pls refer this topic to :- http://apolyton.net/forums/Forum11/H...tml?date=03:03

        [This message has been edited by Dreamer (edited January 05, 2000).]

        Comment


        • #5
          He great idea to post all kinds of loose SLIC functions in one thread. I'll add anything I have made so far as soon as I find the time.
          Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

          Comment


          • #6
            I seem to recall that Dutcheese's trigger to add muskateers was posted on these forums somewhere, could somebody repost it, or post which forum and thread, or tell me where to find it in the scenario pack?

            I believe I've solved the ai empty city problem! I plan to add a unit (town guard) and have one built each time a city is built. These units will have a movement of 0 (how easy was that)! I plan to have reasonable versions of the units for different time periods.

            Now somewhere in ctp is the flag that allows a unit to fortify, and I don't mean the "can_entrench" flag in unit.txt. Somewhere in SLIC is the flag that actually does the entrenching, and I'd like to do that with these units upon creation. Any guesses where to look?

            I don't see any need to add these to the ai build lists since 1 per city is all there should be (later ages will have a weak range unit too). The only possible problem I see is a conflict with the unit_gather code, will the ai count these units if they aren't in the build lists? This could be fixed (if it is a problem) by adjusting the gather code. Maybe somebody already knows? If anyone has any other suggestions or sees any other possible conflicts, please chime in!
            Mark

            Comment


            • #7
              Mark,

              To give units orders in SLIC you can use the functions SetOrder and AddOrder and I think you can find the available orders in in orders.txt in the ctp_data\default\gamedata directory. The orders there are a bit obscure sometimes, so I don't know exactly which order you need, you might need to experiment a little. Let me know if/when you get it to work.

              BTW, I don't know what function of Dutcheese you are referring to, could you tell me what it is supposed to do exactly?
              Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

              Comment


              • #8
                The Dutcheese mod adds a phalanx to every city built before turn 4 (should be easily converted). I looked thru all the files included with the mod but saw no triggers. The Quicker Mod is similar but adds muskateers and city growth, couldn't find it there either.
                Mark

                Comment


                • #9
                  There are some errors:
                  Dutcheese mod add 2 musketters
                  Soph mod add 1 phalanx.
                  I write (again) using triggers some quick mod for pbem. Take a look on http://slaamp.virtualave.net/ctp/
                  If you want I can publish here the triggers.
                  Apolyton QuickStart for CTP PBEM

                  Comment


                  • #10
                    Well, I found the trigger you were referring to, Mark. I found it in the file dutcheesescenariopak7.2.zip. Unzipped, it should have been placed in the directory scenarios\dutcheese\scen0001\default\gamedata and the file should have been called script.slc.
                    Well, here's the trigger, copied straight from the file:

                    Code:
                    trigger 'MakeCities' when (city.built && (g.year <= 3) && (player.cities <= 10)) {
                    //add improvements
                    AddPops(city.1,4);
                    CreateUnit(player,UnitType("UNIT_MUSKETEERS"),city.1.location,0);
                    CreateUnit(player,UnitType("UNIT_MUSKETEERS"),city.1.location,0);
                    //CreateUnit(player,UnitType("UNIT_MUSKETEERS"),city.1.location,1);
                    //CreateUnit(player,UnitType("UNIT_MUSKETEERS"),city.1.location,1);
                    //AddBuildingToBuildList(city,Silo);
                    }
                    It looks really ugly like this, so I'll clean it up a little:

                    Code:
                    trigger 'MakeCities' when (city.built && (g.year <= 3) && (player.cities <= 10)) {
                       AddPops(city.1,4);
                       CreateUnit(player,UnitType ("UNIT_MUSKETEERS"),city.1.location,0);
                       CreateUnit(player,UnitType("UNIT_MUSKETEERS"),city.1.location,0);
                    }
                    Dreamer,
                    I like your idea of guerrilla-units. It should be fairly simple to implement.

                    Locutus
                    [This message has been edited by Locutus (edited January 03, 2000).]
                    [This message has been edited by Locutus (edited January 03, 2000).]
                    [This message has been edited by Locutus (edited January 03, 2000).]
                    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                    Comment


                    • #11
                      This guerrilla unit trigger sounds good to me, as well. Will unit placement depend upon surrounding terrain, like in civ 2?

                      Comment


                      • #12
                        Glad to hear you guys like the idea, but I'm having problems. I wanna use the city.capture as a trigger but it doesn't passes any value that SLIC is unable to determine whose city it belong to before capture so as to create the guerrilla units belonging to the previous city owner. Help!!!

                        My idea is to place the units 2 tiles square away from city to prevent immediate killing by enemy units in city.

                        Pls refer this topic at :- http://apolyton.net/forums/Forum11/H...tml?date=03:03

                        Yes WesW, in CTP the terrian does affect the placement of units. If the city are surrounded all by sea then guerrilla units will not apply to it, unless our SLIC perform a check on the city surrounding and create sea units instead.

                        [This message has been edited by Dreamer (edited January 05, 2000).]

                        Comment


                        • #13
                          Thanks guys! Saved me a bunch of time, really appreciated. Now I have to check out
                          these movable units with 0 movement (ack!).

                          Just a thought here, why not make the guerilla
                          units barbarians? Realistically they shouldn't be as
                          easily controlled as "regular units" (IMHO).
                          Mark

                          [This message has been edited by Mark H (edited January 04, 2000).]

                          Comment


                          • #14
                            hmm...barbarian. Maybe Skorpion59 can help me find out what the player index is for barbarian player?

                            Pls refer this topic to :- http://apolyton.net/forums/Forum11/H...tml?date=03:03

                            [This message has been edited by Dreamer (edited January 05, 2000).]

                            Comment


                            • #15
                              I agree with starting new threads so answers are there.

                              Don
                              Don,
                              CtPMaps (Hosted by Apolyton)

                              Comment

                              Working...
                              X