pics or no clicks
Not worth posting
Could be alot better
Okay
Pretty good
Awesome!
This is just a simple turret I whipped together using Expression 2 in my spare time. It's based on a generic World War II AA turret. By the way, the seat does nothing. It's just for looks.
To turn on, press 'e' on the center of the target finder in front of the seat.
Requires GCX and PHX 3.
Tell me what you think!
Last edited by Rad Hazard; 11-23-2008 at 06:55 PM. Reason: Pics
"In an all-out global thermonuclear war, nobody wins. Everybody dies"~Unknown76.2847% of all signature statistics are made up on the spot.
pics or no clicks
There. Happy now?
"In an all-out global thermonuclear war, nobody wins. Everybody dies"~Unknown76.2847% of all signature statistics are made up on the spot.
If it uses code, you should probably post it. I'm at school so I can't play GMod, but the E2 code would give me an idea of how advanced it is.
Other than that, good first post.![]()
It's not actually that advanced. (At least, I don't think it is.)
Here it is anyway:
Code:@name Default Delta Turret @inputs Bearing Elevation Distance On Target MaxDistance @outputs Shoot SideThruster BottomThruster @persist if (On == 1 & Target == 1) { SideThruster = $Bearing * 5 + Bearing } else { SideThruster = 0 } if (On == 1 & Target == 1) { BottomThruster = $Elevation * 5 + Elevation } else { BottomThruster = 0 } if (Bearing < 1 & Bearing > -1 & Elevation < 1 & Elevation > -1 & Target == 1 & On == 1 & Distance < MaxDistance ) { Shoot = 1 } else { Shoot = 0 }
"In an all-out global thermonuclear war, nobody wins. Everybody dies"~Unknown76.2847% of all signature statistics are made up on the spot.
It's ok. For some reason I think a controllable anti-air turret would be better... otherwise it's just a stylish run of the mill auto-turret... but it's still cool in it's own right.
One tip I have, which really isn't a big deal.. you can shorten your code to:
or even this.. but it will constantly be crunching numbers. I like to keep everything wrapped in an on/off setup to minimize lag.Code:if (On) { BottomThruster = ($Elevation * 5 + Elevation)*Target SideThruster = ($Bearing * 5 + Bearing)*Target if (abs(Bearing)<1 & abs(Elevation)<1 & Distance < MaxDistance) { Shoot=Target } }
Code:BottomThruster = ($Elevation * 5 + Elevation)*Target*On SideThruster = ($Bearing * 5 + Bearing)*Target*On if (abs(Bearing)<1 & abs(Elevation)<1 & Distance < MaxDistance) { Shoot=Target*On }
Last edited by Beer; 11-25-2008 at 04:46 PM.
Hmm... never thought of that. That's a good idea.
"In an all-out global thermonuclear war, nobody wins. Everybody dies"~Unknown76.2847% of all signature statistics are made up on the spot.
I made one mistake with the code above.. you need to make sure to set Shoot to zero at some point.. you can work that out on your own. Mainly just wanted to show you how to control the elevation and bearing a little more dynamically.
Okay, thanks.
"In an all-out global thermonuclear war, nobody wins. Everybody dies"~Unknown76.2847% of all signature statistics are made up on the spot.
Bookmarks