Announcement

Collapse
No announcement yet.

Can anyone explain the mod_functions?

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

  • Can anyone explain the mod_functions?

    Can anyone explain the mod_functions? I can see in the senarios that come with the game what a few of them need and do but the others don't seem to be documented in any way. Much help would be appreciated for all of them. What arguements does each require, what do they do, what are the return values? Here is the list of mod_ functions aparantly built into the game:
    mod_CanPlayerHaveAdvance
    mod_CanCityBuildUnit
    mod_CanCityBuildBuilding
    mod_CanCityBuildWonder
    mod_CityHappiness
    mod_UnitAttack
    mod_UnitRangedAttack
    mod_UnitDefense

    Thanks

  • #2
    some (all) of these aer not built in, and they are contained in ag_mod.slc, and the respective files for the other scenarios.

    Comment


    • #3
      You can find examples of the first 4 in the alexander scenario (and possibly others), they determine if a player can have a certain advance and if cities can build a certain unit/building/wonder. The others, I haven't seen in action yet and I suspect they aren't implemented and simply don't do anything. If anyone knows anything about those, I'd love to know too...
      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

      Comment


      • #4
        Thanks guys, I was looking for info on the last 4.

        Herdie: I was under the impression that they were built in functions that get automatically called. In the senarios I can't find anything that really triggers them. The last 4 I found near the first few in the ctp2.exe file. It would be great if they were in fact implemented in the game and just happened to not be used in the senarios that came with the game. Guess we'll never know (insert activision whining here)

        Comment


        • #5
          Yes, they are indeed called automatically. I found the last 4 in the ctp2.exe as well but I never got to actually trying them out. Who says we'll never know if they are implemented or not? The only reason I didn't experiment with them yet is because that's only chapter 9 of my SLIC documentation and I'm currently working on chapter 5 I don't need Activision when it comes to SLIC, I can figure it all out on my own just as well (though a little help would make things a hell-of-a-lot easier...)
          [This message has been edited by Locutus (edited January 24, 2001).]
          Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

          Comment


          • #6
            A little help as to what those functions need, what they do, and what they are supposed to return would be a huge bonus. I suppose one can play around with it and see what it does or what errors it creates.

            On another note Locutus, did you see my last post in the creating natural disasters with slic thread?
            quote:


            Is it possible to access the player built in variables for a civ that is not player[0]? With this quake mod I would like
            to message the human player if a quake hits another civilization. Any attempts to do this so far have resulted in slic
            syntax or out of bounds errors. To do this I would like to use the results of CellOwner() when its >= 0 like in my
            previous post. If I try to use player[tmpCellOwner].country_name I get out of bounds errors. I get a syntax error if
            I try player.tmpCellOwner.country_name. forcing player[0] = tmpCellOwner doesnt cause a slic error when it does
            player[0].country_name but it also doesn't work (it's not getting set to the country name at all). I am probably
            overlooking something simple. Help appreciated.



            How does one use the player array in an event for players other than player[0]. Any time I try to use anything other than player[0] I get a slic error that the array is out of bounds.

            Comment


            • #7
              What I used to scan through the number of players was a for loop, then a player[1] = command.

              Code:
              for(count = 0; count < NumOfPlayers; count = count + 1) {
                   player[1] = count;
                   // this should force player[1] to whatever player you want.
                   // player[0] I feel should always reference the current player whose turn it is.
              }
              ------------------
              Author of Diplomod. The mod to fix diplomacy.

              Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back."
              [This message has been edited by Dale (edited January 24, 2001).]
              [This message has been edited by Dale (edited January 24, 2001).]

              Comment


              • #8
                No, I seem to have missed that post, sorry about that. Sometimes I'm so busy with all kinds of stuff I have to leave the forums for a few days and try to catch up on everything when I get back, but when I'm catching up I can't always read through everything very carefully and sometimes overlook a few paragraphs or posts.

                Dale is basicly correct, by default most events only give player[0] a value. Some events also use player[1], but if you use higher numbers it's not likely they will contain a valid value. So to use these array-elements, give them a value yourself first. The way you do it, if tmpCellOwner is 7, you try to read player[7] which by default doesn't exist. Like you suggested yourself, the way to get tmpCellOwner in a player variable is 'player[3] = tmpCellOwner;' and then use player[3].country_name where-ever you need it (3 can be any other value as well but I tend to use values that are by default unused - better safe than sorry).
                Also, keep in mind that player[0].country_name returns a string and that strings are usually only useful as part of messages (in the textfiles), they can't really be used in other SLIC functions or anything (or at least not officially).
                Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                Comment

                Working...
                X