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

SLIC-Reference : : AddEffect  

Arguments: location, namestr, soundid Type: void

Add a special effect at location to the animation queue. namestr is the name from speceffid.txt (E.G. "SPECEFFECT_NUKE"), soundid is the ID from sounds.txt (E.G. "SOUND_D_DEFAULTDEATH").

Example:
AddEffect(unit.1.pos, "SPECEFFECT_NANO", "SOUND_ID_NANO_TERROR");

//Note that if the location is not visible to the onscreen player, this special
//effect won't be seen. Use AddCenter(loc) first to center on the location.

tested   working  

Source:

SFN_ERROR Slic_AddEffect::Call(SlicArgList *args)
{
	
	if(args->Count() != 3)
		return SFN_ERROR_NUM_ARGS;

	MapPoint pos;
	MBCHAR *effectName;
	MBCHAR *soundName;
	sint32 effectId;
	sint32 soundId;
	if(!args->GetPos(0, pos))
		return SFN_ERROR_TYPE_ARGS;

	if(!args->GetString(1, effectName))
		return SFN_ERROR_TYPE_ARGS;

	if(!args->GetString(2, soundName))
		return SFN_ERROR_TYPE_ARGS;

	sint32 typeIndex = g_theSpecialEffectDB->FindTypeIndex(effectName);
	if(typeIndex < 0) {
		return SFN_ERROR_EFFECT_NOT_FOUND;
	}

	effectId = g_theSpecialEffectDB->Get(typeIndex)->GetValue();
	if(effectId < 0)
		return SFN_ERROR_EFFECT_NOT_FOUND;

	soundId = g_theSoundDB->FindTypeIndex(soundName);
	if(soundId < 0)
		return SFN_ERROR_SOUND_NOT_FOUND;
	
	g_director->AddSpecialEffect(pos, effectId, soundId);
	return SFN_ERROR_OK;
}

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

No user comments yet.

  Administration
This site is currently maintained by: BureauBert (Webmaster)  Maquiladora (Manager)  Legal Notice: Legal Notice Statistics: 118120 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