![]() |
CTP2 Bureau The Modding Knowledgebase |
|
Apolyton CTP2 forums Apolyton CTP2 archives Source Code Project SVN |
![]() |
Search the site: |
SLIC-Reference :
|
Arguments: | unit, armyvar | Type: | void |
Finds the army which contains the unit and saves it into armyvar |
Example:
unit_t my_unit; army_t my_army; // Get the army containing my first unit GetUnitByIndex(player[0], 0, my_unit); // Get the army my_unit is in GetArmyFromUnit(my_unit, my_army); |
tested
working
SFN_ERROR Slic_GetArmyFromUnit::Call(SlicArgList *args) { m_result.m_int = 0; Unit u; if(args->Count() != 2) return SFN_ERROR_NUM_ARGS; if(!args->GetUnit(0, u)) return SFN_ERROR_TYPE_ARGS; if(args->m_argValue[1].m_type != SA_TYPE_INT_VAR) return SFN_ERROR_TYPE_ARGS; if(!g_theArmyPool->IsValid(u.GetArmy())) return SFN_ERROR_OK; SlicSymbolData *sym = args->m_argValue[1].m_symbol; sym->SetArmy(u.GetArmy()); m_result.m_int = 1; 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
![]() |
This site is currently maintained by: BureauBert (Webmaster) Maquiladora (Manager) Legal Notice: Legal Notice Statistics: 117905 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne |