Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Adding Visual/Sound Effects

Page: 1 of 1
 Star Admiral
12-19-2008, 12:23 PM
#1
A quick question. Is it possible to add visual/sound effects to K1? Sound, I'm willing to bet yes, but I'm not too sure about visuals.

Thanks!

- Star Admiral
 glovemaster
12-19-2008, 12:49 PM
#2
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 Line reference from visualeffects.2da
// - nMissEffect: if this is TRUE, a random vector near or past the target will
// be generated, on which to play the effect

effect EffectVisualEffect(int nVisualEffectId, int nMissEffect=FALSE);
This then has to be applied to an Object or at a Location using either:
void ApplyEffectToObject(int nDurationType, effect eEffect, object oTarget, float fDuration=0.0f);
// Or
void ApplyEffectAtLocation(int nDurationType, effect eEffect, location lLocation, float fDuration=0.0f);

And to play a sound through a script you can use:
void 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
 Star Admiral
12-19-2008, 1:10 PM
#3
Thanks for the help. Didn't know about the PlaySound() script.

- Star Admiral
Page: 1 of 1