Page 1 of 2

Script queryon Random_explode??

Posted: Wed Jul 10, 2002 4:42 pm
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

Posted: Wed Jul 10, 2002 7:23 pm
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

Posted: Wed Jul 10, 2002 7:39 pm
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.

Posted: Wed Jul 10, 2002 8:21 pm
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

origins

Posted: Thu Jul 11, 2002 1:12 am
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]

Posted: Thu Jul 11, 2002 5:47 pm
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

?

Posted: Thu Jul 11, 2002 6:12 pm
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

Posted: Thu Jul 11, 2002 6:29 pm
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]

Posted: Thu Jul 11, 2002 6:44 pm
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

Posted: Thu Jul 11, 2002 6:45 pm
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:

nope

Posted: Thu Jul 11, 2002 6:57 pm
by tltrude
I already tried both those (1 and 0) and it's no dice.

Posted: Sat Jul 13, 2002 1:05 pm
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.

Posted: Sun Jul 14, 2002 7:50 pm
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

bad

Posted: Sun Jul 14, 2002 9:12 pm
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?

Posted: Sun Jul 14, 2002 9:31 pm
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