Combat assistance drone

From GMod Wiki

Jump to: navigation, search
Deletion.pngThis page has been nominated for deletion. Deletion is due within approximately 30 days from nomination, unless the deletion has been disputed on the talk page. See more pages nominated for deletion here.
Reason for deletion: Not what Garry wants the wiki to be used for
Last Edit was made on 11/16/2011



Contents

Combat assistance drone

Combat assistance drone: Combat assistance drone
Page white text.png Description:A wire tutorial for a hovering drone that follows the owner and attacks enemies
User.png Original Author:ZeroPlus
Calendar.png Created:4/11/10
Page white text.png Notes:-


Please bear with me, as this this is my first contribution to this site.

In this tutorial, I will explain how to make a drone that assists you in killing NPCs and possibly in becoming a mingebag protecting you from mingebags. I think this process is tedious enough that the common mingebag wouldn't attempt it, so we're relatively safe.

Notes

  1. In the tutorial, multiple elements will be used more than once. To avoid confusion, each element will be assigned a number. Ex: Target finder(1) or target finder(2). This is so you know which one I'm talking about; it does not mean you should spawn that number of elements. Later in the process, each element will be called by a certain name and will more easily identified.
  2. Near the end, some elements with numbers are going to be wired to others. The first number in parentheses is the nth one you placed, and the second set of parentheses pertains to the in/output of that wire element. For example: Turret(3)(fire)->target finder(2)(1). This means that the fire input of the 3rd turret you've placed corresponds to the "target acquired" output of the 2nd target finder you've placed.
  3. !WARNING!
    • Due to small lua errors in the wire facer and wire freezer, this contraption is not adv_dup-able. Once you get the hang of it, you could be able to rebuild this whenever you want. If anyone has a fix for this, please say so.

Requirements

For best results, you will need:

  1. Wiremod(duh)
  2. Spacebuild Model Pack
  3. Wiremod/UWSVN

Spacebuild Model Packs isn't required, but it has the best prop for the task at hand.

Creation

The facer tool spawns an exact replica of the prop, but it has wire capabilities and isn't adv_dup-able.

Setting up

  1. Spawn a PHX plate (I used a 2x2, but a 1x2 works better).
  2. Spawn your drone base. If you're using SB model packs, under Browse, go to Spacebuild Model Packs->Spacebuild->Nova, and spawn the "drone2".
  3. Using the "facer" stool from the Wiremod UWSVN, right-click on the drone, then left-click anywhere near you. This should spawn another drone.
  4. Delete the first drone. You only needed it to get the prop type for the facer tool.
Put the turret right by the drone's eye, making sure it faces directly forward.

Building the drone

  1. Using the wire turret tool, change the variables to:
    • 4 bullets per shot
    • 0.1 second interval
    • 3 damage per shot
    • 0.1 spread
  2. Put the turret on the drone, right next to the eye.
    These two are used to detect the enemy's position.
  3. Spawn a wire target finder(1) on the back of the drone, with the following settings:
    • Target players
    • Do not target owner
    • Target NPCs
    • Range: 2000
    • If you want the drone to only target a specific player or NPC, enter the player name or NPC type into the appropriate filter
  4. Spawn a Sensor Beacon(1) on the PHX plate, with only these options checked:
    • Split X,Y,Z
    • Output distance
    • Output world position
  5. Link the Beacon to the Finder
  6. Using the Namer tool, name the sensor and beacon "enemy targeter"
    Be sure the beacon sensor(2) is facing front. You don't need to nocollide anything to get the beacon back there.
    These two are used to detect the owner's position.
  7. Spawn a target finder(2) on the side of the drone, with these settings:
    • Target players
    • Range: 100000000000000
    • Name filter: (insert your nickname here)
  8. Spawn a sensor beacon(2) behind the drone eye (see picture):
    • Split X,Y,Z
    • Output distance
    • Output world position
  9. Be ABSOLUTELY sure that the figure is facing directly forward. However, directly spawning the beacon directly on the drone results in an angle. The best way to make sure is to look at the ghost for the future beacon sensor. If it's not aligned, unfreeze the drone, let it hit the ground, and re-snap and re-freeze it. Check the ghost again. If not aligned, repeat. Eventually, the ghost should be directly aligned with the drone.
    Orientation does not matter in this case, and an accompanying beacon sensor is not needed.
  10. Link the beacon sensor(2) and target finder(2), and name them both "owner targeter"
  11. Spawn a target finder(3) on the bottom of the drone:
    This is only to give the Optical Sensor a target. The reason the one in the picture is red is because I had "paint target" checked for debugging purposes.
    • Target props
    • Range: 30
    • Prop filter: watersensor_nano
  12. Name the target finder(3) "Optical Sensor"
  13. Spawn, under "Browse": Wire Model Pack 1->beer->wiremod->watersensor_nano
  14. Easy-weld the water sensor to the middle of the drone's eye
  15. Spawn 2 vector thrusters, on in front, and one in back. Again, make sure they're aligned facing forward. A good model to use is the speedometer; the arrow points
    Same deal. For these thrusters, keep them as close to the center line as possible.
    forward. Shift+e snap the drone, then spawn the thrusters, and while rotating, hold shift and set them pointing forward.
    • No Effects
    • No Effects
    • force multiplier: 50
    • min: 0
      Again, make sure the needle is pointing forward.
    • max: 1000
    • bidirectional
    • collision
    • works in/out of water
    • XYZ local
  16. Spawn another vector thruster on top of the drone. Alignment does not matter. Use the same settings as above, but set it to XYZ world.
    For the top thruster, alignment or position don't matter. All that is required is that the thruster is set to XYZ world.

