random explosions
Moderator: Moderators
-
echo_rancid
- Captain
- Posts: 264
- Joined: Sat Jan 31, 2004 4:31 pm
random explosions
I want to make a few random explosions on my map, occur throughout the time of the map...as in planes dropping bombs but I don't want it to do damage to players. Im gonna check the Tuts on here but thought I post the question in case I cannot find what Im looking for.

-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
-
echo_rancid
- Captain
- Posts: 264
- Joined: Sat Jan 31, 2004 4:31 pm
Okay I did all that and now my script won't work at all.
No ambient sound
No fire sound
No river sound
No explosions
Whats wrong?
// STORM ON REVIN
// ARCHITECTURE: WD_Echo_Rancid
// SCRIPTING: WD_Echo_Rancid
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Storm on Revin"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "WD_Echo_Rancid"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"
exec global/exploder.scr
level waitTill prespawn
thread start_sound
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/dm/storm_on_revin.scr
exec global/ambient.scr mohdm1
level waittill spawn
thread random_explode1
end
start_sound:
wait 1
$fire_speaker loopsound fire_med
end
start_sound:
wait 1
$river_speaker loopsound river
end
random_explode:
wait (randomfloat 13 + 23)
$random_explode anim start
radiusdamage $random_explode 256 384
goto random_explode1
end
Ill check and make sure my targetnames are correct, but im almost positive they are.
Any thoughts? Thanks.
No ambient sound
No fire sound
No river sound
No explosions
Whats wrong?
// STORM ON REVIN
// ARCHITECTURE: WD_Echo_Rancid
// SCRIPTING: WD_Echo_Rancid
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Storm on Revin"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "WD_Echo_Rancid"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"
exec global/exploder.scr
level waitTill prespawn
thread start_sound
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/dm/storm_on_revin.scr
exec global/ambient.scr mohdm1
level waittill spawn
thread random_explode1
end
start_sound:
wait 1
$fire_speaker loopsound fire_med
end
start_sound:
wait 1
$river_speaker loopsound river
end
random_explode:
wait (randomfloat 13 + 23)
$random_explode anim start
radiusdamage $random_explode 256 384
goto random_explode1
end
Ill check and make sure my targetnames are correct, but im almost positive they are.
Any thoughts? Thanks.

-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
If nothing works like that, the script probably isn't loaded at all. Check your console for script related errors.
And in the script you call a method named random_explode1... that does not exist: you should call random_explode.
And I would have the random_explode method look like this ( goto is the DEVIL ) :
And in the script you call a method named random_explode1... that does not exist: you should call random_explode.
And I would have the random_explode method look like this ( goto is the DEVIL ) :
Code: Select all
random_explode:
while(1) // Forever
{
wait (randomfloat 13 + 23)
$random_explode anim start
radiusdamage $random_explode 256 384
}
endthread random_explode1
Yep, your script is calling for thread random_explode1 under level waittill spawn, and there is no thread by that name. Take out the radiusdamage line, if you don't want it to hurt players.
-
echo_rancid
- Captain
- Posts: 264
- Joined: Sat Jan 31, 2004 4:31 pm
Okay here is what I got now:
// STORM ON REVIN
// ARCHITECTURE: WD_Echo_Rancid
// SCRIPTING: WD_Echo_Rancid
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Storm on Revin"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "WD_Echo_Rancid"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"
exec global/exploder.scr
level waitTill prespawn
thread start_sound
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/dm/storm_on_revin.scr
exec global/ambient.scr mohdm1
level waittill spawn
thread random_explode
end
start_sound:
wait 1
$fire_speaker loopsound fire_med
end
start_sound:
wait 1
$river_speaker loopsound river
end
random_explode:
while(1) // Forever
{
wait (randomfloat 13 + 23)
$random_explode anim start
}
end
Still doesn't work...I used to have the ambient sound working but when i added the fire sound, river sound, and explosions it would not work...Even the ambient sound is gone now...Under the console it says a bunch of things to add to my script precache file...Do I need to do this???
One more question is there a way to copy whats in console other than screenshot?
Thanks
// STORM ON REVIN
// ARCHITECTURE: WD_Echo_Rancid
// SCRIPTING: WD_Echo_Rancid
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Storm on Revin"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "WD_Echo_Rancid"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"
exec global/exploder.scr
level waitTill prespawn
thread start_sound
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/dm/storm_on_revin.scr
exec global/ambient.scr mohdm1
level waittill spawn
thread random_explode
end
start_sound:
wait 1
$fire_speaker loopsound fire_med
end
start_sound:
wait 1
$river_speaker loopsound river
end
random_explode:
while(1) // Forever
{
wait (randomfloat 13 + 23)
$random_explode anim start
}
end
Still doesn't work...I used to have the ambient sound working but when i added the fire sound, river sound, and explosions it would not work...Even the ambient sound is gone now...Under the console it says a bunch of things to add to my script precache file...Do I need to do this???
One more question is there a way to copy whats in console other than screenshot?
Thanks

-
echo_rancid
- Captain
- Posts: 264
- Joined: Sat Jan 31, 2004 4:31 pm
Alright got everything working...the problem is I don't know how I did it...
, I think It had to do with that river sound...Illtry to figure out what I did...One more thing though...The explosion that nemisis said to use was "tank", cannot find that one...I want the explions that happen on omaha...Which explosion is that??? Thanks guys.

-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Here is another idea for you and is easy to use . Make script origins all over your map and give them the targetname mortar then run this thread
mortars:
for(local.i=1;local.i<=$mortar.size;local.i++)
$mortar[local.i] thread mortar_active
end
mortar_active:
while(1)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if(vector_length ( $player[local.i].origin - self.origin) < 500)
{
exec global/model.scr self.origin
if(self.target)
(self.target) delete
wait (randomint( 10)+5)
}
}
waitframe
}
end
In this example if the player is within 500 units of a mortar it will explode and keep explodeing at random times between 5 and 14 seconds . Also in this map I have craters that are covered by patch meshes that look like the terrain . I made the patch meshes script_objects and had the script_origins target them . Once the mortar explodes the patch is deleted and then you see the crater .
The global/model.scr executes an explosion you can give it the .tik you want and the scale like this
exec global/model.scr $mything.origin models/emitters/explosion_tank.tik 2
the default is models/emitters/explosion_mine
mortars:
for(local.i=1;local.i<=$mortar.size;local.i++)
$mortar[local.i] thread mortar_active
end
mortar_active:
while(1)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if(vector_length ( $player[local.i].origin - self.origin) < 500)
{
exec global/model.scr self.origin
if(self.target)
(self.target) delete
wait (randomint( 10)+5)
}
}
waitframe
}
end
In this example if the player is within 500 units of a mortar it will explode and keep explodeing at random times between 5 and 14 seconds . Also in this map I have craters that are covered by patch meshes that look like the terrain . I made the patch meshes script_objects and had the script_origins target them . Once the mortar explodes the patch is deleted and then you see the crater .
The global/model.scr executes an explosion you can give it the .tik you want and the scale like this
exec global/model.scr $mything.origin models/emitters/explosion_tank.tik 2
the default is models/emitters/explosion_mine
sounds
start_sound:
wait 1
$fire_speaker loopsound fire_med
$river_speaker loopsound river
end
wait 1
$fire_speaker loopsound fire_med
$river_speaker loopsound river
end

