turret trap.

WAR_Nuker

Newbie
Joined
Mar 29, 2005
Messages
627
Reaction score
0
now....i have NO CLUE how i would do this. i want to make a turret trap in hl2dm that is initially at rest and lodged in the ceiling. after a button is pressed, i want the turrets to come out and shoot any player they see. after about 10 seconds i want the turrets to go back where they came from (lodged in the ceiling and at rest). i also want them to be invincible. how would i do this?

Edit: is this even a good idea? i know npcs in DM are a nono.
 
try having a button that you press thhen it opens up the floor and then the player falls onto a spike.
 
Do NPCs attack? Maybe you would have to use tanktrains instead.
 
im not sure exactly how tanktrains work.....


Edit: ah im stupid.....youre talking about the brush entity tanks right?
 
no i dont get it....im using tanklaser and it cant seem to get it to work.
 
You'd need to fire the tank with a SetTargetEntityName input.
 
i dont know what you mean....do i have the button output settargetentityname? also....what is the name of the target? i want the target to be any visible player that the tank sees.

Edit: LOL i set the parameter over ride to "player" and now all the tank does is look at me.

Edit: OMG it just murdered me while i was typing. yeesh.
 
See, you've gotten it to attack you all by yourself ;)
 
alright at least i got the basic thing working....only thing is now that it doesnt always shoot you. you have to be standing in certain spots for it to shoot you. also it doesnt make any noise when it fires....let me try messin with it some more.
 
Modify its yaw and pitch range so that it can shoot anywhere.
 
yeah i know but that wasnt the problem...it was the rate of fire (set it to a low number by accident). i changed it to tankpulselaser and got an effect more similar to what i want. seems to work perfectly now. thanks again man.
 
damn one problem. i can only make the barrel at an angle of 0 in the top view. otherwise it looks like the laser is coming out of the side of the barrel when it fires at you. i want the barrel to initially point at 270 degrees and not look retarded when it shoots at you....and i cant find which part corrects that.

edit:it also keeps flooding my console with


Failed to load sound "weapons/fx/rics/laser_ric2.wav", file probably missing from disk/repository

it says that everytime the turret fires once.
 
The gun must face east in the editor. Use its pitch/yaw/roll to rotate it to the proper initial position.

That's a bug with func_tankpulselaser. The sounds it's supposed to make when it ricochets off a wall don't exist. It also turns invisible when it does so ricochet.
 
yeah i made it face east initially.....and that worked OK....it was just in the direction i didnt want. after that i rotated it and the problem came back. maybe ill just have it rotate 360 degrees if i cant get it to work. ill try it again though.

Edit: OH my bad i was under the impression that rotating it and changing the yaw did the same thing. looks awesome now thanks.
 
alright someone joined my game while i was testing it and i noticed they (there are 4 turrets) only fire on one player at a time. even if the player is way farther than a player that is right next to the turrets. i gave them seperate names and i figure that would fix the problem with all 4 of them firing at the same player....and im sure it did....but i still want to fix the part where if the turrets lose a player (target) they keep firing at it instead of finding a new target (i want them to find a new target if possible)....and there are so many inputs and outputs for this entity im not sure where i should start. any suggestions?
 
Hmm. How about this:

output OnLoseTarget target !self input ClearTargetEntity
output OnLoseTarget target !self input SetTargetEntityName parameter player delay 0.3

Any time the current target player moves out of range (not sure if out of viewcone applies, but I can hope), the entity clears that player from its memory and tries to find a new one. Maybe.
 
wow never heard of !self. lemme give it a try.

edit: ah nevermind ill just use its name....

it doesnt seem to ever lose sight of me....i think that in itself is causing many problems.

let me see what happens when someone else joins. maybe thatl clear that up.
 
what is the grace period? i left it at the default value.

someone joined. i told him to stand in the middle so that all the turrets would fire at him....then to run away so the turrets couldnt see him. they kept shooting at him even though he was halfway across the level. is there a distance i can set for the turrets to lose sight of a target? (thats why i was asking about the grace period)
 
so far it seems to work only when the first player dies. how about this.....can i get it to work for whoever player is closest to the turret instead?
 
Well, there's the max and min range. The turrets will definitely lose sight of you if you get out of those.
 
ok just out of curiousity. whenever these tanks recieve the input 'settargetentityname', does that reset their targets to one that is closest? if so i might add a trigger that when a player exits or enters the trigger, the tanks targets get reset and they will (hopefully) shoot the player that is closest in that moment in time. if this is true, the behavior of my tanks would be more accurate to what im looking for. so, to repeat the question, does the 'settargetentityname' input REset the tanks target?

if this is correct, then the tanks would constantly be reset and given an appropriate target, which is the affect im aiming for.


Edit: heres what i got so far for the trigger multiple.

onstarttouch
(turret)
settargetentityname
player
.3 seconds

and

onendtouch
(turret)
cleartargetentity
0 seconds


now, in order to test this i need to wait for a second player to join my game. how does it look?

damn. tested it a bit and it worked....kind of. when you enter the trigger they will shoot you and when you exit they will stop. only thing is now there a big cloud of smoke behind the lasers (dunno where that came from) and i found that when you are in the trigger, the bullets do not harm you. they only harm you when you are outside of the trigger. ill see if there are any settings i can change to fix this....but for now it looks like ill have to use the old setup i had.
 
Back
Top