Announcement

Collapse
No announcement yet.

AE Scenario Conversion: Cradle

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

  • #16
    You were right! That's one crash down. (it would be nice if you shared any other such information Maq )

    Next up, I get a ton of slic errors from the mod_UnitAttack function. Says the "pla" is noname or some such thing.
    "

    Comment


    • #17
      Originally posted by EPW View Post
      You were right! That's one crash down. (it would be nice if you shared any other such information Maq )
      I noticed that making the AE Mod, so I totally forget it here. Maybe Martin can think of anything else we might need convert.

      Next up, I get a ton of slic errors from the mod_UnitAttack function. Says the "pla" is noname or some such thing.
      That's gotta be the unit training mod, sounds like a syntax error got added somewhere, since I know it works with the AE. This is why testing with debug slic=yes is a good idea. Does it tell you what file and line it's on?
      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
      CtP2 AE Wiki & Modding Reference
      One way to compile the CtP2 Source Code.

      Comment


      • #18
        Originally posted by Maquiladora View Post
        That's gotta be the unit training mod, sounds like a syntax error got added somewhere, since I know it works with the AE. This is why testing with debug slic=yes is a good idea. Does it tell you what file and line it's on?
        No, I've confirmed that it is an event error. It happens only with debugslicevent on. It occurs for both mod_UnitAttack and mod_UnitDefense.

        Here's a cool screen shot I took on turn 150 with only AIs playing. Pretty impressive!
        Attached Files
        "

        Comment


        • #19
          Originally posted by EPW View Post
          No, I've confirmed that it is an event error. It happens only with debugslicevent on. It occurs for both mod_UnitAttack and mod_UnitDefense.
          Strange, I got no errors testing the training mod with debug slic=yes. Edit: Oh wait, debugslicevents, I don't like those.

          Here's a cool screen shot I took on turn 150 with only AIs playing. Pretty impressive!
          Orange got ate up pretty bad, after only 150 turns too. Nice.
          Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
          CtP2 AE Wiki & Modding Reference
          One way to compile the CtP2 Source Code.

          Comment


          • #20
            I got a slic error in CRASL_homegaurd, event CRA_MilitiaCityDestroyed on line 213. Says -1 is not a valid player index.

            Also in the same file, on line 259 in CRA_MilitiaCity, got an "Array index 1 out of bounds" error.
            Last edited by EPW; July 13, 2009, 03:20.
            "

            Comment


            • #21
              Originally posted by EPW View Post
              I got a slic error in CRASL_homegaurd, event CRA_MilitiaCityDestroyed on line 213. Says -1 is not a valid player index.
              I'm not sure what is wrong, it looks it could happen if that was the player's last unit. Either way I might prefer to do it like this:

              Code:
              // if city is destroyed (from hunger or war), kill all Militia units
              HandleEvent(KillCity) 'CRA_MilitiaCityDestroyed' pre {
              unit_t	tmpUnit;
              city_t	tmpCity;
              int_t	i;
              int_t	tmpPlayer;
              
              	tmpPlayer = player[0];
              
              	for(i = GetUnitsAtLocation(city[0].location)-1; i >= 0; i = i - 1) {
              		GetUnitByIndex(tmpPlayer, i, tmpUnit);
              		if (CRA_IsMilitia(tmpUnit.type)) {
              			KillUnit(tmpUnit);
              		}
              	}
              }
              Using a for loop cycling backwards instead of a while loop means it won't cause problems when something is removed from it, in this case a unit. This also doesn't cycle through all the player's units, just the ones on the tile. Untested so may not work as advertised.

              Also in the same file, on line 259 in CRA_MilitiaCity, got an "Array index 1 out of bounds" error.
              That might be because CTC_PLAYER_COUNT is already used as a global in the code, since it's only a local variable on that line, so just rename it.
              Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
              CtP2 AE Wiki & Modding Reference
              One way to compile the CtP2 Source Code.

              Comment


              • #22
                This is turn 235 of a 2-player AI-only Cradle game with Frenzy DISABLED. Sadly, most of the Roman empire revolts the next turn.
                Attached Files
                "

                Comment


                • #23
                  Originally posted by EPW View Post
                  This is turn 235 of a 2-player AI-only Cradle game with Frenzy DISABLED. Sadly, most of the Roman empire revolts the next turn.
                  I assume they're way over their city cap? You should add the "TOO_MANY_CITIES" strategy to Cradle if that's the case.
                  Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                  CtP2 AE Wiki & Modding Reference
                  One way to compile the CtP2 Source Code.

                  Comment


                  • #24
                    Originally posted by Maquiladora View Post
                    Using a for loop cycling backwards instead of a while loop means it won't cause problems when something is removed from it, in this case a unit. This also doesn't cycle through all the player's units, just the ones on the tile. Untested so may not work as advertised.
                    This fix appears to work, at least I havn't got the error yet.

                    Originally posted by Maquiladora View Post
                    That might be because CTC_PLAYER_COUNT is already used as a global in the code, since it's only a local variable on that line, so just rename it.
                    This didn't work.

                    And the mod_UnitAttack/Defend errors came back with a vengence when I played a single turn for the AI - even with debugslicevents off...
                    "

                    Comment


                    • #25
                      Originally posted by EPW View Post

                      This didn't work.
                      Did you change every instance of CTC_PLAYER_COUNT in that event handler?

                      And the mod_UnitAttack/Defend errors came back with a vengence when I played a single turn for the AI - even with debugslicevents off...
                      Errors that weren't debug slic event popups of before? What did they say?
                      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                      CtP2 AE Wiki & Modding Reference
                      One way to compile the CtP2 Source Code.

                      Comment


                      • #26
                        Originally posted by Maquiladora View Post
                        Did you change every instance of CTC_PLAYER_COUNT in that event handler?
                        Yes

                        Originally posted by Maquiladora View Post
                        Errors that weren't debug slic event popups of before? What did they say?
                        Same popup as before, except the occurred during combat this time.
                        "

                        Comment


                        • #27
                          Originally posted by EPW View Post

                          Next up, I get a ton of slic errors from the mod_UnitAttack function. Says the "pla" is noname or some such thing.
                          Does it point to any line or file?
                          Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                          CtP2 AE Wiki & Modding Reference
                          One way to compile the CtP2 Source Code.

                          Comment


                          • #28
                            In object mod_UnitAttack, variables 'mod_UnitAttack#pl' and 'noname' are of different types.
                            Maybe its because I changed players during play?
                            "

                            Comment


                            • #29
                              Originally posted by EPW View Post
                              Maybe its because I changed players during play?
                              pl is the owner of the unit being modified. I thought mod_UnitAttack was a built-in function, so I thought didn't need to pass the function parameter through a local variable, like you have to with user functions. But that may be the case. It's worth a try either way.

                              In each mod unit function you'll find this kind of part:

                              Code:
                              	u = att;
                              	pl = att.owner;
                              and need to change it to this:

                              Code:
                              	u = att;
                              	pl = u.owner;
                              and do that for the 3 mod unit functions. I'm just guessing here though, I usually make my code work through immense trial and error.
                              Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                              CtP2 AE Wiki & Modding Reference
                              One way to compile the CtP2 Source Code.

                              Comment


                              • #30
                                That appears to have fixed it, more testing needed though.
                                "

                                Comment

                                Working...
                                X