Call of Duty 5: Exploding barrels: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
We select a model (barrel), make it a script_model, assign it targetname = explodable_barrel and script_noteworthy = explodable_barrel. To the .gsc file we add: | We select a model (barrel), make it a script_model, assign it targetname = explodable_barrel and script_noteworthy = explodable_barrel. To the .gsc file we add: | ||
< | <syntaxhighlight>maps\mp\_interactive_objects::init();</syntaxhighlight> | ||
And to the .csv file we add: | And to the .csv file we add: | ||
< | <syntaxhighlight>rawfile,maps/mp/_interactive_objects.gsc | ||
fx,destructibles/fx_barrelexp_mp | fx,destructibles/fx_barrelexp_mp | ||
Line 15: | Line 15: | ||
fx,destructibles/fx_barrel_fire_top | fx,destructibles/fx_barrel_fire_top | ||
xmodel,exploding_barrel_test_d</ | xmodel,exploding_barrel_test_d</syntaxhighlight> | ||
=== Preparing your map === | === Preparing your map === | ||
We first select a barrel | *We first select a barrel prefab, grab one [http://wiki.modsrepository.com/codww_files/codww_explodable_barrel.zip HERE] | ||
*Once you have the file, unzip in your COD folder | |||
Right click in the 2D grid and click misc -> | *Back in Radiant, Right click in the 2D grid and click misc -> prefab. Now browse to your [root]/map_source/_prefabs/interactable_objects/ directory, select the file called '''explodable_barrel.map''', click Open and the prefab will appear in the map. Move it around till it's settled.<br> | ||
=== Calling the script === | === Calling the script === | ||
Line 40: | Line 27: | ||
Now, in our .gsc file, located in [root]/raw/maps/mp/mp_[mapname].gsc, we need to add the following line (you can edit .gsc files using notepad): | Now, in our .gsc file, located in [root]/raw/maps/mp/mp_[mapname].gsc, we need to add the following line (you can edit .gsc files using notepad): | ||
< | <syntaxhighlight>maps\mp\_interactive_objects::init();</syntaxhighlight> | ||
So, your .gsc file might become: | So, your .gsc file might become: | ||
< | <syntaxhighlight>main() | ||
{ | { | ||
maps\mp\_interactive_objects::init(); // added line | maps\mp\_interactive_objects::init(); // added line | ||
Line 64: | Line 51: | ||
// enable new spawning system | // enable new spawning system | ||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true); | maps\mp\gametypes\_spawning::level_use_unified_spawning(true); | ||
}</ | }</syntaxhighlight> | ||
=== Adding it to the FastFile === | === Adding it to the FastFile === | ||
Line 70: | Line 57: | ||
To use the script we call in out .gsc file, we need to include it into our .ff file. Go to [root]/zone_source/mp_[mapname].csv and open it using notepad. Add the following lines to it (on it's own row!): | To use the script we call in out .gsc file, we need to include it into our .ff file. Go to [root]/zone_source/mp_[mapname].csv and open it using notepad. Add the following lines to it (on it's own row!): | ||
< | <syntaxhighlight>rawfile,maps/mp/_interactive_objects.gsc | ||
fx,destructibles/fx_barrelexp_mp | fx,destructibles/fx_barrelexp_mp | ||
Line 76: | Line 63: | ||
fx,destructibles/fx_barrel_fire_top | fx,destructibles/fx_barrel_fire_top | ||
xmodel,exploding_barrel_test_d</ | xmodel,exploding_barrel_test_d</syntaxhighlight> | ||
A typical .csv file might now look like this (where mp_test is the map name): | A typical .csv file might now look like this (where mp_test is the map name): | ||
< | <syntaxhighlight>ignore,code_post_gfx_mp | ||
ignore,localized_code_post_gfx_mp | ignore,localized_code_post_gfx_mp | ||
ignore,common_mp | ignore,common_mp | ||
Line 113: | Line 100: | ||
character,char_jap_impinf_player_lmg | character,char_jap_impinf_player_lmg | ||
character,char_jap_impinf_player_cqb | character,char_jap_impinf_player_cqb | ||
character,char_jap_impinf_player_assault</ | character,char_jap_impinf_player_assault</syntaxhighlight> | ||
== Conclusion == | == Conclusion == | ||
Line 121: | Line 108: | ||
[[Image:Daevius_exploding_barrels2.jpg]] | [[Image:Daevius_exploding_barrels2.jpg]] | ||
[[ | [[Category:Call of Duty 5]] | ||
[[ | [[Category:FXs]] | ||
[[ | [[Category:Models]] | ||
[[ | [[Category:Mapping]] |
Latest revision as of 15:16, 16 December 2010
By Daevius
Abstract
We select a model (barrel), make it a script_model, assign it targetname = explodable_barrel and script_noteworthy = explodable_barrel. To the .gsc file we add:
maps\mp\_interactive_objects::init();
And to the .csv file we add:
rawfile,maps/mp/_interactive_objects.gsc
fx,destructibles/fx_barrelexp_mp
fx,destructibles/fx_barrel_ignite
fx,destructibles/fx_barrel_fire_top
xmodel,exploding_barrel_test_d
Preparing your map
- We first select a barrel prefab, grab one HERE
- Once you have the file, unzip in your COD folder
- Back in Radiant, Right click in the 2D grid and click misc -> prefab. Now browse to your [root]/map_source/_prefabs/interactable_objects/ directory, select the file called explodable_barrel.map, click Open and the prefab will appear in the map. Move it around till it's settled.
Calling the script
Now, in our .gsc file, located in [root]/raw/maps/mp/mp_[mapname].gsc, we need to add the following line (you can edit .gsc files using notepad):
maps\mp\_interactive_objects::init();
So, your .gsc file might become:
main()
{
maps\mp\_interactive_objects::init(); // added line
maps\mp\_load::main();
// If the team nationalites change in this file,
// you must update the team nationality in the level's csc file as well!
game["allies"] = "marines";
game["axis"] = "japanese";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["allies_soldiertype"] = "pacific";
game["axis_soldiertype"] = "pacific";
setdvar( "r_specularcolorscale", "1" );
setdvar("compassmaxrange","2100");
// enable new spawning system
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
}
Adding it to the FastFile
To use the script we call in out .gsc file, we need to include it into our .ff file. Go to [root]/zone_source/mp_[mapname].csv and open it using notepad. Add the following lines to it (on it's own row!):
rawfile,maps/mp/_interactive_objects.gsc
fx,destructibles/fx_barrelexp_mp
fx,destructibles/fx_barrel_ignite
fx,destructibles/fx_barrel_fire_top
xmodel,exploding_barrel_test_d
A typical .csv file might now look like this (where mp_test is the map name):
ignore,code_post_gfx_mp
ignore,localized_code_post_gfx_mp
ignore,common_mp
ignore,localized_common_mp
col_map_mp,maps/mp/mp_test.d3dbsp
rawfile,maps/mp/mp_test.gsc
rawfile,vision/mp_test.vision
rawfile,maps/mp/_interactive_objects.gsc
fx,destructibles/fx_barrelexp_mp
fx,destructibles/fx_barrel_ignite
fx,destructibles/fx_barrel_fire_top
xmodel,skybox_mak1
xmodel,exploding_barrel_test_d
sound,common,mp_test,!all_mp
sound,generic,mp_test,!all_mp
sound,voiceovers,mp_test,!all_mp
sound,multiplayer,mp_test,!all_mp
sound,destructibles,mp_test,!all_mp
character,char_usa_raider_player_rifle
character,char_usa_raider_player_cqb
character,char_usa_raider_player_assault
character,char_usa_raider_player_lmg
character,char_usa_raider_player_smg
character,char_jap_impinf_player_smg
character,char_jap_impinf_player_rifle
character,char_jap_impinf_player_lmg
character,char_jap_impinf_player_cqb
character,char_jap_impinf_player_assault
Conclusion
When succeed, exploding barrels will look like this: