Page 1 of 1

Moving triggers problem.

Posted: August 10th, 2007, 6:25 am
by Jolt
My trig2 doesn't move why?

Code: Select all

door2()
{
block = getent("door2","targetname");
trig = getent ("door2_trig","targetname");
trig2 = getent ("door2_trig2","targetname");
while(1)
{
trig waittill ("trigger");
block moveZ (128,2,0.5,0.5);
trig2 moveZ (128,2,0.5,0.5);
wait(5);
block moveZ (-128,2,0.5,0.5);
trig2 moveZ (-128,2,0.5,0.5);
trig2 waittill ("movedone");
}
}

Posted: August 10th, 2007, 6:58 am
by 9mm
You cant directly move a trigger, you must move a script_brushmodel and have the trigger linked to it. So you are really moving a brush and the trigger is following it. You can just use the nodraw_notsolid if you want to make it seem like there is no brush there. For this to work you will have to make a brush in radiant and call it door2_trig2_brush(unless you change script) in addition to the trigger.

try this instead(did not test)
door2()
{
block = getent("door2","targetname");
trig = getent ("door2_trig","targetname");
trig2 = getent ("door2_trig2","targetname");
trig2_brush = getent ("door2_trig2_brush","targetname");
trig2 enablelinkto();
trig2 linkto(trig2_brush);
while(1)
{
trig waittill ("trigger");
block moveZ (128,2,0.5,0.5);
trig2_brush moveZ (128,2,0.5,0.5);
wait(5);
block moveZ (-128,2,0.5,0.5);
trig2_brush moveZ (-128,2,0.5,0.5);
block waittill ("movedone");
trig2_brush waittill ("movedone");
}
}

Posted: August 10th, 2007, 8:02 am
by Jolt
Instead of creating a new brush, could I just use door2? Btw, there is something wrong I tested and it the trig2 didn't move.

Code: Select all

door2() 
{ 
block = getent("door2","targetname"); 
trig = getent ("door2_trig","targetname"); 
trig2 = getent ("door2_trig2","targetname"); 
trig2 enablelinkto(); 
trig2 linkto(door2); 
while(1) 
{ 
trig waittill ("trigger"); 
block moveZ (128,2,0.5,0.5); 
wait(5); 
block moveZ (-128,2,0.5,0.5); 
block waittill ("movedone"); 
}
}

Posted: August 10th, 2007, 9:01 am
by 9mm
Did you make the brush? If not that is why it did not work for you. Yes you can use the door and have the trigger follow if it you wanted. I take it this is to kill people so they dont get stuck or something?

your script was close

change
trig2 linkto(door2);
into
trig2 linkto(block);
You use the name you call in the script not radiant. Try this and let me know how it goes.

Edit: Thinking about this the script will work, but you are not going to get the results you want. I will explain tomorrow about other ways to do this.

Posted: August 10th, 2007, 9:48 am
by Jolt
Ok, still didn't work, everything moves accept the trig_hurt. Here is what I'm doing, I've made a laser and put a hurt trigger inside it but I want the laser to move so I need the trigger to come with.

Posted: August 10th, 2007, 1:46 pm
by Drofder2004

Code: Select all

trig2 = getent("trig2","targetname);
In your map, spawn a "script_origin"
Right-click the 2D and select, script then origin.

Now, place this origin, in the center of your trigger.

Give the origin values of..
Key: Targetname
Value: trig2_org

Now in your script...

Code: Select all

main()
{
trig2 = getent("trig2","targetname");
trig2_org = getent("trig2_org","targetname");
trig2 enablelinkto();
trig2 linkto(trig2_org);
wait 0.05;

while(1)
{
   // move the trig2_org
}
}

Posted: August 10th, 2007, 5:29 pm
by 9mm
o a laser? kind of strange to name a laser as block but ok. I would guess you put the trigger the same size as the laser. For it to kill you need to make the laser non colliding.

Posted: August 10th, 2007, 10:22 pm
by Jolt
What does this do?

Code: Select all

trig2 = getent("trig2","targetname);

Posted: August 10th, 2007, 11:09 pm
by Lethal323
Jolt that tells it to find the entitie of what you named it in the map...



Where i says

Code: Select all

 ("trig2","targetname"); 
That is what you named it in the map...

Where it says

Code: Select all

trig2 = getent 
that first part

Code: Select all

 trig2 
is what the script refers to it as...

Posted: August 10th, 2007, 11:52 pm
by [SoE]_Zaitsev
Lethal323 wrote:Doesnt matter...



I AM ANNOUNCING THIS AS MY FINAL POST RIGHT HERE...


I AM LEAVING

MAY BE BACK LIKE ONCE A MONTH TO POST AND SAY HI...


BUT THIS WILL BE MY FINAL POST!!!!!!!!!!!!!!!!!!!!!
:D

Posted: August 11th, 2007, 1:40 am
by Lethal323
[SoE]_Zaitsev wrote:
Lethal323 wrote:Doesnt matter...



I AM ANNOUNCING THIS AS MY FINAL POST RIGHT HERE...


I AM LEAVING

MAY BE BACK LIKE ONCE A MONTH TO POST AND SAY HI...


BUT THIS WILL BE MY FINAL POST!!!!!!!!!!!!!!!!!!!!!
:D
:D




Anyways, I belive I foudn his problem when I took a look at his .map He had the trigger at a patch (cylinder) Which If I am correct I dont think those can move, Because I have a player clip that was a cylinder and when I tried to make it move I couldnt. But then I made it not a patch it worked... so...

Posted: August 11th, 2007, 11:11 pm
by Coontang
Lethal323 wrote:
[SoE]_Zaitsev wrote:
Lethal323 wrote:Doesnt matter...



I AM ANNOUNCING THIS AS MY FINAL POST RIGHT HERE...


I AM LEAVING

MAY BE BACK LIKE ONCE A MONTH TO POST AND SAY HI...


BUT THIS WILL BE MY FINAL POST!!!!!!!!!!!!!!!!!!!!!
:D
:D




Anyways, I belive I foudn his problem when I took a look at his .map He had the trigger at a patch (cylinder) Which If I am correct I dont think those can move, Because I have a player clip that was a cylinder and when I tried to make it move I couldnt. But then I made it not a patch it worked... so...
wow a long long.....day.

Posted: August 31st, 2007, 2:30 pm
by Cpt.Cool
jimbojetuk wrote:
Lethal323 wrote:
[SoE]_Zaitsev wrote: :D
:D




Anyways, I belive I foudn his problem when I took a look at his .map He had the trigger at a patch (cylinder) Which If I am correct I dont think those can move, Because I have a player clip that was a cylinder and when I tried to make it move I couldnt. But then I made it not a patch it worked... so...
wow a long long.....day.
you can say that again