Page 1 of 1

trigger_damage value o.O?

Posted: April 23rd, 2007, 8:08 pm
by waywaaaard
hey i made a trigger_damage and

Code: Select all

secretdoormove()
{
secret_door = getent ("secretdoor1","targetname");
trigger_secret_door = getent ("damage_ss_trig","targetname");
while(1)
{
trigger_secret_door waittill ("trigger");
secret_door moveX (58,2,0.5,0.5);
secret_door waittill ("movedone");
wait(5);
secret_door moveX (-58,2,0.5,0.5);
secret_door waittill ("movedone");
}
}
it works fine but i want to add a value so that it needs about 5 shots with the pistol to work not only one

Posted: April 23rd, 2007, 8:57 pm
by Nightmare
I will try and whip something up, I can't make it just right now tho.

Posted: April 25th, 2007, 1:15 am
by Nightmare

Code: Select all

main()
{
thread secretdoormove();

level.addDamage=0;
} 

secretdoormove()
{
trig = getent("damage_ss_trig","targetname");
block = getent ("secretdoor1","targetname");
while (1)
{
trig waittill ("damage", idamage);
level.addDamage=level.addDamage+idamage; 
if(level.addDamage > 300)
	{
        block moveZ (-64, 3, 1, 1);
        block waittill ("movedone");
        wait 2;
        block moveZ (64, 3, 1, 1);
        block waittill ("movedone");
        level.addDamage=0;
	}
wait 0.05;
}
}
Alright, give that a try, let me know if you find anything wrong.
Note: Has not been tested.

Posted: April 25th, 2007, 1:01 pm
by waywaaaard
w00t works fine for me ;-)

thanks nightmare <-- the cod/2 mapping god

Posted: April 25th, 2007, 10:07 pm
by Nightmare
alright cool.
if you need anything else just ask. :)