Page 1 of 2

Triggered explotions

Posted: November 11th, 2006, 2:40 pm
by All-Killer
So this is what i want. For example: You walking in a room and sudenly the ceiling collapse and fall down by a mortar ore somthing. After the explosion you have a hole in the roof and you have the broken roof on the ground with some nice fire. Another example. Youre walking trough a hallway and on both sides on the wall runs some pipe with bezin ore gas. And when you walk trough the trigger: Boom and the pipe is broken and some fire

Is this possible to do? And how? Im sure drofder know's a way :D

Thanks for reading this.

Posted: November 11th, 2006, 3:47 pm
by Luke
You could hide and show the broken/unbroken parts when the trigger is used, and have an effect played at the same time.
Something like this

Code: Select all

brokenparts hide();
trig waittill ("trigger");
playfx(level._effect["your effect"], (0, 0, 0));//add your coords
unbrokenparts hide();
brokenparts show();

Posted: November 11th, 2006, 4:27 pm
by All-Killer
so what are the targetnames then? Please explain it some more.

Posted: November 11th, 2006, 11:16 pm
by Soviet
the trigger for walking through would of course be trigger_touch

and you might want to consider building the normal part first, then copying and pasting that whole part, then with that new part selected hide it. Then make the still visible part broken and rename it. This will give you the original to work with as well as less confusing mapping going on while you make it.

Posted: November 12th, 2006, 12:04 pm
by All-Killer
Oke thanks i will test this. Its for a singleplayer map so i think it needs a trigger_once so that it will be triggerd only once. Thanks for the info!

Posted: November 12th, 2006, 7:00 pm
by Soviet
KillerSam wrote:trigger_multiple tbh
shhhh, dont prove me wrong :P

im looking foward to seeing this, ive always loved scripted events like this.

Posted: November 13th, 2006, 1:12 pm
by All-Killer
Heheh i will test this one of these day was a bit bussy you will hear with trigger worked :D

Posted: November 13th, 2006, 4:47 pm
by creator
killer i can help u on x fire ^^ luke helpt me with it now i know it :)

Posted: November 13th, 2006, 8:20 pm
by All-Killer
Hmm tested it and i get this error: uninitialised varible 'explosion_trig)
explosion_trig waittill ("trigger",user);

GSC

Code: Select all

main()
{
maps\_load::main();

thread explosion();
}

explosion()
{
roof = getent ("roof","targetname");
brokenroof = getent ("brokenroof","targetname"); 
explotion_trig = getent ("explosion_trig","targetname"); 
while (1)
{
brokenroof hide();
brokenroof notsolid();
explosion_trig waittill ("trigger",user);
roof hide();
roof notsolid();
brokenroof show();
brokenroof solid(); 
}
}

Posted: November 13th, 2006, 8:30 pm
by creator
main()
{
maps\_load::main();

thread explosion();
}

explosion()
{
roof = getent ("roof","targetname");
brokenroof = getent ("brokenroof","targetname");
explotion_trig = getent ("explosion_trig","targetname");
while (1)
{
brokenroof hide();
brokenroof notsolid();
explosion_trig waittill ("trigger",user);
roof hide();
roof notsolid();
brokenroof show();
brokenroof solid();
}
}

make the roof: 'delete' instead hide, this will remove it permanently [till map restarts] from the game
replace 't' with 's'

Posted: November 13th, 2006, 8:46 pm
by All-Killer
hmm its working for the half: the roof disappears but the brokenroof doesnt appeare. i checked the targetnames and are good. Its for a SP map

Posted: November 13th, 2006, 9:21 pm
by creator
try adding a small wait time between those 4 hide and show and not solid
like

wait 0.1;

Posted: November 13th, 2006, 9:37 pm
by Luke
I told him to put the brokenroof hide(); and brokenroof notsolid(); above the while(1) and he said that worked.

Posted: November 13th, 2006, 10:02 pm
by creator
what does the while(1) do anyway? or dont u know [just that u need to have it]

Posted: November 14th, 2006, 12:23 am
by 9mm
I believe it just makes it an infinite loop