| Author |
Topic: Explosions at defined points, need some help |
| SWS2000 |
 |
General Member Since: May 12, 2006 Posts: 193 Last: Jun 14, 2008 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Thursday, Feb. 21, 2008 08:13 pm |
 |
I want to have some explosions after my MIG29's flyby my map.
I get some clusterbombs working with the help of the COD totorial about the mortars. But, they only explode random at the differnt places.
I have 4 script_origins in my map with the targetnames mortar1 to mortar4.
The script I am using compiles without error, even the game loads the map and starts it, but no explosions ![[ohwell]](images/BBCode/smilies/ohwell.gif) .
Here is the script I am using Code: main(){
// Specify two different explosion effects to randomly play
level._effect["mortar_explosion"][0] = loadfx("clusterbomb_exp");
level._effect["mortar_explosion"][1] = loadfx("clusterbomb_exp");
// send down the mortars
level thread mortars();
}
mortars()
{
// Get an array of all the mortars in the level
mortar1 = getent ("mortar1","targetname");
mortar2 = getent ("mortar2","targetname");
mortar3 = getent ("mortar3","targetname");
mortar4 = getent ("mortar4","targetname");
// Loop over and over while the level is loaded
while (1)
// Wait XX seconds before doing a mortar explosion
wait (0.1);
// Play the incomming mortar sound effect
mortar1 playsound("mortar_incoming");
// Wait while the imcomming sound plays
wait 2;
// Do the explosion effect
playfx (level._effect["mortar_explosion"], mortar1.origin);
// Play the explosion sound
mortar1 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar1.origin, 500, 2000, 50);
wait (0.1);
playfx (level._effect["mortar_explosion"], mortar2.origin);
// Play the explosion sound
mortar2 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar2.origin, 500, 2000, 50);
wait (0.1);
playfx (level._effect["mortar_explosion"], mortar3.origin);
// Play the explosion sound
mortar3 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar3.origin, 500, 2000, 50);
wait (0.1);
playfx (level._effect["mortar_explosion"], mortar4.origin);
// Play the explosion sound
mortar4 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar4.origin, 500, 2000, 50);
wait (0.1);
}
The file is called mortar.gsc and it is called in my mapname.gsv and in missing assets.
If you have an idea, every help is welcome. |
 |
|
|
| Mystic |
 |
General Member Since: Apr 10, 2004 Posts: 6147 Last: Apr 15, 2018 [view latest posts] |
|
|
 |
 |
|
|
| SWS2000 |
 |
General Member Since: May 12, 2006 Posts: 193 Last: Jun 14, 2008 [view latest posts] |
|
|
|
|
| SparkyMcSparks |
 |
General Member Since: Feb 28, 2004 Posts: 1713 Last: Dec 29, 2016 [view latest posts] |
|
|
 |
|
Category: CoD4 Scripting Posted: Thursday, Feb. 21, 2008 08:49 pm |
 |
Here's what I'm using in my new Backlot SP map for explosions, works well.
Code: ambient_explosions()
{
expo_locs = [];
expo_locs = getEntArray( "random_expo", "targetname" );
while (1)
{
rand = RandomIntRange( 20, 30 );
rand_loc = RandomIntRange( 0, expo_locs.size );
if( (rand == 25) || (rand == 27) )
{
expo_locs[ rand_loc ] PlaySound( "explosion" );
playFx( level._effect[ "explosion" ], expo_locs[ rand_loc ].origin );
wait 0.2;
Earthquake( 0.3, 3, level.player.origin, 500 );
}
else
wait 1;
}
} // ambient_explosions() |
|
|
|
| SWS2000 |
 |
General Member Since: May 12, 2006 Posts: 193 Last: Jun 14, 2008 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Thursday, Feb. 21, 2008 09:28 pm |
 |
Still there are no explosions.
I changed script to:
Code: main(){
// Specify explosion effects to play
level._effect["mortar_explosion"] = loadfx("clusterbomb_exp");
// send down the mortars
level thread mortars();
}
mortars()
{
// Get an array of all the mortars in the level
mortar1 = getentarray ("mortar1","targetname");
mortar2 = getentarray ("mortar2","targetname");
mortar3 = getentarray ("mortar3","targetname");
mortar4 = getentarray ("mortar4","targetname");
// Loop over and over while the level is loaded
while (1)
// Wait XX seconds before doing a mortar explosion
wait (0.1);
// Play the incomming mortar sound effect
mortar1 playsound("mortar_incoming");
// Wait while the imcomming sound plays
wait 2;
// Do the explosion effect
origin = mortar1 GetOrigin();
playfx (level._effect["mortar_explosion"],origin);
// Play the explosion sound
mortar1 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar1.origin, 500, 2000, 50);
wait (0.1);
origin = mortar2 GetOrigin();
playfx (level._effect["mortar_explosion"],origin);
// Play the explosion sound
mortar2 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar2.origin, 500, 2000, 50);
wait (0.1);
origin = mortar3 GetOrigin();
playfx (level._effect["mortar_explosion"],origin);
// Play the explosion sound
mortar3 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar3.origin, 500, 2000, 50);
wait (0.1);
origin = mortar4 GetOrigin();
playfx (level._effect["mortar_explosion"],origin);
// Play the explosion sound
mortar4 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar4.origin, 500, 2000, 50);
wait (0.1);
}
I do not have any clue?
@sparks, randomly I got them to work.
edited on Feb. 21, 2008 04:29 pm by {MASS}Sgt |
 |
