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

Members Online

»
0 Active | 62 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 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Scripting help request...
timb0
General Member
Since: Feb 3, 2008
Posts: 68
Last: Mar 16, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Wednesday, Feb. 11, 2009 08:41 am
Hello guys,

Here's the deal: I've been working on a map for many months now. There are alot of custom models in the map. I have the 'whole' model & the destroyed version, both clipped with metal, mantle etc. Been using kmabigtime's direction on exploding model. What would be most-helpful is: A generic script into which I could plug the various models' name so that the clipped model/prefab will explode & be replaced by the clipped & destroyed version. Catching fire would be a bonus. Gonna learn me some scripting in the near future, just would love to finish work on this map first. Been looking at the explodable barrels script to get an idea of how it might be done. Any help would be greatly appreciated.

Tim
Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD4 Scripting
Posted: Wednesday, Feb. 11, 2009 02:27 pm
"script_exploders" is a feature built into the game and has been used since COD1, it allows you to make a model or brush disappear and spawn a destroyed version, you can also then play FX aswell.

works on script_models and script_brushmodels

So let's say you have a script_model:

classname script_model

script_exploder 11
(a new number for each exploder you make, or prefab them, then you can have duplicate exploders in your map! 1-10 may be taken up by gametypes)

model anymodelyouwant

Now you have to define the model that appears after this one disappears:

classname script_model

script_exploder 11

targetname exploder


Now lets set off this with a trigger:

classname trigger_damage

script_exploder 11

// you can then tick off the boxes in the Entity editor to your needs and set an "accumulate" too if needs be.

You want FX too??
OK:

classname script_model

model fx

script_fxid bloody (whatever name you used to precahce)

targetname exploder

script_exploder 11

Place this wherever you want your FX to spawn, then write your FX::

yourmapname_fx.gsc

Code:

#include maps\_utility; 

#include common_scripts\utility;


main()
{
precacheFX();
}

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


And have your FX inside your zone source:

yourmapname.csv

fx,impacts/fx_flesh_blood_geyser




Share |
timb0
General Member
Since: Feb 3, 2008
Posts: 68
Last: Mar 16, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Wednesday, Feb. 11, 2009 09:09 pm
Thank you for the reply. These clipped models I have saved as prefabs, do I need to enter the prefab & make the model portion a script model & the clip portion a script brushmodel?

Tim
Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD4 Scripting
Posted: Wednesday, Feb. 11, 2009 09:16 pm
Exactly right, enter the prefab, change your model to a script_model and select any clip brushes and make them script_brushmodels. Then follow the steps above.

Once you save, you can exit prefab. You can then copy the prefab around your map and everything should work well.

As a note, lets say you have a model which has a damage model not too dissimilar (i.e the clip brushes would stay the same for both models) from the intact version, then obviously just leave one set of clip brushes, they can stay as normal brushes.
Share |
timb0
General Member
Since: Feb 3, 2008
Posts: 68
Last: Mar 16, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Thursday, Feb. 12, 2009 01:02 pm
Script runtime error: type undefined is not an int?
Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD4 Scripting
Posted: Thursday, Feb. 12, 2009 01:18 pm
Double check you've typed the correct keys/values and make sure your calling the _load in your yourmapname.gsc

Load your map with (in the console)

/developer 2
/devmap yourmapname

And then drop the extended console to see if it gives you more information about the error. ("¬" + "shift")
Share |
timb0
General Member
Since: Feb 3, 2008
Posts: 68
Last: Mar 16, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Friday, Feb. 13, 2009 10:28 am
Yessir, you are correct. That's what was missing. I successfully (with your direction) executed ammo_cookoff, now I get a big red 'fx' saying Im missing the sound. Gonna have to read some tutorials on this. Looking at the .gsc's at the top of the file, I see there is Alot of information to digest.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

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

»