1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

What file controls units given during event?

Discussion in 'Civ4 - Road to War' started by wotan321, Aug 14, 2009.

  1. wotan321

    wotan321 Chieftain

    Joined:
    Oct 25, 2001
    Messages:
    1,218
    Location:
    NC, USA
    In the 1936 Europe scenario with accurate events, the Munich event gives Czechoslovakia to Germany, and a bunch of units. What file determines what units Germany gets? I see in the RTWEvents python file the mention of the annexation events for Austria and Czechoslovakia, but nothing about the units or where they go or how many, etc.

    Where is that?
     
  2. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    I woulds say CvPlayer.cpp (sorry, it appears to be hardcoded):

    Code:
    void CvPlayer::doAnnexation(int value1)
    {
    	CvUnit* pGiftUnit;
    	PlayerTypes eNewPlayer = ((PlayerTypes)value1);
    	if (eNewPlayer == NO_PLAYER)
    	{
    		return;
    	}
    	int iLoop;
    	for (CvUnit* pLoopUnit = firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = nextUnit(&iLoop))
    	{
    		CvPlot* pPlot = pLoopUnit->plot();
    		pGiftUnit = GET_PLAYER(eNewPlayer).initUnit(pLoopUnit->getUnitType(), pLoopUnit->getX_INLINE(), pLoopUnit->getY_INLINE(), pLoopUnit->AI_getUnitAIType());
    		pGiftUnit->convert(pLoopUnit);
    	}
    	for (CvCity* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
    	{
    		int iCulture = pLoopCity->getCultureTimes100(getID());
    		CvPlot* pPlot = pLoopCity->plot();
    		GET_PLAYER(eNewPlayer).acquireCity(pLoopCity, false, true, false);
    		if (NULL != pPlot)
    		{
    			CvCity* pCity = pPlot->getPlotCity();
    			if (NULL != pCity)
    			{
    				pCity->setCultureTimes100(getID(), 0, false, false);
    				pCity->setCultureTimes100(eNewPlayer, iCulture, true, false);
    			}
    		}
    	}
    	return;
    }
    Not a C++ modder, so I can't tell for sure, but I do know that the event in RTWEventManager triggers this.
     
  3. wotan321

    wotan321 Chieftain

    Joined:
    Oct 25, 2001
    Messages:
    1,218
    Location:
    NC, USA
    That bit of code doesn't mean much to me, but I am guessing it takes the city and units from one civ and gives it to another. So whatever units Czechoslovakia has, Germany gets via the annexation.
     

Share This Page