Building the base

On the PHX plate, spawn the following wire tools:

  1. Entity - can see
    • Name this "Optic Sensor"
  2. Constant Value
    • 300
    • 2
    • -2
    • -1
  3. Comparison - Greater than
  4. Comparison - Less than or equal
  5. Arithmetic - Multiply(1)
  6. Arithmetic - Multiply(2)
    Even though this uses a 2x2, a 2x1 is a more efficient use of space.
  7. Arithmetic - Average
  8. Arithmetic - Negate(1)
  9. Arithmetic - Negate(2)
  10. Vector - Compose
  11. Physics - Freezer
    • To place this, first left-click on the actual drone body, then click on the PHX plate where you want the controller to spawn.

Wiring it all together

  1. Facer(X)->Enemy targeter beacon(World_X)
  2. Facer(Y)->Enemy targeter beacon(World_Y)
  3. Facer(Z)->Enemy targeter beacon(World_Z)
  4. Facer(On)->Optic sensor can see(out)
  5. Freezer(Activate)->Optic sensor can see(out)
  6. Optic Sensor Can See(A)->Optic Sensor finder(1_Entity)
    Not all connections are shown, but this gives a general layout for what should be going on.
  7. Optic Sensor Can See(B)->Enemy targeter finder(1_Entity)
  8. Greater than(A)->Owner targeter beacon (distance)
  9. Greater than(B)->Constant value(300)
  10. Less than or equal(A)->Owner targeter beacon (distance)
  11. Less than or equal(B)->Constant value(300)
  12. Multiply(1)(A)->Greater than(out)
  13. Multiply(1)(B)->Constant value(2)
  14. Multiply(2)(A)->Less than or equal(out)
  15. Multiply(2)(B)->Constant value(-2)
  16. Average(A)->Multiply(1)(out)
  17. Average(B)->Multiply(2)(out)
  18. Negate(1)(A)->Owner targeter beacon(Z)
  19. Negate(2)(A)->Owner targeter beacon(Y)
  20. Compose(X)->Negate(2)
  21. Compose(Y)->Owner targeter beacon(X)
  22. Compose(Z)->Negate(1)
  23. Front/back vector thruster(mul)->Average(out)
  24. Front/back vector thruster(Vector)->Compose(Vector)
  25. Top vector thruster(Z)->Constant value(-1)
  26. Turret(fire)->Optic sensor can see(out)

Lightening things up

  1. Select the weight stool (regular, not wire)
  2. Set target weight to 0.0000000001
  3. Click on everything on the drone, excluding:
    • Thrusters
    • The drone body
  4. Select the physical properties stool (regular)
  5. Set target material to metal
  6. Uncheck gravity toggle
  7. Click on everything on the drone, everything.
  8. Select the materials stool (regular)
  9. Set target skin to "Vol_light001"
  10. Click on these components of the drone:
    • Target finders
    • Beacon sensors
    • Vector thrusters
    • Water sensor nanochips
  11. Unfreeze everything
  12. Have fun!

If you have any questions, post something in this page's discussion. Also, if anyone finds a fix to the broken adv_dupe mechanism for the facer and the freezer, please post it in the discussion as well.

Modifications

This is a list of stuff that you can do to further improve the drone, aside from just changing the turret's damage. Add your own if you have an idea:

  1. For the front and back thrusters, change the front's original thrust multiplier to 10.

This causes the drone to more accurately face forward when moving, instead of rotating aimlessly.

  1. Add two values to the constant value chip on the PHX plate: 1000 and 10
  2. Add a "greater than" chip(2) to the PHX plate
  3. Wire the greater than chip:
    • A->Owner targeter beacon (distance)
    • B->Constant value(1000)
  4. Add a multiply chip(3) to the PHX plate
  5. Wire it:
    • A->Greater than(2)(out)
    • B->Constant value(10)
  6. Add an "add" chip to the PHX plate
  7. Wire it:
    • A->Multiply(3)(out)
    • B->Average(out) (the one that outputs a +1 or -1 for the vector thrust)
  8. Re-wire the front and back vector thrusters:
    • Mul->add

This makes the drone move 10 times as quickly when more than 1000 distance units away. This is useful in that it causes the drone to catch up to you if trailing behind.

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox