Tutorial: Effects that vary based on the map

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
CalvaryCptMike
Captain
Captain
Posts: 476
Joined: Sat Feb 19, 2011 3:10 pm
Projects :: Nothing--absolutely nothing
Location: Freed by alien robots, now living on Mars
Contact:

Tutorial: Effects that vary based on the map

Post 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)
User avatar
Nedarb7
Lieutenant General
Lieutenant General
Posts: 676
Joined: Sat Sep 22, 2012 3:41 pm

Re: Tutorial: Effects that vary based on the map

Post 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
CalvaryCptMike
Captain
Captain
Posts: 476
Joined: Sat Feb 19, 2011 3:10 pm
Projects :: Nothing--absolutely nothing
Location: Freed by alien robots, now living on Mars
Contact:

Re: Tutorial: Effects that vary based on the map

Post 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.
Post Reply