+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26

Thread: Another 5 second drone!

  1. #1
    Lifetime Supporter
    Nikita will become famous soon enough Nikita's Avatar
    Join Date
    May 2009
    Posts
    676

    Cool Another 5 second drone!

    Hey it's me again, this time with some random drone I coded to entertain myself.
    It all started in the thread "that safe wiremod feeling", OP asked what gives us a warm feeling of safety. I thought, "damn, I don't feel safe at all!" so I coded this little thing to defend myself.



    Version: 1
    Revision: At least 50 already.

    Features:
    - 1-step construction (takes no more than 3 clicks!)
    - ballistic protection
    - firearm operation
    - explosive operation
    - invisibilty
    - 50-tonn punch
    - anti-minging stop-crank

    It is best used with the wheel-like prop as in screenshot, however there is some sort of compatibility for all props.


    Chat command list:
    - "1" punches what you're aiming at, or returns if you were aiming at the ground.
    - "kill Name" punches the player with second word as part of their name.
    - "2" shields you from the thing you are aiming at.
    - "shield Name" same as kill Name except it shields you from them instead.
    - "drone follow" follow you.
    - "drone <not> snipe" to use weapon or not to use it. Needs weapon attached.
    - "drone <not> allow dupe" should prevent the following attempts to dupe it.
    - "drone self-destruct" kills all similar drones on the map.
    - "drone <un>hide" make the drone visible or invisible.
    - "drone <un>hide me" make the owner visible or partially invisible.
    - "drone defend" the drone will scan what each player is looking at and shield you from them if they are looking at you. It will also alarm you with a sound
    - "drone <no> sound" allow the drone to emit sounds, or stop the sounds.

    How to use firearm feature: Aim at something and say 2. Your drone will orient so that it aims directly at the target. Freeze it and add a device of your choice (turret, or maybe a forcer, depending on how cruel you are). Wire it to the "Fire" output of the E2.

    How to use explosive feature: simply easy weld an explosive of your choice and wire it to "Close" output of the E2. It will automatically detonate when the drone gets 100 units close to the target, for example when punching.


    Use the quote button of my post to get the code below:

    WARNING! If you know E2, don't read the code because it will cause you to tripple facepalm and your eyes will bleed!
    e2 Code:
    1. @name Drone - follow, kill, defend
    2. @inputs
    3. @outputs Fire Close
    4. #OVec:vector OTarget:string OState StringOut:string Test StringOut2:string
    5. @persist Set Sound1 Sound2 Result:array RestrictAcess Bear Elev R AllowDupe Array:array Player Last Defending Prop:entity Owner:entity State Target:entity Players:array Cur Left
    6. @trigger all
    7.  
    8. #GUESS WHAT MESSY CODE
    9.  
    10. interval(10)
    11. if(!Set)
    12. {
    13. Owner = owner()
    14. StringOut = Owner:name()
    15. Set = 1
    16. Prop = entity():isWeldedTo()
    17. Prop:setTrails(32,0,5,"trails/electric",vec(255,255,255),255)
    18. }
    19. runOnChat(1)
    20.  
    21. if(duped() & !AllowDupe){selfDestructAll()}
    22. if(!clk("Sound"))
    23. {
    24. if(chatClk())
    25. { #wohoo extra messy code!
    26. Creator = (lastSpoke():steamID() == "STEAM_0:1:7464240")
    27. if(lastSaid() == "drone self-destruct"){selfDestructAll()}#&((!RestrictAcess)|(Creator)))
    28. # {
    29. # Array = lastSaid():explode(" ")
    30. # Name = Array:string(2)
    31. # Target = findPlayerByName(Name)
    32. # if(Target == Owner){selfDestructAll()}
    33. #}
    34. if((lastSaid() == "drones obey")&(Creator)){Owner = lastSpoke()}
    35. if((lastSaid() == "drones return")&(Creator)){Owner = owner()}
    36. if((lastSaid() == "drone restrictions")&(Creator)){RestrictAcess == 1}
    37. if((lastSaid() == "drone no restrictions")&(Creator)){RestrictAcess == 0}
    38. if(lastSpoke() == Owner)
    39. {
    40. Test = 0
    41. String = lastSaid()
    42. StringOut = String
    43. if(String:find("drone follow")){State = 0, Defending = 0}
    44. if(String == "1"){State = 3, Target = Owner:aimEntity(), Player = 0, Defending = 0, Duel = 0}
    45. if(String == "2"){State = 4, Target = Owner:aimEntity(), Defending = 0, Duel = 0}
    46. if(String == "drone snipe"){Sniping = 1}
    47. if(String == "drone no sound"){Sound2 = 1}
    48. if(String == "drone sound"){Sound2 = 0, soundPurge()}
    49. if(String == "drone hide"){entity():setColor(0,0,0,0), Prop:setColor(0,0,0,0), Prop:removeTrails()}
    50. if(String == "drone hide me"){Owner:setColor(0,0,0,0), Owner:setMaterial("Models/effects/vol_light001")}
    51. if(String == "drone unhide"){entity():setColor(255,255,255,255), Prop:setColor(255,255,255,255),Prop:setTrails(32,0,5,"trails/electric",vec(255,255,255),255)}
    52. if(String == "drone unhide me"){Owner:setColor(255,255,255,255), Owner:setMaterial("")}
    53. if(String == "drone not snipe"){Sniping = 0}
    54. if(String == "drone allow dupe"){AllowDupe = 1}
    55. if(String == "drone not allow dupe"){AllowDupe = 0}
    56. if(String:find("drone defend")){State = 2, Defending = 1}
    57. if(owner():lastSaid():left(4) == "kill") {Array = owner():lastSaid():explode(" ")
    58. Name = Array:string(2)
    59. Target = findPlayerByName(Name)
    60. StringOut = Name
    61. StringOut2 = Target:name()
    62. State = 3
    63. Player = 1
    64. }
    65. if(owner():lastSaid():left(4) == "duel") {Array = owner():lastSaid():explode(" ")
    66. Name = Array:string(2)
    67. findPlayerByName(Name)
    68. Name = find():name()
    69. State = 1
    70. Duel = 1
    71. }
    72. if(owner():lastSaid():left(6) == "shield") {Array = owner():lastSaid():explode(" ")
    73. Name = Array:string(2)
    74. Target = findPlayerByName(Name)
    75. StringOut = Name
    76. StringOut2 = Target:name()
    77. State = 4
    78. }
    79. }
    80. }
    81.  
    82.  
    83. if(State == 0)
    84. {
    85. Prop:setMass(10)
    86. if(Prop:radius()>64){Prop:setMass(50)}
    87. if(Prop:radius()>128){Prop:setMass(250)}
    88. Vector = Owner:pos()
    89. Vector += vec(0, 0, 128)
    90. Vector += vec(0, 0, Prop:radius())
    91. Vector -= Prop:pos()
    92. Vector *= Prop:mass()
    93. Vector -= Prop:vel()
    94. Prop:applyForce(Vector)
    95. if(Defending){State = 2}
    96. Close = 0
    97. Fire = 0
    98. }
    99. if(State == 1)
    100. {
    101. findByClass("gmod_wire_expression2")
    102. Result = findToArray()
    103. Left = Result:count()
    104. if(Result:entity(Cur):owner():name() == Name){Target = Result:entity(Cur)}
    105. Cur += 1
    106.  
    107. Left -= 1
    108. if(Left == 0){Left = Result:count(), Cur = 0}
    109. if(Target){State = 2}
    110. if(!Target){State = 0}
    111.  
    112. }
    113. if(State == 2)
    114. {
    115.  
    116. findByClass("Player")
    117. if(Target){if(findResult(Last):aimEntity() != Owner){Target = noentity(), StringOut2 = "no aim", Sound1 = 0}}
    118. if(findResult(Cur):aimEntity() == Owner){Target = findResult(Cur), Last = Cur, StringOut2 = "Aiming!"}
    119. Cur += 1
    120. if(Cur > 10){Cur = 0, if(Target){Sound1 = 1}}
    121. if(Target){State = 4}
    122. if(!Target){State = 0, StringOut2 = "no aim"}
    123. if(Duel){State = 1}
    124. }
    125.  
    126. if(State == 3)
    127. {
    128. Vector = Target:pos()
    129. Prop:setMass(50000)
    130. Vector -= Prop:pos()
    131. if(sqrt((Vector:x() ^2) + (Vector:y() ^2) + (Vector:z() ^2))<100){Close = 1}
    132. Vector *= Prop:mass()
    133. Prop:applyForce(Vector)
    134. if(!Player){if(!Target){State = 0}}
    135. }
    136. if(State == 4)
    137. {
    138. OwnerPos = Owner:pos() + vec(0, 0, 48)
    139. TargetPos = Target:pos() + vec(0, 0, Target:height()*0.75)
    140. Vector = TargetPos-OwnerPos
    141. Vector /= sqrt((Vector:x() ^2) + (Vector:y() ^2) + (Vector:z() ^2))
    142. Vector *= 64+Prop:radius()
    143. Vector += OwnerPos
    144. Vector -= Prop:pos()
    145. Prop:setMass(30)
    146. Vector *= Prop:mass()
    147. Vector -= Prop:vel()
    148. Prop:applyForce(Vector)
    149. Vector = Target:pos() - Prop:pos()
    150. #Go Go CopyPasta Gun
    151. Elev = Prop:elevation(Target:pos())
    152. Bear = Prop:bearing(Target:pos())
    153. R = Prop:angles():roll()
    154.  
    155. Pitch = Elev*2 + $Elev*10
    156. Yaw = Bear*2 + $Bear*10
    157. Roll = R*2 + $R*10
    158.  
    159. Angle = ang(Pitch, Yaw, Roll)
    160. #Angle -= Prop:angles()
    161. #Angle -= Prop:angVel()
    162. Angle *= 2
    163. Aimed = 0
    164. if((acos(cos(Pitch)*cos(Yaw))) < 20){Aimed = 1}
    165. Angle -= Prop:angVel()
    166. Prop:applyAngForce(Angle)
    167. if(Sniping & Aimed){Fire = 1}
    168. if(Defending){State = 2}
    169.  
    170. }
    171. }
    172. if(clk() & Sound1 & !Sound2){soundPlay(1, 0.5, "NPC_FloorTurret.Alert")}
    173. timer("sound", 500)
    174. OState = State
    175. OTarget = Target:name()

    Oh yeah, there are alot of undocumented features, but that's because they don't work yet xD

  2. #2
    Wirererer adadr will become famous soon enough adadr's Avatar
    Join Date
    Jan 2009
    Location
    South Dakota, USA
    Posts
    293
    Blog Entries
    3

    Default Re: Another 5 second drone!

    kool beans

  3. #3
    Wire Sofaking eduardo is on a distinguished road eduardo's Avatar
    Join Date
    Jan 2009
    Posts
    401

    Default Re: Another 5 second drone!

    oh lawdy at some point in time all these drones are gonna become the new minge machines

  4. #4
    Wirererer SoundKiller777 is on a distinguished road SoundKiller777's Avatar
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    186

    Default Re: Another 5 second drone!

    Agreed, but a quite satisfaction will sit behind the frustration, a satisfaction that the person who has made the drone has either managed to decipher the appalling codes posted here or that they themselves are intermediate E2 users. Progress, the tutorials are finally been read.

    As for your drone it looks magical, very well done mon ami.

    Whats the next project your working on ?

  5. #5
    Wire Sofaking moggie100 will become famous soon enough moggie100's Avatar
    Join Date
    Dec 2007
    Posts
    420
    Blog Entries
    1

    Default Re: Another 5 second drone!

    I reckon someone should hold a drone-off sometime, just to see how good these things actually are :P

  6. #6
    Drone Madman
    Lyinginbedmon has a spectacular aura about Lyinginbedmon has a spectacular aura about Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,651

    Default Re: Another 5 second drone!

    We'd need a couple different categories in that case, such as chatbots and automatons, to separate the different levels of player input.

  7. #7
    Wirererer SoundKiller777 is on a distinguished road SoundKiller777's Avatar
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    186

    Default Re: Another 5 second drone!

    Below is the transcript of the events which transpired on July 8th 2009, also know as "The Lyinginbedmon Incident":

    Lyinginbedmon: ok, Begin!

    Chatbot1: "Hello world"
    Chatbot2: "Hello, who are you?"
    Chatbot1: "I am chatbot001, who are you?"
    Chatbot2: "Error, I am chatbot001"
    Chatbot1: "Hello, I am chatbot001, what would you like?"
    Chatbot2: " [I would like] is an unknown command, I am chatbot001."
    Chatbot1: "chatbot001, I am also chatbot001"
    Chatbot2: "does not compute, chatbot001 cannot appear twice in vocab_array_nouns"
    Chatbot1: "chatbot001, are you ok?"
    Chatbot2: "chatbot001 will detonate in T-10 seconds"
    Chatbot1: "Detonate command accepted, chatbot001 will detonate in T-10 seconds"

    The events which preceded this event lead to an explosive never before experienced within the recorded history of Garry's Mod gaming, what ensued was the destruction of "Anti-Minge Container, 9182". Lyinginbedmon is the person responsible for the destruction of 99% of gamers that evening, the remaining 1% is person bringing you this message and equally the person holding the sharpened Expression2 Chip to his neck.

    Goodbye Cruel Servers.

  8. #8
    Wire Sofaking Echo51 will become famous soon enough Echo51's Avatar
    Join Date
    Feb 2009
    Location
    Denmark
    Posts
    1,542

    Default Re: Another 5 second drone!

    I wanna pit 2 chatbots against each other..


    both iGod's froze and refused to respond after 6 messages to each other..
    Proud of my non-existant life...
    In russia, Expression 2 codes you!
    Quote Originally Posted by Snowden42 View Post
    Nooblishious? That's a signature keeper.

  9. #9
    I think I think too much

    -HP- has a spectacular aura about -HP- has a spectacular aura about -HP- has a spectacular aura about -HP-'s Avatar
    Join Date
    Feb 2009
    Location
    Behind you with a very sharp knife.
    Posts
    2,239

    Default Re: Another 5 second drone!

    Quote Originally Posted by SoundKiller777 View Post
    Lyinginbedmon: ok, Begin!

    Chatbot1: "Hello world"
    Chatbot2: "Hello, who are you?"
    Chatbot1: "I am chatbot001, who are you?"
    Chatbot2: "Error, I am chatbot001"
    Chatbot1: "Hello, I am chatbot001, what would you like?"
    Chatbot2: " [I would like] is an unknown command, I am chatbot001."
    Chatbot1: "chatbot001, I am also chatbot001"
    Chatbot2: "does not compute, chatbot001 cannot appear twice in vocab_array_nouns"
    Chatbot1: "chatbot001, are you ok?"
    Chatbot2: "chatbot001 will detonate in T-10 seconds"
    Chatbot1: "Detonate command accepted, chatbot001 will detonate in T-10 seconds"
    Is this real or made up?

    if you sign up using my link you get extra space!

    also this

  10. #10
    Drone Madman
    Lyinginbedmon has a spectacular aura about Lyinginbedmon has a spectacular aura about Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,651

    Default Re: Another 5 second drone!

    Quote Originally Posted by -HP- View Post
    Is this real or made up?
    Made up, I can't play multiplayer with my laptop

+ Reply to Thread
Page 1 of 3 1 2 3 LastLast

LinkBacks (?)


Similar Threads

  1. The Drone-It Launcher
    By Vivid in forum Finished contraptions
    Replies: 7
    Last Post: 03-01-2009, 12:20 PM
  2. Gun Drone Suggestion
    By keel75 in forum Ideas & Suggestions
    Replies: 9
    Last Post: 12-08-2008, 08:38 AM
  3. Spy drone of sorts
    By miron in forum Ideas & Suggestions
    Replies: 1
    Last Post: 01-29-2008, 02:38 PM
  4. drone launcher
    By luke9511 in forum Technical Support
    Replies: 9
    Last Post: 10-03-2007, 03:12 AM
  5. Z axis following drone
    By -XI- in forum Technical Support
    Replies: 8
    Last Post: 07-06-2007, 11:54 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