Unit: Suicide after Mission Recon

Warl0rd

Chieftain
Joined
Aug 7, 2007
Messages
47
Is it possible to have a Unit like the Airship die after it has finished a Recon Mission?

Easy Way needed
 
Pretty much anything is possible, this would definatly take some actual programming to accomplish though, either SDK or Python, no way to do this from the XML.
 
Can you compile a new DLL? If you can it's easy if not it may be impossible.

The game checks in canRecon for isSuicide().
PHP:
bool CvUnit::canRecon(const CvPlot* pPlot) const
{
	if (getDomainType() != DOMAIN_AIR)
	{
		return false;
	}

	if (airRange() == 0)
	{
		return false;
	}

	if (m_pUnitInfo->isSuicide())
	{
		return false;
	}

	return true;
}

So delete
PHP:
	if (m_pUnitInfo->isSuicide())
	{
		return false;
	}
and compile a new DLL. If you can't you must ask our Python specialist if they can invent something.
 
Thx for reply - yes i made a new .dll with modified CvUnit.cpp

and now the <bSuicide>1</bSuicide> units can do recon missions, great - thanks for that part

to make the <bSuicide>1</bSuicide> units die after recon i added

PHP:
 if (isSuicide())
    {
        kill(true);
}
inside the

PHP:
bool CvUnit::recon(int iX, int iY)
{
	CvPlot* pPlot;
	...
	if (pPlot->isActiveVisible(false))
	{
		...
	}

	//change start
	if (isSuicide())
	{
		kill(true);
	}
	//change end

	return true;
}

and BÄÄÄÄÄM, it works, awesome :goodjob: and thx for help
 
Top Bottom