Jump to content

Home

Adding Visual/Sound Effects


Star Admiral

Recommended Posts

You can create visual and sound effects using scripts.

For visual effects you can use any visual effect from visualeffects.2da using the function:

// 180: * Create a Visual Effect that can be applied to an object.
// - nVisualEffectId [color=cyan]Line reference from visualeffects.2da[/color]
// - nMissEffect: if this is TRUE, a random vector near or past the target will
//   be generated, on which to play the effect

[i]effect[/i] EffectVisualEffect(int nVisualEffectId, int nMissEffect=FALSE);

This then has to be applied to an Object or at a Location using either:

[i]void[/i] ApplyEffectToObject(int nDurationType, effect eEffect, object oTarget, float fDuration=0.0f);
// Or
[i]void[/i] ApplyEffectAtLocation(int nDurationType, effect eEffect, location lLocation, float fDuration=0.0f);

 

And to play a sound through a script you can use:

[i]void[/i] PlaySound(string sSoundName);

Sounds I assume are .mp3 format and will go in the streamsounds folder.

 

The Endor Spire at the start of KotOR uses scripts to make the random explosions in the corridors as the ship it exploding, by basically applying the frag grenade effect to specific locations. Also, IIRC there was a tuturial written on making random explosions, its probably worth digging that up. ;)

 

Hope that helps :)

 

EDIT:

I typed all that out and realised I misread the question... >.<

You can't add visual effects because they're models and I'm not sure if even the best modelers around here know exactly how it works, and I'm pretty sure that we don't have to tools to make the models either. =/

As for sound effects, I don't see why not. There's likely a 2da file that you can add new rows to, just make sure that you know the row index as well as the row number, they can sometimes be different. Otherwise I guess you could just add the mp3 file and use the PlaySound(); function?

 

Hope that helps instead :p

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...