|
|
| novemberdobby |
 |
General Member Since: Sep 17, 2006 Posts: 1965 Last: Oct 13, 2013 [view latest posts] |
|
|
 |
|
|
| SWS2000 |
 |
General Member Since: May 12, 2006 Posts: 193 Last: Jun 14, 2008 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Friday, Feb. 22, 2008 03:23 pm |
 |
Mmh,
I put this in line 54
iprintlnbold("LOL TEST");
there is no LOL TEST coming
I have this in my missing assets:
rawfile,maps/mp/mortar.gsc
rawfile,maps/mp/mp_test_fx.gsc
and this in my mapname.gsc
maps\mp\mp_test_fx::main();
maps\mp\_load::main();
maps\mp\mortar::main();
This is in my mp_test_fx.gsc
main()
{
level._effect["mortar_explosion"] = loadfx("clusterbomb_exp");
/#
if ( getdvar( "clientSideEffects" ) != "1" )
maps\createfx\mp_test_fx::main();
#/
}
And I do not have any clue why they do not show up. ![[confused]](images/BBCode/smilies/confused.gif) |
 |
|
|
| novemberdobby |
 |
General Member Since: Sep 17, 2006 Posts: 1965 Last: Oct 13, 2013 [view latest posts] |
|
|
 |
|
|
| SWS2000 |
 |
General Member Since: May 12, 2006 Posts: 193 Last: Jun 14, 2008 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Friday, Feb. 22, 2008 06:02 pm |
 |
No LOL TEST comming
here is my mp_test.gsc
Code: main()
{
maps\mp\mortar::main();
maps\mp\_load::main();
ambientPlay("ambient_backlot_ext");
game["allies"] = "sas";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "woodland";
game["axis_soldiertype"] = "woodland";
setdvar( "r_specularcolorscale", "1" );
setdvar("r_glowbloomintensity0",".25");
setdvar("r_glowbloomintensity1",".25");
setdvar("r_glowskybleedintensity0",".3");
setdvar("compassmaxrange","1800");
}
here is the mortar.gsc
Code: main(){
iprintlnbold("LOL TEST");
// Specify explosion effects to play
level._effect["mortar_explosion"] = loadfx("clusterbomb_exp");
// send down the mortars
level thread mortars();
}
mortars()
{
// Get an array of all the mortars in the level
mortar1 = getentarray ("mortar1","targetname");
mortar2 = getentarray ("mortar2","targetname");
mortar3 = getentarray ("mortar3","targetname");
mortar4 = getentarray ("mortar4","targetname");
// Loop over and over while the level is loaded
while (1)
// Wait XX seconds before doing a mortar explosion
wait (2);
// Play the incomming mortar sound effect
mortar1 playsound("mortar_incoming");
// Wait while the imcomming sound plays
wait 2;
// Do the explosion effect
origin = mortar1 GetOrigin();
playfx (level._effect["mortar_explosion"],origin);
// Play the explosion sound
mortar1 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar1.origin, 500, 2000, 50);
wait (0.1);
origin = mortar2 GetOrigin();
playfx (level._effect["mortar_explosion"],origin);
// Play the explosion sound
mortar2 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar2.origin, 500, 2000, 50);
wait (0.1);
origin = mortar3 GetOrigin();
playfx (level._effect["mortar_explosion"],origin);
// Play the explosion sound
mortar3 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar3.origin, 500, 2000, 50);
wait (0.1);
origin = mortar4 GetOrigin();
playfx (level._effect["mortar_explosion"],origin);
// Play the explosion sound
mortar4 playsound("clusterbomb_explode_default");
// Make the explosion cause damage
radiusDamage(mortar4.origin, 500, 2000, 50);
wait (0.1);
}
I am nearby to give up ![[ohwell]](images/BBCode/smilies/ohwell.gif) |
 |
|
|
| novemberdobby |
 |
General Member Since: Sep 17, 2006 Posts: 1965 Last: Oct 13, 2013 [view latest posts] |
|
|
 |
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|