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

Members Online

»
0 Active | 12 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
Author Topic: Wood & Windows
MistaObvious
General Member
Since: Jul 5, 2006
Posts: 26
Last: Aug 3, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Sunday, Jul. 23, 2006 12:18 am
Yea, that thread "alert_sound" was from a tutorial in the original cod section. I have since removed it as you're right, it doesn't make sense. Aside from the fact that it doesn't work.

Now, looking at the Provence map and comparing it to mine, neither have that "trigger" code you referred to. So lemme real quick go over what I have:
In the main gsc:
Code:
main() {

	maps\mp\_load::main();
	maps\mp\mp_opcenter_fx::main();

game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

}


In the fx:
Code:
main()
{
	precacheFX();

	level.scr_sound["glassbreak"]	= "glassbreak";

}

precacheFX()
{

	level._effect["glassbreak"] = loadfx ("fx/explose/vitre_explo.efx");

} 


And the sound alias:
Code:
name,sequence,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage

null,,null.wav,,,,,,,,,,,,,,,,,,,

#fenetre

glassbreak,,misc/vitre.wav,1,,,,,50,1400,voice,streamed,,,mp_opcenter


In the map I have the broken window, overlayed with the unbroken window, overlayed with a trigger (1 unit larger than the window on ALL visible sides). Each has a key/value of script_exploder/10. I then have an FX model directly in the middle of the window with two key/values, one the same as the window and another is script_fxid/glassbreak. I also have a script_origin a slight distance away from the window that's connected (W in radiant) to the FX model.

Should there be something in the trigger to play the sound? I mean a key/value? Because like I said, the Provence map doesn't have anything int he code about playing the sound except what we discussed above (in the precache()).
Share |
FlesyM
General Member
Since: Jul 24, 2005
Posts: 399
Last: Jan 24, 2008
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Sunday, Jul. 23, 2006 06:31 am
ha ok now I understand.... i should have read the tutorial you are refering too ....

yes it seems you'll need a script_model that has some key/value in order to be recongnized by the line
level.scr_sound["glassbreak"] = "glassbreak";

I thought I saw that line somewhere else ... and indeed there's one for the SD objectives in the _fx.gsc ! so I took a look at the the sd objectives prefabs and noticed that the broken model has the key/value : script_sound/flak88_explode
so in your case it would be script_sound/glassbreak ??

I think that should help you :).

now that I think of it, the Provence mapper probably also made his exploding barrels the same way .... no script required ... using exploders. well I think I should start to learn exploders a bit. now that I see what it can do ...
Share |
Tridon
General Member
Since: Jan 25, 2006
Posts: 232
Last: Nov 28, 2010
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Jul. 23, 2006 07:20 am
That was exactly it. Works like a charm. Here's the line I added to my soundaliases file for the sound effect I wanted.
Code:
glassbreak,,glass/glass04.wav,1,,,,,50,1400,auto,streamed,,,mp_tridon

Look in the iw_05.iwd file for the breaking glass sounds.
Thanks FlesyM
Share |
MistaObvious
General Member
Since: Jul 5, 2006
Posts: 26
Last: Aug 3, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Sunday, Jul. 23, 2006 03:25 pm
Thanks to both of you! Finally got it to work (had to do it a couple times because of texture issues, but otherwise complete success). Using your logic and Tridon's soundalias I finally got it all to work perfectly. Now I just have to figure out how I'm going to get a radar dish in my map!

Quick question, tho. Let's say I have 40 windows throughout the map. Will I need them all to be numbered uniquely as opposed to a simple copy/paste or making this window into a prefab? What I mean is the exploder (key: script_exploder; value: 10). Can they all be 10, or will I have to number each from 10 - 49 so they're all unique? I'm guessing I'll soon find out, right?
Share |
MistaObvious
General Member
Since: Jul 5, 2006
Posts: 26
Last: Aug 3, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Sunday, Jul. 23, 2006 05:16 pm
I copied and modified the tutorial "Breakable Glass w/o Scripting" on my clan's forums to better suit CoD2. ModsOnline is welcome to add it to the tutorial section if they want (modify it any way you want, too). I don't really care about the credit, either, since all the work was done by the original author, FlesyM, Tridon (for the soundalias) and Pierrambo (who made the EFX file for Provence Beta). So credit those guys if you credit anyone at all. Anyway, here's the link:
http://www.team-pnx.com/forum/viewtopic.php?t=743&highlight=

