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
scripting targets
Moderator: Moderators
-
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
Hopes it works
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
endHopes it works
**** 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
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
Last edited by Nijnrich on Wed Oct 16, 2002 10:05 pm, edited 1 time in total.
-
HkySk8r187
- Lance Corporal
- Posts: 20
- Joined: Fri Jun 28, 2002 6:37 pm
- Contact:
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 .
About drawing the brick's Either uses the copy function a lot or make one big brick and then use the clipper tool wisely.
-
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....
