Script queryon Random_explode??

Post your scripting questions / solutions here

Moderator: Moderators

kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

Script queryon Random_explode??

Post by kdja »

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
kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

Post by 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
NathanielPT
Corporal
Posts: 43
Joined: Sun Jul 07, 2002 3:35 pm
Location: USA/Africa
Contact:

Post by NathanielPT »

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.
--NathanielPT--
kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

Post by kdja »

but the wierd thing is they work.
they go 1 /3/5/7/2/4/6/1
in that order.
I thought ti was the sound it was trying to play but not sure.
Each explosion is a FX/tank/explosion.
numbered 1 to 7 target name 1 etc.
the script calls em all in prespawn and they do work ,has me stumped.

kdja
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

origins

Post by tltrude »

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.

Image

Image

[/img]
Tom Trude,

Image
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

when you want to access the origin of the object ( not a script_origin, but an emitter or some other object)

$random_explode3 (targetname)

you use the origin property

ie
$random_explode3.origin

not

$random_explode3_origin
Wombat's
Eats roots shoots then leaves...........
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

?

Post by tltrude »

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
Last edited by tltrude on Thu Jul 11, 2002 6:30 pm, edited 1 time in total.
Tom Trude,

Image
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

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

:wink:

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...........
kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

Post by kdja »

ok either im a complete dumbass LOL
or is all i have to do is use full stops instead of underscores.?????
ie my line
$random_explode3_origin playsound arty_leadinmp
your line
$random_explode3.origin playsound arty_leadinmp


thx
kdja
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

tltrude

move/copy the while ( $bomb.exploded != 1) (Or try != 0)

to your random_explode1

thread

That way the thread only runs while the bomb is live..... :wink:
Wombat's
Eats roots shoots then leaves...........
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

nope

Post by tltrude »

I already tried both those (1 and 0) and it's no dice.
Tom Trude,

Image
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

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.
Wombat's
Eats roots shoots then leaves...........
kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

Post by kdja »

I got the random explodes working ,but still get that error ,as its working and i ahve a few weeks left to make the map im not concerned as it works .
SHould i be concerned???

Thx for the replies.
kdja
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

bad

Post by tltrude »

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?
Tom Trude,

Image
kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

Post by kdja »

there is Decal tut in here somwere ,
i looked at it and it looked to be a bit much for eye candey effects i might use it.
search here it is here.

kdja
Post Reply