MODSon[line.com] Wiki - Beta 1.0

World at War: Exploders/Destructables

From MODSonline Wiki

Jump to: navigation, search

Contents

[edit] Exploders

script_exploders are triggered actions which can simulate destruction, this is used in both the MP and SP game with little difference between the two.

You will need to call the _load script to get exploders to work:

Example Script for SP:

main()
{

maps\_load::main();
//calling your fx script
maps\yourmapname_fx::main();
 
} 

Example Script for MP:

main()
{

maps\mp\_load::main();
//calling your fx script
maps\mp_yourmapname_fx::main();

}


[edit] Exploder Triggers

Script exploders require a trigger and the 'before' and 'after' events to be setup correctly:

Triggers: (ALL types of trigger should work)

Example Trigger:

classname trigger_damage
script_exploder 20

("20" will refer to this particular exploder, any number above "10" is valid, one number should be chosen per exploder group, so the next would be "21")

[edit] Exploder Before

The before pieces are everything that you see before the trigger condition is met. So if you have a wall, the wall could disappear and a load of rubble and bricks could appear in its stead.

Example BEFORE piece:

classname script_brushmodel
script_exploder 20

(Note Terrain Patches can be script_brushmodels as well!)

[edit] Exploder After

These are the pieces that appear after the trigger event (usually debris, like rocks/bricks etc).

Example AFTER piece

classname script_brushmodel
script_exploder 20
targetname exploder

So basically all "before" pieces have "script_exploder" "20" but the destroyed/after pieces have "targetname" "exploder" as well.

The script_brushmodels would work the same if you load a model instead, a script_model, so your not limited to working with brushes.

If you have many brushes appearing after the explosion, you can select them all, make them script_brushmodels and then enter their values so it does them all at once.

[edit] Exploder Effects

Effects can also be triggered to create added visuals and help hide the different peices from simply disappearing and appearing.

Example FX:

classname script_model
model fx
script_fxid whatever
targetname exploder
script_exploder 20

So we are triggering the effect "whatever" (explained below) and we are triggering this after the trigger condition (targetname exploder) and it belongs to the group "20" (script_exploder 20).

The effect called from the script_fxid is pre-cached in the fx.gsc.

Example FX script:

raw/maps/yourmapname_fx.gsc or raw/maps/mp/mp_yourmapname_fx.gsc (for multiplayer)

main()
{
precacheFX();
}

precacheFX()
{
level._effect["whatever"] = loadfx ("impacts/fx_flesh_blood_geyser");
}

(notice in the line "loadfx ("impact/fx_flesh"..." it's not fx/impacts/fx_flesh..." that's because it already knows where the FX folder is!)

"whatever" can be any name you want, just make sure you call the same name in the FX script as in the "script_fxid" on the FX script_model.

You can use FX from the CODWAW/RAW/FX folder.

To package the FX in the Fast File properly in order to see the FX in game you must define which FX you are using in your levels zone source:

Example Zone Source:

yourmapname.csv or mp_yourmapname.csv (for multiplayer)

fx,impacts/fx_flesh_blood_geyser

[edit] Exploder Zone Source

SP:

raw,maps/yourmapname.gsc
raw,maps/yourmapname_fx.gsc
fx,impacts/fx_flesh_blood_geyser

MP:

raw,maps/mp/mp_yourmapname.gsc
raw,maps/mp/mp_yourmapname_fx.gsc
fx,impacts/fx_flesh_blood_geyser

[edit] Destructables

Personal tools