And the EFX: http://www.team-pnx.com/pafile/index.php?act=view&id=6
Share |
FlesyM
General Member
Since: Jul 24, 2005
Posts: 399
Last: Jan 24, 2008
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Sunday, Jul. 23, 2006 05:36 pm
MistaObvious writes...
Quote:
Thanks to both of you! Finally got it to work (had to do it a couple times because of texture issues, but otherwise complete success). Using your logic and Tridon's soundalias I finally got it all to work perfectly. Now I just have to figure out how I'm going to get a radar dish in my map!

Quick question, tho. Let's say I have 40 windows throughout the map. Will I need them all to be numbered uniquely as opposed to a simple copy/paste or making this window into a prefab? What I mean is the exploder (key: script_exploder; value: 10). Can they all be 10, or will I have to number each from 10 - 49 so they're all unique? I'm guessing I'll soon find out, right?

really good question. I don't know as I haven't looked at exploders yet. it's worth to try ... prefabs would be sweet... but considering that snd objectives A are script_exploder/1 and B are script_exploder/2 ... I doubt it.

radar dish should be quite simple ... you mean a rotating dish right ? it involves scripting, but it's quite simple. do a script_brushmodel of a dish, with an origin brush at the rotation point and give it some targetname.
- retrieve the entity
dish = getent("some name", "targetname");
- start a thread
dish thread dishRotate()
- the thread being :
dishRotate()
{
while (isdefined(self)) {
//1 turn in 2 sec
self rotateyaw(360,2,0,0);
}
}
Share |
Tridon
General Member
Since: Jan 25, 2006
Posts: 232
Last: Nov 28, 2010
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Jul. 23, 2006 07:10 pm
All the windows will have to have a unique name. If you leave them all as key: script_exploder; value: 10, every window on the map will break at the same time once one window is hit. Name them like you said, from 10-49.
Share |
MistaObvious
General Member
Since: Jul 5, 2006
Posts: 26
Last: Aug 3, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Sunday, Jul. 23, 2006 07:16 pm
Thanks, Tridon. I'll keep that in mind.

@FlesyM: I was actually talking about an xmodel and wasn't really worried about the rotation since I'm just doing a port of Op Center from MOHAA. Thanks, tho, I'll keep that in mind if I need it. I might just replace the radar dish, tho, and try something else for the objective.
Share |
Tridon
General Member
Since: Jan 25, 2006
Posts: 232
Last: Nov 28, 2010
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Monday, Jul. 24, 2006 12:35 am
Everything works fine except for one thing. When I throw a grenade at the window it bounces off but won't trigger the broken glass until it explodes. I changed the brushes (glass) to non-colliding so that when you shoot, the bullets will pass through. When I shoot the glass it triggers the breaking glass and leaves a bullet hole on the wall. Perfect, right? Not exactly. Now when I throw a grenade at the glass it goes right through but doesn't trigger the breaking glass. I also made a brush out of the clip_weap_glass texture and put it over my glass. What this does is add the glass breaking sound without using, Key: script_sound or adding the script to your _fx.gsc or your soundaliases. Doing it this way, I still have grenades bouncing off the window and if I make the clip_weap_glass texture brush as non-colliding, there's no glass breaking sound anymore. No matter what I do, I can't get grenades to break the glass except by them exploding. I want to have grenades break the glass and go through when throwing them at it. Any help with this would be greatly appreciated.
Share |
MistaObvious
General Member
Since: Jul 5, 2006
Posts: 26
Last: Aug 3, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Monday, Jul. 24, 2006 02:20 am
I hadn't actually tried that yet, so thanks for pointing that out. Mine's the same way, grenades will not pass through. Only damage-causing entities will break the glass and/or pass through.

I have to wonder, what's the trigger-multiple for? Can you use that, assign the variables for damage and also for grenades passing through? Do you have to have a looping script that waits for a grenade to hit the trigger?

I know I've seen this mentioned somewhere else before, but since I hadn't been able to get as far as the window breaking at all I didn't pay much attention to it. There must be a way to have that trigger work when a grenade hits it.
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»