Page 1 of 1
scripting targets
Posted: Wed Oct 16, 2002 6:34 am
by KcAX19
i have made a moveing brick and it goes from side to side but now i need it to explode when it takes a cirtain amount of dmg but when it explodes i dont want it to blow the other bricks up so what i am asking 4 is that when u shoot my brick and it takes in dmg i would like it to blow but with no radious dmg the targetnames r "man1" to man6
if u need more info contact me on msn msger or e-mail on
michael_aiz@msn.com
thx
KcAX19
Posted: Wed Oct 16, 2002 10:00 pm
by Guest
An idea may be to temporarily set the nodamage of the surrounding bricks by just before the explosion occurs and setting the damage just after the explosion and thus also after the damage dealing has occured.
Supposingly you named your bricks brick1 brick2 etc
// brickcount = number of bricks
// wall is the array of the remaining 'healthy' bricks
I'm not so good at scripting yet, but it would be something like this
Code: Select all
thread buildwall
buildwall:
level.brickcount = 10
for (local.i = 1 ; local.i <= level.brickcount ; local.i ++)
{
local.i_brickname = ("brick" + local.i)
level.wall[local.i] = local.i_brickname
// maybe the spawning of the bricks can be done here as well
// wall now is filled with brick1 brick2 .. brick"brickcount "
// have listener thread set out for each brick
local.i_brickname thread brick_dead
}
end
brick_dead:
self waittill death
thread protect_bricks self.targetname
// after all bricks are protected let her blow
self thread brick_explodes
// wait statement just to have some processing time available
wait 0.2
thread unprotect_bricks
end
protect_bricks local.name:
// check the bricks in the wall
for (local.i = 1 ; local.i <= level.brickcount ; local.i ++)
{
local.brickname = ("brick" + local.i)
// is this the brick that just died
IF local.brickname == local.name
// remove the brick from the wall
{
level.wall[(local.i] != NIL
}//if
ELSE
// protect the surviving brick from the blast
{
$(local.brickname) nodamage
} //else
} //for
end
brick_explodes:
// do here your own magic brick expoding bit here
end
unprotect_bricks:
for (local.i = 1 ; local.i <= level.brickcount ; local.i ++)
{
// is this a healthy brick
IF wall != NIL
{
local.brickname = ("brick" + local.i)
$(local.brickname) takedamage
} //if
} //for
end
Hopes it works
Posted: Wed Oct 16, 2002 10:02 pm
by Nijnrich
**** automatically logged seems is a nuicance , now i can't edit it
Anyway I saw one error already
// is this a healthy brick
IF wall != NIL
should be
// is this a healthy brick
IF wall[local.i] != NIL
Posted: Wed Oct 16, 2002 10:04 pm
by Surgeon
hmm wierd it works fine for me

:(
Posted: Thu Oct 17, 2002 7:49 am
by KcAX19
thanks man but i tryed it and the thingy didnt work 4 me nothing moved nothing blew up ...so if it would be possable for someone to make the .map and the script file for me and send it to my e-mail so i could get an idea on how to make this thing that would be great.
thx
KcAX19
Posted: Thu Oct 17, 2002 10:33 am
by HkySk8r187
try just making it a func_crate. It will look like wood particles when it breaks but maybe you can change some properties for that, don't know, but it will do what you want it to do. Be sure to do each brick seperatly, if you do them all at once they will break together.
Posted: Thu Oct 17, 2002 1:51 pm
by jv_map
Sorry, nothing to do with the subject, but is it 'in' to choose a name that's a random combination of characters?

Posted: Thu Oct 17, 2002 2:32 pm
by Nijnrich
HkySk8r187 wrote:try just making it a func_crate. It will look like wood particles when it breaks but maybe you can change some properties for that, don't know, but it will do what you want it to do. Be sure to do each brick seperatly, if you do them all at once they will break together.
I thought that his question was how to let the brick really explode without causing the other brick sto explode and yet still do radius damage .

If it's just the animation he's after and not the damage dealing bit then I was completely off . Sorry about it. The func_crate is much much better....
About drawing the brick's Either uses the copy function a lot or make one big brick and then use the clipper tool wisely.

Posted: Fri Oct 18, 2002 8:08 am
by KcAX19
i am sorry but i dont think u can make a script_object into a func_crate lol thanks for trying tho.....oh and my question is how to make the bricks explode when they take damage thats all i want and the bricks r a script object so the idea of a crate is out of the question and yes i need it to be a script object cause the brick actually move with the script *$man1 moveleft 150*...well really the script is more complicated than this but this shows u what it does....