Jump to content
Sign in to follow this  
A-SUICIDAL

Help needed with setting trigger height

Recommended Posts

I am trying to create a trigger to put on the roof of my jail cell that will kill any players that attempt to get on the roof. The reason for this is because I use "wooden crate" objects to make my roof, and players can fall through them and choppers can also drop down through them. I put hedge hogs on the roof since they will block the chopper, but if a player hops out of the chopper, he can fall between the hedgehogs and then fall through the wooden crates.

I want the trigger to kill players that are above 5 meters and below 7 meters. This is what I used, and it worked, but then after a few moments the player in jail would die, so it didn't really work.

rectangle repeating trigger activated by blufor

Condition:

this && {((getPosATL _x) select 2) >5 && ((getPosATL _x) select 2) <7} count thislist > 0 && player in thisList

Activation:

{_x setdammage 1} foreach thislist;

I first tested this by placing a "radar" tower object within the radius of the trigger. I climbed the radar tower and as soon as I climbed more than 5 meters above terrain level, I died. Then I tested again, only this time I setPos myself to 12 meters so I would start out at the top of the radar, and as soon as I climbed down lower 7 meters above terrain level, I died.

So it seemed to be working, but eventually, if I am just standing in the jail cell, the trigger does kill me. I am assuming that the <7 part of the trigger will kill me regardless of the >5 setting. So is there another way to make this work without it killing me when I am in the jail cell? I just want it to kill anybody that might fall through the roof.

---------- Post added at 05:30 PM ---------- Previous post was at 05:10 PM ----------

I think I was eventually dying because I had an AI on the roof and eventually he would fall through the roof and it would kill both of us.

{_x setdammage 1} foreach thislist;

...kills everybody within the trigger, so I don't want to use that.

When I tried changing the activation to this...

hint "you are within the trigger radius"; this setDammage 1;

it didn't kill anybody at all, but the hint does appear.

I'm getting closer.

Share this post


Link to post
Share on other sites

You will need to re apply the height check in the on act otherwise {_x setdammage 1} foreach thislist; will delete all units found in the trigger

Share this post


Link to post
Share on other sites

This works...

condition:

this && {((getPosATL _x) select 2) >5 && ((getPosATL _x) select 2) <7} count thislist > 0 && player in thisList

activation:

player setDammage 1;

but is it smart to use this?

player setDammage 1;

I don't want it to kill anybody except for the player that is goofing around on the roof.

Share this post


Link to post
Share on other sites

Will most likely work yes. The stuff inside thisList is whatever met the activation (not condition).

Why not just use player in the condition instead of checking everyone in the list

player in thisList && ((getPosATL player) select 2 > 5 && (getPosATL player) select 2 < 7)

You have to remember that triggers are local :).

Share this post


Link to post
Share on other sites
Will most likely work yes.

Actually no. Yours will, but A-SUICIDAL's will kill every player in the radius, if there's one dude on the roof.

So, go for cuel's code!

Share this post


Link to post
Share on other sites

Well, when I last tested, the way I had it worked, but I was testing with an ai. The ai was in the jail cell and I climbed up the radar tower and when I reached the trigger it killed me, but the ai was still alive in the jail cell. So from what you explained, I now understand that if that if the ai was a real player, then the player would have died.

I'll just play it safe and use cuel's method.

Thanks guys :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×