![]() |
CTP2 Bureau The Modding Knowledgebase |
|
Apolyton CTP2 forums Apolyton CTP2 archives Source Code Project SVN |
![]() |
Search the site: |
SLIC-Reference :
|
Arguments: | player, foreigner, cityvar | Type: | int |
Stores the player's most at risk city into cityvar |
Example: When asked for a ceasefire, an AI civ counters by asking for a city. HandleEvent(NewProposal) 'Example_ProposalResponseEvent' pre { int_t first_type; city_t tmpcity; first_type = GetLastNewProposalType(player[0], player[1], 0); GetMostAtRiskCity(player[1], player[0], tmpcity); if (CityIsValid(tmpcity) && first_type == 32) { ConsiderResponse(player[0], player[1], 1000, 3, 1, tmpcity, 4); } else { ConsiderResponse(player[0], player[1], 10, 1); } } |
//INT GetMostAtRiskCity(player, foreigner, &cityvar) SFN_ERROR Slic_GetMostAtRiskCity::Call(SlicArgList *args) { if (args->Count() != 3) return SFN_ERROR_NUM_ARGS; PLAYER_INDEX player; PLAYER_INDEX foreigner; if(!args->GetPlayer(0, player)) return SFN_ERROR_TYPE_ARGS; if(!args->GetPlayer(1, foreigner)) return SFN_ERROR_TYPE_ARGS; if(args->m_argValue[2].m_type != SA_TYPE_INT_VAR) { return SFN_ERROR_TYPE_ARGS; } SlicSymbolData *sym = args->m_argValue[2].m_symbol; if(sym->GetType() != SLIC_SYM_CITY && sym->GetType() != SLIC_SYM_STRUCT) { return SFN_ERROR_TYPE_ARGS; } Unit atrisk_city; m_result.m_int = MapAnalysis::GetMapAnalysis().MostAtRiskCity(player, atrisk_city, foreigner); if(atrisk_city.m_id == 0) { return SFN_ERROR_OK; } sym->SetCity(atrisk_city); return SFN_ERROR_OK; } |
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.
*) Required fields
No user comments yet. |
![]() |
This site is currently maintained by: BureauBert (Webmaster) Maquiladora (Manager) Legal Notice: Legal Notice Statistics: 85665 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne |