| Author |
Topic: Script damage and sound |
| Mystic |
 |
General Member Since: Apr 10, 2004 Posts: 6147 Last: Apr 15, 2018 [view latest posts] |
|
|
 |
 |
|
Category: CoD2 MP Mapping Posted: Sunday, Apr. 30, 2006 02:51 pm |
 |
I'm having trouble for some reason i can't get my head around this today.. Pretty simple result yet i can't seem to crack it, need a fresh pair of eyes because i'm probably missing something stupid.
Problem is i can't seem to get the sound or radius damage to work, any help appreciated!
Code: trigger_fx()
{
fx_trigger = getent("flak_explosion", "targetname");
if(!isDefined(fx_trigger))
return;
level.fxstate = false;
origin = fx_trigger getorigin();
while(1) {
fx_trigger waittill("trigger");
fx_trigger playsound("building_explo");
radiusDamage(origin, 500, 2000, 1000);
if(level.fxstate == false) {
level.fxstate = true;
thread loopfx("smokey01", (-136, -752, -16), 1, 0, 600);
thread loopfx("flame01", (-280, -880, 11), 1, 0, 600);
thread loopfx("flame01", (-24, -968, 112), 1, 0, 600);
}
else if(level.fxstate == true) {
level.fxstate = false;
}
}
}
loopfx(fxId, fxPos, waitime, fxStart, fxStop) {
if(!isDefined(level.fxstate))
level.fxstate = true;
if(!isDefined(fxStop))
fxStop = 600;
if(!isDefined(fxStart))
fxStart = 1;
if(!isDefined(waitime))
waitime = 1;
loop_count = 0;
wait (fxStart);
while (level.fxstate && loop_count < fxStop) {
playfx(level._effect[fxId], fxPos);
loop_count++;
wait (waitime);
} |
 |
|
|
| StrYdeR |
General Member Since: May 11, 2004 Posts: 11671 Last: Oct 7, 2021 [view latest posts] |
|
|
 |
 |
|
Category: CoD2 MP Mapping Posted: Sunday, Apr. 30, 2006 02:56 pm |
 |
well - ill ask the obvious for the sound...did you make a csv?
as for the rest....the script looks solid, though there may be a problem with your naming conventions
i advise to stay away from words like
fx
trigger
and other things that refer to or could refer to builtin modifiers
try that and see if that works
edit...isnt the sound supposed to look something like
playsound =("", );
![[angryalien]](images/BBCode/smilies/angryalien.gif)
edited on Apr. 30, 2006 11:01 am by StrYdeR |
|
|
|
| Mystic |
 |
General Member Since: Apr 10, 2004 Posts: 6147 Last: Apr 15, 2018 [view latest posts] |
|
|
 |
 |
|
|
| StrYdeR |
General Member Since: May 11, 2004 Posts: 11671 Last: Oct 7, 2021 [view latest posts] |
|
|
 |
 |
|
|
| StrYdeR |
General Member Since: May 11, 2004 Posts: 11671 Last: Oct 7, 2021 [view latest posts] |
|
|
 |
 |
|
Category: CoD2 MP Mapping Posted: Sunday, Apr. 30, 2006 03:11 pm |
 |
BAH!
saw what this damned bbs did to my post
was supposed to say
modifier playsound =(" alias", origin);
![[angryalien]](images/BBCode/smilies/angryalien.gif) |
|
|
|
| Mystic |
 |
General Member Since: Apr 10, 2004 Posts: 6147 Last: Apr 15, 2018 [view latest posts] |
|
|
 |
 |
|
Category: CoD2 MP Mapping Posted: Sunday, Apr. 30, 2006 03:19 pm |
 |
Right i edited the script according to your post.
Havn't tested to see if the line makes a difference but i'll go check now! If you have any ideas on the ambient then im all ears!
[Edit] I seem to get a bad syntax error with that script change:
Code: fx_trigger playsound =("building_explo",origin);
edited on Apr. 30, 2006 11:29 am by Rasta |
 |
|
|
| Bodger2 |
General Member Since: Sep 4, 2004 Posts: 132 Last: Aug 5, 2006 [view latest posts] |
|
|
|
|
| Mystic |
 |
General Member Since: Apr 10, 2004 Posts: 6147 Last: Apr 15, 2018 [view latest posts] |
|
|
 |
 |
|
Category: CoD2 MP Mapping Posted: Sunday, Apr. 30, 2006 03:51 pm |
 |
Ok thanks bodger, i'm trying something different, just compiling, i have included a script origin (targetname of house_sound) where i want the sound to play. In the script i added/chaged it to look like this:
Quote: trigger_fx()
{
fx_trigger = getent("flak_explosion", "targetname"); //trigger targetname
if(!isDefined(fx_trigger))
return;
level.fxstate = false;
soundorigin = getent("house_sound","targetname"); //get the origin
origin = fx_trigger getorigin();
while(1) {
fx_trigger waittill("trigger"); //wait untill its triggered
soundorigin playsound("building_explo"); //play the sound
//fx_trigger playsound("building_explo"); //KABOOM!
radiusDamage(origin, 500, 2000, 1000); //ouch
if(level.fxstate == false) {
level.fxstate = true;
thread loopfx("smokey01", (-136, -752, -16), 1, 0, 600); //fx location (SMOKE)
thread loopfx("flame01", (-280, -880, 11), 1, 0, 600); //fx location (SMALL FLAME)
thread loopfx("flame01", (-24, -968, 112), 1, 0, 600); //fx location (SMALL FLAME)
}
else if(level.fxstate == true) {
level.fxstate = false;
}
}
}
loopfx(fxId, fxPos, waitime, fxStart, fxStop) {
if(!isDefined(level.fxstate))
level.fxstate = true;
if(!isDefined(fxStop))
fxStop = 600;
if(!isDefined(fxStart))
fxStart = 1;
if(!isDefined(waitime))
waitime = 1;
loop_count = 0;
wait (fxStart);
while (level.fxstate && loop_count < fxStop) {
playfx(level._effect[fxId], fxPos);
loop_count++;
wait (waitime);
}
If anybody can see any problem then tell me please ..
Cheers
[EDIT] Ok tested and exactly the same.. No sound and No radius damage!
edited on Apr. 30, 2006 11:59 am by Rasta |
 |
|
|
| Bodger2 |
General Member Since: Sep 4, 2004 Posts: 132 Last: Aug 5, 2006 [view latest posts] |
|
|
|
|
| Mystic |
 |
General Member Since: Apr 10, 2004 Posts: 6147 Last: Apr 15, 2018 [view latest posts] |
|
|
 |
 |
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|