View Poll Results: What do you think of my turret?

Voters
41. You may not vote on this poll
  • Not worth posting

    7 17.07%
  • Could be alot better

    7 17.07%
  • Okay

    14 34.15%
  • Pretty good

    4 9.76%
  • Awesome!

    9 21.95%
+ Reply to Thread
Results 1 to 10 of 10

Thread: Auto Anti-Aircraft turret

  1. #1
    Wire Noob Rad Hazard's Avatar
    Join Date
    Nov 2008
    Location
    owner():pos()
    Posts
    13

    Talking Auto Anti-Aircraft turret

    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!
    Attached Thumbnails Attached Thumbnails Auto Anti-Aircraft turret-gm_construct0000.jpg   Auto Anti-Aircraft turret-gm_construct0001.jpg   Auto Anti-Aircraft turret-gm_construct0004.jpg  
    Attached Files Attached Files
    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"
    ~Unknown
    76.2847% of all signature statistics are made up on the spot.

  2. #2
    Wire Sofaking Whodunnit's Avatar
    Join Date
    Jan 2008
    Location
    New Zealand, Ackl
    Posts
    636

    Default Re: Auto Anti-Aircraft turret

    pics or no clicks

  3. #3
    Wire Noob Rad Hazard's Avatar
    Join Date
    Nov 2008
    Location
    owner():pos()
    Posts
    13

    Default Re: Auto Anti-Aircraft turret

    There. Happy now?
    "In an all-out global thermonuclear war, nobody wins. Everybody dies"
    ~Unknown
    76.2847% of all signature statistics are made up on the spot.

  4. #4
    Wire Sofaking Azrael's Avatar
    Join Date
    Aug 2007
    Posts
    1,946

    Default Re: Auto Anti-Aircraft turret

    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.

  5. #5
    Wire Noob Rad Hazard's Avatar
    Join Date
    Nov 2008
    Location
    owner():pos()
    Posts
    13

    Default Re: Auto Anti-Aircraft turret

    Quote Originally Posted by AzraelUK View Post
    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"
    ~Unknown
    76.2847% of all signature statistics are made up on the spot.

  6. #6
    Wire Sofaking Beer's Avatar
    Join Date
    Jul 2007
    Location
    Dallas, Texas
    Posts
    1,357

    Default Re: Auto Anti-Aircraft turret

    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:

    Code:
    if (On) {
       BottomThruster = ($Elevation * 5 + Elevation)*Target
       SideThruster = ($Bearing * 5 + Bearing)*Target
       if (abs(Bearing)<1 & abs(Elevation)<1 & Distance < MaxDistance) {
          Shoot=Target
       }
    }
    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:
    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.

  7. #7
    Wire Noob Rad Hazard's Avatar
    Join Date
    Nov 2008
    Location
    owner():pos()
    Posts
    13

    Default Re: Auto Anti-Aircraft turret

    Hmm... never thought of that. That's a good idea.
    "In an all-out global thermonuclear war, nobody wins. Everybody dies"
    ~Unknown
    76.2847% of all signature statistics are made up on the spot.

  8. #8
    Wire Sofaking Hitman271's Avatar
    Join Date
    Feb 2008
    Location
    Why? You looking for somebody?
    Posts
    731

    Default Re: Auto Anti-Aircraft turret

    Quote Originally Posted by Whodunnit View Post
    pics or no clicks
    That's what I said about your mom. Just kidding.

    Maybe have the turret barrels recoil on an interval of shots?
    Quote Originally Posted by Anticept View Post
    This is not some place where you can toss your dick around and expect people to suck it.
    Community Gpu Thread. Post Yours!

    Bouncy Ball

  9. #9
    Wire Sofaking Beer's Avatar
    Join Date
    Jul 2007
    Location
    Dallas, Texas
    Posts
    1,357

    Default Re: Auto Anti-Aircraft turret

    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.

  10. #10
    Wire Noob Rad Hazard's Avatar
    Join Date
    Nov 2008
    Location
    owner():pos()
    Posts
    13

    Default Re: Auto Anti-Aircraft turret

    Okay, thanks.
    "In an all-out global thermonuclear war, nobody wins. Everybody dies"
    ~Unknown
    76.2847% of all signature statistics are made up on the spot.

+ Reply to Thread

Similar Threads

  1. My anti-aircraft turret (Needs computer to aim it).
    By Koolguy007 in forum Finished contraptions
    Replies: 10
    Last Post: 04-08-2009, 12:16 AM
  2. Auto Turret Help
    By KillerBlonde in forum Installation and Malfunctions Support
    Replies: 9
    Last Post: 11-02-2008, 11:35 AM
  3. Anti Single-Ship Turret
    By bloodyshadow13 in forum Finished contraptions
    Replies: 7
    Last Post: 03-12-2008, 04:01 AM
  4. Auto turret
    By Sloth in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 08-09-2007, 05:39 AM
  5. qjet's auto turret help
    By undead82004 in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 06-03-2007, 10:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots