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

Members Online

»
0 Active | 94 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 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
Next Page
subscribe
Author Topic: Wood & Windows
Bull90
General Member
Since: Mar 13, 2006
Posts: 178
Last: Aug 19, 2009
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Jun. 21, 2006 06:42 pm

I need a script that i can shoot somthing and break it.

shoot a windows and it breaks

and shoot a board covering a window


can somone get me the script and past it in there post![rocking]
Share |
Bull90
General Member
Since: Mar 13, 2006
Posts: 178
Last: Aug 19, 2009
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Jun. 21, 2006 10:54 pm
is it possible to make a windows that you can look threw and sniper threw shoot threw and break.

like a small layer of glass
Share |
ROTCGuy
General Member
Since: May 30, 2004
Posts: 265
Last: Mar 18, 2009
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Jun. 21, 2006 11:55 pm
Look for breakable windows int he CoD mapping section.
Share |
Tridon
General Member
Since: Jan 25, 2006
Posts: 232
Last: Nov 28, 2010
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Jun. 22, 2006 10:39 am
-=MO=-|Bull| writes...
Quote:
is it possible to make a windows that you can look threw and sniper threw shoot threw and break.

like a small layer of glass

http://www.modsonline.com/Tutorials-read-117.html

edited on Jun. 22, 2006 06:39 am by Tridon
Share |
MistaObvious
General Member
Since: Jul 5, 2006
Posts: 26
Last: Aug 3, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Thursday, Jul. 20, 2006 01:53 pm
Ok, first let me appologize for digging up a dead topic, but I've got a problem. The tutorial linked here was originally written for the original CoD. Problem I have is that there's no efx for shattered glass, and on further inspection of that efx from the original is there's no xmodel either.

Now, mind you that I've seen it is possible for CoD2 as Provence Beta has the windows scripted. But the problem I have is that I can't read the code (haven't even gotten too heavy into the scripting side of things yet) and have no idea how he (the mapper) did it. So, I want to script my windows to break, but have no idea where to begin. Seems like a lot of people have been looking for this, but the answer's always more or less the same and yet it appears I'm the only one getting stumped at the FX portion of it. Am I missing something? Is there a tutorial on this somewhere? I tried looking at the exploder tutorial, but the glass portion of that won't work either (got a syntax error on the script). Can someone plz help?
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Thursday, Jul. 20, 2006 06:05 pm
Ty getting into scripting a bit then... it's all in there most likely.. including the effects he used.
Share |
Tridon
General Member
Since: Jan 25, 2006
Posts: 232
Last: Nov 28, 2010
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Jul. 20, 2006 08:56 pm
Try this tutorial.

http://www.modsonline.com/Tutorials-read-146.html
Share |
MistaObvious
General Member
Since: Jul 5, 2006
Posts: 26
Last: Aug 3, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Jul. 21, 2006 01:31 am
I tried that tutorial. Just before posting here, actually. I got a script error when I tried to test it, tho. I'll give it another go and see what's up so I can see what you guys think.

As for getting into scripting, the concepts I have down (basic scripting concepts, that is) since I've done some scripting in other languages before. But my problem is time right now. I barely have enough time right now to try mapping (which I'm still learning), nevermind trying to learn a new language. Hopefully this weekend I can look at it more in depth and try to put something together, but it's hard to say if that'll happen or not.
Share |
MistaObvious
General Member
Since: Jul 5, 2006
Posts: 26
Last: Aug 3, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Jul. 21, 2006 12:38 pm
Ok, I got it figured out. First, reason I couldn't understand the scripting by the dude who made Provence is because it's in French. BUT it finally occured to me that I was staring at an EFX file. So I compared that to a stock EFX and realised it was pretty much the same. So I tried it using the "breakable glass without scripting" tutorial and sure enough, it worked.

I now have a new problem. There's no sound for the glass. I copied the soundalias (erased all the lines not pertaining to the glass) which looks like this:
Code:
glassbreak,,misc/vitre.wav,1,,,,,50,1400,voice,streamed,,,mp_opcenter


I then copied a couple lines to my gsc:
Code:
main()
{
	precacheFX();

	level.scr_sound["vitre_explode"]	= "vitre_explode";
}

precacheFX()
{

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

} 


I looked all over his original code, but found no other code pertaining to "vitre" (vitre_explo.efx being the FX file for the glass breaking). Now, as far as I could tell from the tutorials I've looked at, I could essentially attach the sound to the same trigger... right? That being the case, I tried adding "thread alert_sound();" to the main() of my fx.gsc and then creating a thread that looked like this:

Code:
alert_sound()
{
 alerts = getentarray ("glassbreak", "targetname");
 while (1)
 {
  
  {
   for (i=1;i
    alerts[0] playsound("vitre_explode");

   alerts[0] playsound("vitre_explode");
   
   wait (56.6);

     self thread alert_sound();

     return;
  }
  }
 }


Now that I'm typing this out, I'm realizing that the for line is missing code. This is how it's displayed in the tutorial. So, what am I missing? Could is finish this line off with "(i=1;i>10;i++)"? I quickly tried that, but CoD would hang while loading the map (I'm assuming the loop was hanging it).

I'm missing so much here (over my head). So can anyone help me out in associating a sound with this breaking glass?
Share |
FlesyM
General Member
Since: Jul 24, 2005
Posts: 399
Last: Jan 24, 2008
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Saturday, Jul. 22, 2006 06:51 pm
that specific for line should be:
for (i =0; i < alerts.size; i++)
but that script of yours don't make sense really :). as far as I'm concerned, the sound lines should already be in there ...

find in the script the code relating to when the trigger gets triggered. haven't look at the code but it should be something like this :
Code:
<trigger> waittill("damage");


following this line should be the "window break" script... effect playing, replacement of the intact window to a broken one ... something like that. now what you want to do for sound is add a line right beside the effect one, so the sound plays at the same time as the effect does.
Code:
<entity> playsound ("<sound name>")

entity being some entity, like the window itself. sound name is defined in the soundaliases file.

if the code already has a playsound line, then it's probably an error in the sound name. I see that you've called the sound "glassbreak" in the soundaliases, but have level.scr_sound["vitre_explode"] = "vitre_explode"; in the main. I would try to name the sound in the soundalias "vitre_explode" instead if see if that works.
Share |
Restricted Access Topic is Locked
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

»