Script queryon Random_explode??
Moderator: Moderators
Script queryon Random_explode??
I have this in my script :
"level waittill spawn
thread random_explode
thread random_explode1 //Not sure if i need this or not
end
random_explode1:
wait (randomfloat 13 + 23)
$random_explode anim start
radiusdamage $random_explode.0.00 56.00 8.00 256 384
goto random_explode1 "
I named 7 targetnames as random1 to 7
Do i need to number each one ??
does my script ahve to call each random 1 tru 7??
They dont work and i get 2 script errors.
_____________actual spawning entities__________
Event $destroyed_model does not exist
Failed event exectuon for class scriptorigin )get it twice)
And this
Radiusdamage $random_explaode0000560 256.384 )maps OBJ kdja1.scr)
Radius damage$random explode ^
Script master could not parse maps kdja1.scr
Anyone know how to rectify this??
kdja
"level waittill spawn
thread random_explode
thread random_explode1 //Not sure if i need this or not
end
random_explode1:
wait (randomfloat 13 + 23)
$random_explode anim start
radiusdamage $random_explode.0.00 56.00 8.00 256 384
goto random_explode1 "
I named 7 targetnames as random1 to 7
Do i need to number each one ??
does my script ahve to call each random 1 tru 7??
They dont work and i get 2 script errors.
_____________actual spawning entities__________
Event $destroyed_model does not exist
Failed event exectuon for class scriptorigin )get it twice)
And this
Radiusdamage $random_explaode0000560 256.384 )maps OBJ kdja1.scr)
Radius damage$random explode ^
Script master could not parse maps kdja1.scr
Anyone know how to rectify this??
kdja
I changed the layout fo the SCR file and they work now but i named them 1 to 7 and i get this error
^~^~^ Script Error: Cannot cast NULL to vector
$random_explode3_origin playsound arty_leadinmp (maps/obj/kdja1.scr, 60)
$random_explode3_origin ^
^~^~^ Script Error: command 'playsound' applied to NULL listener
radiusdamage $random_explode3_origin 256 384 (maps/obj/kdja1.scr, 65)
^
^~^~^ Script Error: Cannot cast NULL to vector
$random_explode1_origin playsound arty_leadinmp (maps/obj/kdja1.scr, 34)
$random_explode1_origin ^
^~^~^ Script Error: command 'playsound' applied to NULL listener
radiusdamage $random_explode1_origin 256 384 (maps/obj/kdja1
On each one they work but just wondering what this means???
Kdja
^~^~^ Script Error: Cannot cast NULL to vector
$random_explode3_origin playsound arty_leadinmp (maps/obj/kdja1.scr, 60)
$random_explode3_origin ^
^~^~^ Script Error: command 'playsound' applied to NULL listener
radiusdamage $random_explode3_origin 256 384 (maps/obj/kdja1.scr, 65)
^
^~^~^ Script Error: Cannot cast NULL to vector
$random_explode1_origin playsound arty_leadinmp (maps/obj/kdja1.scr, 34)
$random_explode1_origin ^
^~^~^ Script Error: command 'playsound' applied to NULL listener
radiusdamage $random_explode1_origin 256 384 (maps/obj/kdja1
On each one they work but just wondering what this means???
Kdja
-
NathanielPT
- Corporal
- Posts: 43
- Joined: Sun Jul 07, 2002 3:35 pm
- Location: USA/Africa
- Contact:
You got the following error:
$random_explode1_origin playsound arty_leadinmp (maps/obj/kdja1.scr, 34)
$random_explode1_origin ^
^~^~^ Script Error: command 'playsound' applied to NULL listener
My guess is that $random_explode1_origin isn't a script_origin or a script_model. That would probably cause those errors. That's as much as I can say without knowing more.
$random_explode1_origin playsound arty_leadinmp (maps/obj/kdja1.scr, 34)
$random_explode1_origin ^
^~^~^ Script Error: command 'playsound' applied to NULL listener
My guess is that $random_explode1_origin isn't a script_origin or a script_model. That would probably cause those errors. That's as much as I can say without knowing more.
--NathanielPT--
origins
Yep, You should look over origin 3 and 1 to see what is different from the ones that don't give errors. You may need to put your map name in ubersound for that leadin sound.
If you look at the script for obj/team3 you'll see how they set it up--each one is a looping thread. They are started by a preperation thread which is called at the spawn.
You can also make them into one big loop where they go off one at a time with waits between, or sets of two or three like that.
I have a tank firing just before each random explosion. Here is the script for that:
random_explode1:
wait (randomfloat 4 + 13)
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode1_origin playsound arty_leadinmp1
wait 1
$random_explode1 anim start
radiusdamage $random_explode1_origin 256 384
$random_tankfire anim stop
wait 5
goto random_explode1
The lulubelle sound origin is above the tank and the barrel has a "fire_good" emitter named random_tankfire.


[/img]
If you look at the script for obj/team3 you'll see how they set it up--each one is a looping thread. They are started by a preperation thread which is called at the spawn.
You can also make them into one big loop where they go off one at a time with waits between, or sets of two or three like that.
I have a tank firing just before each random explosion. Here is the script for that:
random_explode1:
wait (randomfloat 4 + 13)
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode1_origin playsound arty_leadinmp1
wait 1
$random_explode1 anim start
radiusdamage $random_explode1_origin 256 384
$random_tankfire anim stop
wait 5
goto random_explode1
The lulubelle sound origin is above the tank and the barrel has a "fire_good" emitter named random_tankfire.


[/img]
?
I don't get it. "random_explode3_origin" is the targetname of the script origin above the emitter named "random_explode3". It plays the sound when the explosion goes off. I copied it that way from the obj_team3 map.
if I want an script origin to play a sound, don't I just put this?
$[targetname] playsound [soundname]
===============================================
Ok, another question:
Can someone please, please, tell me how to stop the random explosions when my tank is blown up? I need a way to shut off the thread loops when the first objective bomb ($bomb1) explodes. If I knew how this "while" statement worked, I could probably figure it out.
// --------------------------------------------
// "Bomb 1 Exploded"
// --------------------------------------------
bomb1_exploded local.bomb1:
while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "Axis have destroyed the Sherman tank!"
$random_tankfire remove
$lulubelle_origin remove
end
if I want an script origin to play a sound, don't I just put this?
$[targetname] playsound [soundname]
===============================================
Ok, another question:
Can someone please, please, tell me how to stop the random explosions when my tank is blown up? I need a way to shut off the thread loops when the first objective bomb ($bomb1) explodes. If I knew how this "while" statement worked, I could probably figure it out.
// --------------------------------------------
// "Bomb 1 Exploded"
// --------------------------------------------
bomb1_exploded local.bomb1:
while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "Axis have destroyed the Sherman tank!"
$random_tankfire remove
$lulubelle_origin remove
end
Last edited by tltrude on Thu Jul 11, 2002 6:30 pm, edited 1 time in total.
-
Wombat
- Colour Sergeant
- Posts: 93
- Joined: Fri Jun 14, 2002 5:10 pm
- Location: Adelaide, Australia
- Contact:
i refer of course, to the original query about how kdja, was having problems, not your script, which works ok, as it has a script_origin called
random_explode1_origin
i said
when you want to access the origin of the object ( not a script_origin, but an emitter or some other object)
you use
$targetname.origin OK
I picked on your scriptnames, because they were there.
to fix kdja problem with radiusdamage
radiusdamage $random_explode.origin 256 384
also kdja had
^~^~^ Script Error: Cannot cast NULL to vector
$random_explode3_origin playsound arty_leadinmp (maps/obj/kdja1.scr, 60)
$random_explode3_origin ^
fix by
$random_explode3.origin playsound arty_leadinmp
ok[/quote]
random_explode1_origin
i said
when you want to access the origin of the object ( not a script_origin, but an emitter or some other object)
you use
$targetname.origin OK
I picked on your scriptnames, because they were there.
to fix kdja problem with radiusdamage
radiusdamage $random_explode.origin 256 384
also kdja had
^~^~^ Script Error: Cannot cast NULL to vector
$random_explode3_origin playsound arty_leadinmp (maps/obj/kdja1.scr, 60)
$random_explode3_origin ^
fix by
$random_explode3.origin playsound arty_leadinmp
ok[/quote]
Wombat's
Eats roots shoots then leaves...........
Eats roots shoots then leaves...........
-
Wombat
- Colour Sergeant
- Posts: 93
- Joined: Fri Jun 14, 2002 5:10 pm
- Location: Adelaide, Australia
- Contact:
try this
early in the script set a variable
level.shermanblown = 0
then to your random explode thread add green
random_explode1:
wait (randomfloat 4 + 13)
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode1_origin playsound arty_leadinmp1
wait 1
$random_explode1 anim start
radiusdamage $random_explode1_origin 256 384
$random_tankfire anim stop
wait 5
if (level.shermanblown = 0){goto random_explode1}// if the condition is true execute command
end
to your bomb_exploded thread add
// --------------------------------------------
// "Bomb 1 Exploded"
// --------------------------------------------
bomb1_exploded local.bomb1:
while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "Axis have destroyed the Sherman tank!"
level.shermanblown = 1
$random_tankfire remove
$lulubelle_origin remove
end
this should stop execution of the random_explode thread when the tank is destroyed.
early in the script set a variable
level.shermanblown = 0
then to your random explode thread add green
random_explode1:
wait (randomfloat 4 + 13)
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode1_origin playsound arty_leadinmp1
wait 1
$random_explode1 anim start
radiusdamage $random_explode1_origin 256 384
$random_tankfire anim stop
wait 5
if (level.shermanblown = 0){goto random_explode1}// if the condition is true execute command
end
to your bomb_exploded thread add
// --------------------------------------------
// "Bomb 1 Exploded"
// --------------------------------------------
bomb1_exploded local.bomb1:
while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "Axis have destroyed the Sherman tank!"
level.shermanblown = 1
$random_tankfire remove
$lulubelle_origin remove
end
this should stop execution of the random_explode thread when the tank is destroyed.
Wombat's
Eats roots shoots then leaves...........
Eats roots shoots then leaves...........
bad
Errors = bad!!
Yes, do fix it kdja. "'playsound' applied to NULL listener " means the script can't find the entity on your map. So, check your map and script to make sure the script origin targetnames are the same. The lead in sound they play is kind of inconspicuous, but it helps make it more realistic.
Has anyone figured out how to make a scroch mark appear like the granade does?
Yes, do fix it kdja. "'playsound' applied to NULL listener " means the script can't find the entity on your map. So, check your map and script to make sure the script origin targetnames are the same. The lead in sound they play is kind of inconspicuous, but it helps make it more realistic.
Has anyone figured out how to make a scroch mark appear like the granade does?
