Page 1 of 1

Tutorial: Effects that vary based on the map

Posted: Mon Sep 09, 2013 8:53 pm
by CalvaryCptMike
Tutorial: Make snow fly on Hoth and sparks fly on Tantive 4.


Say you have two maps in your mod, and only one gun. Tantive 4, Hoth, and the rebel blaster rifle. You want sparky/flamey effects on Tantive 4, and snow puffs on Hoth. Here's what you can do.

Set the ordance impact effect in the blaster rifle from this
ImpactEffectSoft = "com_sfx_ord_exp"
ImpactEffectRigid = "com_sfx_ord_exp"
ImpactEffectStatic = "com_sfx_ord_exp"
ImpactEffectTerrain = "com_sfx_ord_exp"
ImpactEffectWater = "com_sfx_watersplash_ord"
ImpactEffectShield = "com_sfx_ord_exp"
ExpireEffect = "com_sfx_ord_exp"
to
ImpactEffectSoft = "com_fx_impact"
ImpactEffectRigid = "com_fx_impact"
ImpactEffectStatic = "com_fx_impact"
ImpactEffectTerrain = "com_fx_impact"
ImpactEffectWater = "com_sfx_watersplash_ord"
ImpactEffectShield = "com_fx_impact"
ExpireEffect = "com_fx_impact"
You can name it whatever you want, but you cannot leave it with a stock name.

Next, use the side making process to make two new sides, FX1 and FX2. However, in each side there will be only one folder "effects".

For FX1, make it's REQ name FX1 and add this code.
ucft
{
REQN
{
"config"
"com_fx_impact"
}
}
For FX2, make it's REQ name FX2 and add this code. (Yes it is the same)
ucft
{
REQN
{
"config"
"com_fx_impact"
}
}
Now go into the particle editor, make yourself a sparkey/flamey effect, and a snow puff effect (you don't have to use custom effects, this is just an example.)

Take the sparkey/flamey effect and paste it into FX1-->effects.
Take the snow puff effect and paste it into FX2-->effects.

Now go into your mission script for the hoth level. Add these lines right before the sides are loaded, and right after the sounds are loaded.
ReadDataFile("dc:SIDE\\FX2.lvl",
"com_fx_impact")
Now on your tantive 4 level, paste these lines in the same place.
ReadDataFile("dc:SIDE\\FX1.lvl",
"com_fx_impact")
Munge your rebel soldier, your script, and both of your new sides. Play your hoth map and shoot the ground, watch snow fly, then play your tantive 4 map, and watch sparks fly! As you can imagine, you can really get creative with this, adding it to explosions and other stuff. It's like a skins loading mod for effects. I used this in all of my 3.5 mod maps, and had five effect sides, with like 15 effects each.

Credits:
Me, CavalryCaptainMike 8)

Re: Tutorial: Effects that vary based on the map

Posted: Tue Sep 10, 2013 1:25 pm
by Nedarb7
Nice to see new uses of this technique :thumbs: However I think there should be a universal version of these tutorials. Examples of this technique used in different ways:
Re-Texturing Stock Maps Through the LUA
Reducing side file size (FAQ)
Making a Custom Ingame.lvl (FAQ)

I'm not saying your tutorial is the same but it uses the same idea.

This is how it works:
replacing textures - Load a .lvl with the new textures after the .lvl that it will overwrite
replacing anything else - Load a .lvl with the new files before the .lvl that it will overwrite

Re: Tutorial: Effects that vary based on the map

Posted: Wed Sep 11, 2013 2:51 am
by CalvaryCptMike
@Nebarb7

You're totally right. 8) A universal tutorial would be cool, I just thought it was neat because I didn't know you could load more than just textures when I started modding. The potential of this technique is pretty cool.