Announcement

Collapse
No announcement yet.

Scenario: Magnificent Samurai

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

  • Scenario: Magnificent Samurai

    I've been playing around with this scenario for the lastest AE and thought I'd share my experiences with you...

    First I had to fix the missing entries and files: missing ICON entries in uniticons.txt and adding unitbuildlists.txt to the aidata folder. I'm not sure why the latter is needed since no units are built during the scenario, or why the game doesn't just load the file from the main game folder, but adding it gets rid of the remaining startup errors.

    In game, the scenario works as intended for the most part. The main error I encountered during gameplay was the GroupOrder event which results in a slic error popup and no grouped units. (from line 1964 of SS_func.slc: Event:GroupOrder(tmpArmy) This is most noticeable when your units are transported to another location and the game tries to autoregroup them.

    Another glitch occurs when one of your units dies in combat but levels up because the rest of your group wins the fight. It doesn't realize that your unit has been killed and the game tries to kill it itself and give you the next level of unit. Trying to kill a unit that doesn't exist results in a slic error, but it shouldn't be doing it in the first place.

    Another thing I noticed is that the AI does not seem to become active until you return from the island that sinks from the volcano. I'm not sure if this is intentional or not.

    The worst glitch I encountered occurred near the end of the scenario when your party returns to the starting village. Your supposed to guard the village from a series of bandit attacks and then go on and destroy their leader. When the first wave of bandits attacked my party, I was able to defeat them easily. But after the battle was over the game froze and I had to force quit. I was able to reload from the auto-save and continue, but the menu graphics became strangely distorted.

    Overall, I was pleased with how the scenario played out. I think the new combat option made the units perform as they were originally intended. The random bandit encounters become tiresome after a while, but I think this is about the best you can expect from an RPG scenario with the CTP engine. In the end, though, due to its linear gameplay, this isn't a scenario I would want to play more than once or twice every decade or so.
    "

  • #2
    Originally posted by EPW View Post
    I've been playing around with this scenario for the lastest AE and thought I'd share my experiences with you...
    So do you want to fix the problems?

    The random bandit encounters become tiresome after a while, but I think this is about the best you can expect from an RPG scenario with the CTP engine. In the end, though, due to its linear gameplay, this isn't a scenario I would want to play more than once or twice every decade or so.
    This is my opinion of it too. I'm not a big RPG fan, but I did enjoy it because it was quite short, and the little rewards were frequent.

    Not sure if I remember correctly but at the end, when I first landed my party to get the boss dude he and his army didn't move toward me. I eventually had to pick up my party and go around to the back of the island and land them on a desert mountain I think. Then he attacked me and lost badly thanks to the defence bonus I got
    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


    • #3
      Originally posted by Maquiladora View Post
      So do you want to fix the problems?
      Now you are sounding like Martin, with the smilie and everything.

      I don't know, its probably beyond my ability to fix the bugs in the sourcecode.
      "

      Comment


      • #4
        Originally posted by EPW View Post
        Now you are sounding like Martin, with the smilie and everything.
        You will be assimilated

        I don't know, its probably beyond my ability to fix the bugs in the sourcecode.
        Nonsense

        Can you submit the stuff you've already fixed?
        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


        • #5
          I've been looking at the grouporder code and I have no idea whats wrong. The slic code looks fine, it works in vanilla ctp2 at least.
          "

          Comment


          • #6
            I couldn't get the group order to work with the AE in Red Front either.
            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


            • #7
              I've done some debugging and it appears that it actually does work, but for some reason the error message pops up no matter what.
              "

              Comment


              • #8
                Code:
                GAME_EVENT_ERR GameEvent::Process()
                {
                	/// @ToDo check whether there are valid situations when the data became invalid.
                	if(m_argList->TestArgs(m_type, this))
                	{
                		return g_gevManager->ActivateHook
                		            (m_type, m_argList, m_resumeIndex, m_resumeIndex);
                	}
                	else
                	{
                		return GEV_ERR_ArgsInvalid;
                	}
                }
                I think this is one of the "valid situations when the data became invalid", I'm not sure though.
                "

                Comment


                • #9
                  Originally posted by EPW View Post
                  I've been looking at the grouporder code and I have no idea whats wrong. The slic code looks fine, it works in vanilla ctp2 at least.
                  Can you post the piece of code in question? Maybe there are problems.

                  -Martin
                  Civ2 military advisor: "No complaints, Sir!"

                  Comment


                  • #10
                    Originally posted by Martin Gühmann View Post
                    Can you post the piece of code in question? Maybe there are problems.

                    -Martin
                    From the log it seems pretty clear what the error is:

                    Code:
                       ArmyData.cpp@6348: Army 0xd0000030 Executing order ORDER_GROUP @ (37,29), turn=1
                       ArmyData.cpp@1203: Army 0xd0000030 grouping everyone
                    [B]ObjPool.cpp@106 : ObjPool: Deleting object id 0xd0000077[/B]
                       ArmyData.cpp@1225: Grouped unit 0x10000076
                    [B]GameEventArgume@385 : Missing object id d0000077[/B]
                       c3errors.cpp@168 : Error: Slic Event Error Error, Parameter #0 of type GEA_Army of event GroupOrder is invalid.
                    The event was called during execution of event BeginTurn.
                    The object is deleted and then accessed again by GameEventArgument.

                    Here is the slic code:
                    Code:
                    // If more than one unit in a player's army is on a tile, group it into an army
                    int_f MakeArmies (int_t tmpPlayer)
                    {
                    unit_t	tmpUnit;
                    army_t	tmpArmy;
                    int_t	i;
                    int_t	j;
                    int_t	tmpPlayer2;
                    int_t	numUnits;
                    int_t	tmpNum;
                    int_t	foundLoc;
                    int_t	indexLoc;
                    location_t	tmpLoc[100];
                    
                    	tmpPlayer2 = tmpPlayer;
                    	player[0] = tmpPlayer2;
                    	numUnits = player[0].units;
                    	foundLoc = 0;
                    	
                    	for (i = 0; i < numUnits; i = i + 1) {
                    		GetUnitByIndex(tmpPlayer2, i, tmpUnit);
                    		tmpNum = GetUnitsAtLocation(tmpUnit.location);
                    		if (tmpNum >= 2) {
                    			if (indexLoc >= 100 ) {
                    				return -1;
                    			}
                    			for (j = 0; j < indexLoc; j = j + 1) {
                    				if (tmpUnit.location == tmpLoc[i]) {
                    					foundLoc = 1;
                    				}
                    			}
                    			if (foundLoc == 1) {
                    				foundLoc = 0;
                    			} else {
                    				tmpLoc[indexLoc] = tmpUnit.location;
                    				indexLoc = indexLoc + 1;
                    				GetArmyFromUnit(tmpUnit, tmpArmy);
                    				Event:GroupOrder(tmpArmy);
                    			}
                    		}
                    	}
                    }
                    "

                    Comment


                    • #11
                      Originally posted by EPW View Post
                      The object is deleted and then accessed again by GameEventArgument.
                      The problem is that the GroupOrder event is called multiple times for units at the same location, although it should only be called once. And in fact the code is supposed to do it, but doesn't do it because of a small mistake.

                      That how it should look like:

                      Code:
                      // If more than one unit in a player's army is on a tile, group it into an army
                      int_f MakeArmies (int_t tmpPlayer)
                      {
                      unit_t	tmpUnit;
                      army_t	tmpArmy;
                      int_t	i;
                      int_t	j;
                      int_t	tmpPlayer2;
                      int_t	numUnits;
                      int_t	tmpNum;
                      int_t	foundLoc;
                      int_t	indexLoc;
                      location_t	tmpLoc[100];
                      
                      	tmpPlayer2 = tmpPlayer;
                      	player[0] = tmpPlayer2;
                      	numUnits = player[0].units;
                      	foundLoc = 0;
                      	
                      	for (i = 0; i < numUnits; i = i + 1) {
                      		GetUnitByIndex(tmpPlayer2, i, tmpUnit);
                      		tmpNum = GetUnitsAtLocation(tmpUnit.location);
                      		if (tmpNum >= 2) {
                      			if (indexLoc >= 100 ) {
                      				return -1;
                      			}
                      			for (j = 0; j < indexLoc; j = j + 1) {
                      				if (tmpUnit.location == tmpLoc[[SIZE="5"][B]j[/B][/SIZE]]) {
                      					foundLoc = 1;
                      				}
                      			}
                      			if (foundLoc == 1) {
                      				foundLoc = 0;
                      			} else {
                      				tmpLoc[indexLoc] = tmpUnit.location;
                      				indexLoc = indexLoc + 1;
                      				GetArmyFromUnit(tmpUnit, tmpArmy);
                      				Event:GroupOrder(tmpArmy);
                      			}
                      		}
                      	}
                      }
                      How an i instead of a j can break the whole thing.

                      -Martin
                      Civ2 military advisor: "No complaints, Sir!"

                      Comment


                      • #12
                        Ahhhh, I missed that. This is why I'm not a programmer. I'm glad I was wrong about it being a problem in the sourcecode.
                        "

                        Comment

                        Working...
                        X