Announcement

Collapse
No announcement yet.

SLIC Questions

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

  • SLIC Questions

    Am pondering a scenario and have some slic questions. I've looked over the slic reference material on this sight, but didn't see an obvious answer. Or at least I didn't get it.

    1. Can you determine ownership of tile improvements such as railroads when moving units. I don't want military units using enemy railroads to their advantage.

    2. Can you affect the outcome of battles based on the presence of a special unit. For example, if a special leader is present, then can you give some attack/defend bonus or detriment to the whole army.

    3. Can you add or subtract food from a city?

    4. Can you add or subtract production from a city?

    5. Can you determine what good are being traded to a city?

    6. Can you determine who owns the land? For example if my unit is within my boundaries or within enemy territory. Is that what - INT CellOwner(location) does?

    I've tried to ask questions that involve a simple yes/no answer, but any other help would be appreciated. Sorry if they are obvious and I've missed it. Thanks in advance.
    Roluce

    What profit to gain the whole world?

  • #2
    Welcome!

    Originally posted by Roluce
    1. Can you determine ownership of tile improvements such as railroads when moving units. I don't want military units using enemy railroads to their advantage.
    Yes. If you know the owner of the tile the tile imp is on, you know the owner of the tile imp. See Q6.

    2. Can you affect the outcome of battles based on the presence of a special unit. For example, if a special leader is present, then can you give some attack/defend bonus or detriment to the whole army.
    Yes. You can either replace the units in advance, ala the Alexander the Great scenario, or use the mod_* functions. Unfortunately the second category is unexplored territory but I'm fairly certain it can work...

    3. Can you add or subtract food from a city?

    4. Can you add or subtract production from a city?
    The answer to both these questions is the same: yes and no. You can't change it directly but by adding a building/wonder to the city through SLIC or by terraforming the terrain around the city you can accomplish the same result.

    5. Can you determine what good are being traded to a city?
    No clue here.

    6. Can you determine who owns the land? For example if my unit is within my boundaries or within enemy territory. Is that what - INT CellOwner(location) does?
    Yes. Yes, that's exactly what CellOwner does.

    I've tried to ask questions that involve a simple yes/no answer, but any other help would be appreciated. Sorry if they are obvious and I've missed it. Thanks in advance.
    I hope this helped. Do let us know if you need more help, we'll gladly do so. And don't worry, complicated questions don't deter us at all
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

    Comment


    • #3
      or use the mod_* functions. Unfortunately the second category is unexplored territory but I'm fairly certain it can work...
      What are the mod_* functions?
      Roluce

      What profit to gain the whole world?

      Comment


      • #4
        These functions:

        mod_CanPlayerHaveAdvance
        mod_CanCityBuildUnit
        mod_CanCityBuildBuilding
        mod_CanCityBuildWonder
        mod_CityHappiness
        mod_UnitAttack
        mod_UnitRangedAttack
        mod_UnitDefense

        We have many examples of the first few functions in action but the ones that are most interesting for you are the last 3 and we've never seen any of those in action yet. We don't even know what arguments they need and finding out might turn out to be tricky...
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • #5
          Where did the info on these come from, I didn't know of them? Are there others places to look, where up to date info on slic is found?
          Roluce

          What profit to gain the whole world?

          Comment


          • #6
            Uhmm, good question. This has been mentioned on the forums plenty of times but I'm not sure if there is any good documentation about them anywhere. I do know they're in the Excel file on my website, together with all other SLIC functions (although I'm not 100% sure if the patch function are included in that)... In any case, I'm still supposed to be working on proper (complete) documentation
            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

            Comment


            • #7
              5. No, you can't, and it bugs me no end

              The mod_* functions.
              Locutus, I actually got the attack and defense ones to load, it is just a unit_t and int_t in both cases. However, I have no idea if they have any effect. I never did a macro-scale test.

              What you can do is use the Alexander Scenario code for making units under Alexander all veterans, that will increase their performance slightly.
              Concrete, Abstract, or Squoingy?
              "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

              Comment


              • #8
                Thanks for the help. I checked out the website and found that your spreadsheet is more informative (has more stuff) than what's on apolyton in the modification section. I suppose there is a lot of experimenting going on, and some things are yet untested/unproven. I am working on an idea involving supply, and its effect on armies in the field. Keeping combat units supplied was of major importance. If supply was lost, units were practically powerless. I am interested in a ww2 scenario that includes the concept of supply. My initial idea was to create supply units which must be transported/airdropped to armies in the field (enemy territory) and then are used up as units move and fight. This would require the ability to negatively affect units if supply wasn't present or limited. And to restore that ability when supply is regained. It would seem easy to accomplish assuming I could directly change unit stats such as attack/defend. Supply would also need to be protected from enemy attacks. Does this sound like a reasonable idea? I would also need to code the ai to seek out and destroy supply units. Is this beyond the scope of reasonalbe slic? Is there anyone else trying to do this, or something like it?
                Roluce

                What profit to gain the whole world?

                Comment


                • #9
                  Originally posted by Roluce
                  Thanks for the help. I checked out the website and found that your spreadsheet is more informative (has more stuff) than what's on apolyton in the modification section.
                  Is the stuff here on Apolyton all the documentation you have? If so, you will want to have a look at this thread as well. The stuff posted by Immortal Wombat and me is the most interesting.

                  I suppose there is a lot of experimenting going on, and some things are yet untested/unproven. I am working on an idea involving supply, and its effect on armies in the field. Keeping combat units supplied was of major importance. If supply was lost, units were practically powerless. I am interested in a ww2 scenario that includes the concept of supply. My initial idea was to create supply units which must be transported/airdropped to armies in the field (enemy territory) and then are used up as units move and fight. This would require the ability to negatively affect units if supply wasn't present or limited. And to restore that ability when supply is regained. It would seem easy to accomplish assuming I could directly change unit stats such as attack/defend. Supply would also need to be protected from enemy attacks. Does this sound like a reasonable idea? I would also need to code the ai to seek out and destroy supply units. Is this beyond the scope of reasonalbe slic? Is there anyone else trying to do this, or something like it?
                  Well, I agree supply is something that's still missing from the game (from the entire genre actually), but modelling it wouldn't be easy. I think you can get very far with your idea but the hardest part would be to get the AI to deal with it: to learn AI to build, move and protect its own supplies in an intelligent manner and and to destroy the supplies of its enemies. It would probably require a combination of SLIC coding and AI file editing to accomplish this...
                  Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                  Comment


                  • #10
                    Hmmmm, I think I am going to take a stab at it. That is, if those more knowledgable will continue to field questions along the way! I know nothing of slic, but have some programming knowledge, so maybe I can bluff my way though it.
                    Roluce

                    What profit to gain the whole world?

                    Comment


                    • #11
                      Yes, if you can program already, SLIC shouldn't be too hard. It's just like C, only without the pointers
                      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                      Comment


                      • #12
                        I found slic hard to start with but then I learnt Pascal and c++ and it is easier for me now
                        "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                        The BIG MC making ctp2 a much unsafer place.
                        Visit the big mc’s website

                        Comment


                        • #13
                          Grrr, bad start. Ok, let me explain what I did, then maybe you can help me out. First, I read through some of the material on the thread you mentioned. I then created a file called "waw-myslic.slc in the folder with the other slc files. I inserted the following code which I took basically took from the thread discussion....

                          // Learning Test
                          HandleEvent(MoveUnits) 'Killtheunittest' pre {
                          KillUnit(Unit[0]);
                          }

                          I assumed that anytime a unit moved, that unit would be killed.

                          Then I went into waw_main.slc and added the a line....

                          #include "WAW_myslic.slc"

                          Then I started a waw game, and when I moved the first unit, I get the error that line 3 has an array index 0 out of bounds.

                          From what I had read, I thought Unit[0] would refer to the current unit?!?

                          Roluce

                          What profit to gain the whole world?

                          Comment


                          • #14
                            try using the kill army order may work better for you.
                            "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                            The BIG MC making ctp2 a much unsafer place.
                            Visit the big mc’s website

                            Comment


                            • #15
                              From memory, MoveUnits doesn't use unit[0] but army[0]. So you'd have to add the line GetUnitFromArmy(army[0], 0 unit[0]); to make it work...
                              Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                              Comment

                              Working...