Page 1 of 1
random explosions
Posted: Thu Mar 04, 2004 7:03 pm
by echo_rancid
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.
Posted: Fri Mar 05, 2004 12:11 am
by Bjarne BZR
Posted: Fri Mar 05, 2004 5:39 am
by echo_rancid
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.
Posted: Fri Mar 05, 2004 9:57 am
by Bjarne BZR
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 ) :
Code: Select all
random_explode:
while(1) // Forever
{
wait (randomfloat 13 + 23)
$random_explode anim start
radiusdamage $random_explode 256 384
}
end
thread random_explode1
Posted: Fri Mar 05, 2004 10:18 am
by tltrude
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.
Posted: Fri Mar 05, 2004 4:51 pm
by echo_rancid
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
Posted: Fri Mar 05, 2004 9:53 pm
by echo_rancid
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.
Posted: Fri Mar 05, 2004 10:16 pm
by Bjarne BZR
you have two methods named "start_sound"... MOH:AA will be confused as of what method to select. Give them different names and call them separately.
And you can't copy the console text, but you CAN get MOH:AA to write it to the file qconsole.log in main by writing "logfile 1" in console.
Posted: Sat Mar 06, 2004 10:31 am
by bdbodger
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
sounds
Posted: Sat Mar 06, 2004 1:10 pm
by tltrude
start_sound:
wait 1
$fire_speaker loopsound fire_med
$river_speaker loopsound river
end