SLIC-Reference : AddCenter
CTP2 Bureau
The Modding
Knowledgebase
Apolyton CTP2 forums
Apolyton CTP2 archives
Source Code Project SVN

SLIC-Reference : : AddCenter  

Arguments: location|unit|city|army Type: void

Add a recenter event on location to the animation queue

The argument of the AddCenter function has to be something that has a location, but is not restricted to a location_t. Using a unit_t (or city_t) variable as argument works just as well. The "args->GetPos" line decides whether a location can be returned (BTW: army_t will work as well). (information provided by Fromafar). Example:
HandleEvent(CreateCity) post
{

    AddCenter(city[0].location);

}

//causes a recenter on a city when it has been built.

tested   working  

Source:

SFN_ERROR Slic_AddCenter::Call(SlicArgList *args)
{
	
	if(args->Count() != 1)
		return SFN_ERROR_NUM_ARGS;
	
	MapPoint pos;
	if(!args->GetPos(0, pos))
		return SFN_ERROR_TYPE_ARGS;

	g_director->AddCenterMap(pos);
	return SFN_ERROR_OK;
}

More information available at Apolyton here

Information last updated by BureauBert on 23.11.2010

User Comments:

Using this form you may add your own observations concerning the above item, e.g. additional hints for usage, limitations, oddities etc. Please note this is not the place for asking questions or carrying out discussions about modding - please refer to the Apolyton CTP2 Modification Forum on that purpose.

Subject / Title*:
Text:*
(A maximum of characters left)
Your name:*
Your website (URL):

*) Required fields

Unkown Tag: NameUnkown Tag: Name

  Administration
This site is currently maintained by: BureauBert (Webmaster)  Maquiladora (Manager)  Legal Notice: Legal Notice Statistics: 125635 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne
Share this page:  VK Facebook Twitter LiveJournal OK MR Google+ LinkedIn tumblr Pinterest Blogger Digg Evernote