Announcement

Collapse
No announcement yet.

setting alliances

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

  • setting alliances

    Does anyone know how to set an alliance at the beginning of a scenario? I know there has to be a way to set regard/pacts/alliances through slic. If someone could just show me how to do it with one nation I can probably handle the rest just fine.

  • #2
    You can check diplmacy.slc, it has some examples.

    There is (i think)
    SetRegard
    LogRegardEvent and other
    Get the excel spreadsheet from Locutus' website. Dont know where it is, see his profile

    Comment


    • #3
      Also check out the slic code from WW2 scenario. It has a section where it sets the level of hate and trust for the allies and germans.

      Rich

      Comment


      • #4
        Harlan uses a non-SLIC way of doing this that may be easier: temporary replace the regular diplomacy files with ones that make the AI really, really like and trust you when you give him gold. Give gold a couple of times and then ask him for any treaty you want. Once you did this, safe the scenario, exit and put the regular files back in place. SLIC can probably do it as well, but I wouldn't know exactly how. I do know that a lot of SLIC diplo changes need one turn to take effect so it's not ideal.

        If really needed, this can be solved with another piece of SLIC code though, one that turns off the AIs, so you can move the turns forward as often as you want without having the AIs attacking or moving or screwing anything else up, I'll see if I can find this code and post it here, just in case it helps anyone. (BTW, once you moved the turns forward as often as you needed you can use the cheat menu to set the year back at the original starting year of the scenario). This code should also temporarily replace all existing SLIC code to prevent anything else gets screwed up.
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • #5
          Thanks for the help. The idea about turning the AI will definetly help me out with a few things besides diplomacy. BTW, why was this moved to creation? Since its for creating a scenario shouldn't it be in the scenarios forum?

          Comment


          • #6
            Here's what my scenario.slc file looks like as of right now. It doesn't appear to be working. It should make the canadians(civ 2) love the americans(civ1) Also I couldn't find any functions for creating embassies, alliances, or pacts.

            // Scenario script for Dawn of New Millenium

            HandleEvent(BeginTurn) 'DMStartGame_F' pre {

            //set starting regard and Trust
            LogRegardEvent(2,1,8000);
            SetTrust(2,1,2000);

            }

            Comment


            • #7
              No, the scenario's forum is for announcing scenarios and for discussion gameplay issues (how many civs? should I include this feature? tech tree discussion) and bugreports and the like, like the MedMod threads. The creation forum is for technical issues: how do I do this? is it possible to do that?

              Onto the more important stuff. To turn off the AIs, there are two options. The first is this one, I tested it and it seems to work (doesn't crash, AI units don't move at all, haven't tested what happens with buildqueues and stuff), only it doesn't turn off the barbarians, so you might want to keep an eye on that. The second one will turn off barbarians as well, but I just wrote it so it's untested (don't see why it shouldn't work though). Note that 8s should be replaced by the number of civs in the scenario (so this example assumes you have 8 civs).

              Code:
              HandleEvent(BeginTurn) 'TurnOffAIs' post {
              int_t i;
                  for (i = 2; i <= 8; i = i + 1) {
                      DetachRobot(i);
                  }
              }
              Code:
              HandleEvent(BeginTurn) 'TurnOffAIs' post {
              int_t i;
                  for (i = 0; i <= 8; i = i + 1) {        
                      if (!IsHumanPlayer(i)) {
                          DetachRobot(i);
                      }
                  }
              }
              As far as the code you posted goes, I'm not surprised it doesn't work. In fact, when this code is executed, the game should crash to desktop and give some error messages (after which you can play on but without changing regard or trust). LogRegardEvent needs 6 arguments, not three, so this is never gonna work. This is from scenario.slc from the Alexander the Great scenario:

              LogRegardEvent(4, 1, -9999, 0, ID_AG_REGARD_EVENT_NEG, 9999);

              I'd suggest you try this for your example, not sure if it'll work in any other scenario but when you experiment a little with the arguments you can probably figure it out. The SetTrust thing is AFAIK never been used so I don't know how many arguments it needs (or which ones), you'll have to experiment around with that as well. I probably need this stuff myself as well in a while so eventually I'll try to figure it out myself, but I don't know yet when exactly 'in a while' is, so you may well not have the time to wait for that.
              Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

              Comment


              • #8
                from diplomacy.slc
                Code:
                LogRegardEvent(player, foreigner, regardDelta, regardEventType, explainstr)
                There is also an optional vaue, after explainstr, which is length in turns.

                Comment


                • #9
                  The trust function is working just fine. As for the regard...I tested the thing you said, and the error message said something like, "ID_AG_REGARD_EVENT_NEG is not defined. Well anyways I searched everywhere, for ID_AG_REGARD_EVENT_NEG and found its used many places to reduce regard, but nowhere does it initialize it. I know I can always do the old, stop, create diplomats method, but if activision can use slic in their scenarios then I should too.

                  Comment


                  • #10
                    Anything with ID as a prefix is a string. To set iun you scenario folder go scenxxx/english/gamedata. Then create a scen_str. Then if your id was ID_NOREASON you would go

                    Code:
                    NO_REASON      "There is no reaon why you are at war"

                    Comment

                    Working...
                    X