Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 114 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page
subscribe
Author Topic: How to- explosive_models
kmabigtime
General Member
Since: Jan 23, 2008
Posts: 162
Last: Apr 22, 2008
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Tuesday, Apr. 22, 2008 12:13 pm
Rasta writes...
Quote:
kmabigtime, how would you like me to post up the tutorial? shall i use your original post or change the code for the updated versions (with permission of there authors obviously)
can you plz post this new one I hve added a few more details, U can make this its own gsc & point to it in your original mapname gsc...adding updated version one now..
@Kill3r, Yeah i dont know about the dyn path either, But when I looked at the Barrel_benzien prefab, those boxes were checked..

edited on Apr. 22, 2008 08:25 am by kmabigtime
Share |
kmabigtime
General Member
Since: Jan 23, 2008
Posts: 162
Last: Apr 22, 2008
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Tuesday, Apr. 22, 2008 12:41 pm
I wanted to make fire extinguishers & propane tanks into explosives, so this is what I came up with..If u need to have the model clipped then you will need to make it a prefab, if no clip is nessessary, then just adding the model to your map will work..

To make the prefab: Open radiant to a new map, add the model you wish to use, make it a script_model with key: targetname, value: explodable_model & check the the 2 no shadow boxes..Unselect it.
Then clip it & make the clip a script_brushmodel & I check the dyna path box..Unselect it.
Now you need select the model first, then the clip & press W..
Make sure you line align the blue box of the model to (0,0,0) on the grid, then save in your prefab folder...

If no clip is nessessary (as in something small, like the fire extinguisher), just add the model directly to your map, make it a script_model with key: targetname, value: explodable_model.

You can put this script into its own "_explosive_models.gsc" & place it in the raw/maps/mp folder along with the other gsc's.
Then add this line in your mapname.gsc: maps\mp\_explosive_models::main();
& update your zone file with this line: rawfile,maps/mp/_explosive_models.gsc

Here is the script
Code:
main()
{
models = getentarray("explodable_model", "targetname");
if (models.size > 0)
{
level.breakables_fx["explode"] = loadfx( "explosions/grenadeexp_metal" );
}

level.barrelExpSound = "explo_metal_rand";

for(i = 0; i < models.size; i++)
{
models[i] thread explodable_model_think();
} 
}

explodable_model_think()
{
//targeted brushmodels take priority over proximity based breakables - nate
if (isdefined(self.target))
{
targ = getent(self.target,"targetname");
if(targ.classname == "script_brushmodel")
{
self.remove = targ;
}
}
accumulate = 40;
threshold = 0;
dmg = 0;

self setcandamage(true);
while(1)
{
self waittill("damage", amount, other);
if (amount >= threshold)
{
dmg += amount;
if (dmg >= accumulate)
{
self thread explodable_model_explode();
}
}
}
}

explodable_model_explode()
{ 
Self = getentarray("explodable_model", "targetname");

if (isdefined (self.remove))
{
self.remove delete();
} 

if(isdefined(self))
{
origin = self getorigin();
range = 200;
maxdamage = 200;
mindamage = 1;

self playsound (level.barrelExpSound);
playfx(level.breakables_fx["explode"], origin);
radiusDamage(origin, range, maxdamage, mindamage);

self delete();
} 

}


The maxdamage, range, & type of grenade blast used for the explosion can be adjusted to whatever you want...

I hope this is useful...


kmabigtime aka [aSu]BigTime! (asuclan.com)








edited on Apr. 22, 2008 08:45 am by kmabigtime
Share |
Restricted Access Topic is Locked
Page
Previous Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»