Yay, Cool! Have a cookie
I haven't tried yet but this rocks!
I allways wanted to use the vector thrusters [VECTOR] input![]()
For a long time now Vector has been a registered Wire data type but they aren't supported by any gates at all, and only the Vector Thruster and the Target Finder even support them. So I've written a selection of Vector gates that will hopefully prove useful to people, and maybe even cause more wire devices to support the Vector data type.
To install just download the attached Lua file and chuck it in the garrysmod\addons\wire\lua\autorun directory. To use, go to the Gate tool on the Q menu (these gates do not appear under the Wire - Control section because that would require modification of the wire gates STOOL file).
Arithmetic Operations
Vector Operations
- Add
- Subtract
- Negate
- Multiply/Divide by constant
- Identity
- Random
Comparison
- Dot/Cross Product
- Yaw/Pitch (Degree/Radian)
- Magnitude
- Normalise
Rates of Change
- Equal
- Inequal
- Less-than
- Less-than or Equal-to
- Greater-than
- Greater-than or Equal-to
Conversion
- Component Derivative
- Component Integral
Miscellaneous
- Conversion To/From Component Values
- Multiplexer
- Demultiplexer
- Latch
- D-latch
All comments and feedback are welcome. Enjoy!
EDIT: Removed download, get them from here instead.
Last edited by DuFace; 07-12-2008 at 05:07 AM. Reason: Removed download.
Yay, Cool! Have a cookie
I haven't tried yet but this rocks!
I allways wanted to use the vector thrusters [VECTOR] input![]()
Last edited by Wodden; 06-29-2008 at 08:29 AM. Reason: can't type...
Warning: You're trying to render in the wrong place. This doesn't play nice with multi-core rendering, so we're not going to let you draw here.
Mmm...the to/from gate will be useful. Just to note, the expression gate does support vectors internally, it can convert all sorts of numbers to vectors, add them, subtract them, rotate them, multiply them, all that jazz, and it can send vectors to other expression gates, as well. The problem with E-Gate version 1 is that for whatever reason it can't send vectors to other devices, so no vector thruster functionality. This will come in very handy!
Thanks for the comments guys, and I did very much enjoy my cookie.
I know the Expression Gate has intrinsic vector support and I use it fairly often. Your comment reminded me that I uploaded the wrong version actually. I started making this on Friday and it was part of a 50+ gate mega pack but the other gates still need some work so I just copied the vector gates out of that source file into the one I uploaded. I missed four gates off the bottom that you might find handy:
- Convert To/From E-Gate Vector
- Convert Components To/From E-Gate Vector
Granted the latter gates are a bit useless because you could just use another Expression Gate, but I suppose it could be useful for remote control vehicles. For example:
Or:
- Expression Gate at base station gives out an E-Gate vector
- Value sent over radio to vehicle
- Vector Conversion Gate transforms from E-Gate Vector to [Vector]
- [Vector] handed to vector thruster
- GPS on-board vehicle gives out world coordinates as components
- Component Conversion Gate transforms into E-Gate vector
- Value sent over radio
- Expression Gate at base station receives a pre-packaged E-Gate vector.
I've updated the initial post, hopefully this will be of a bit more use now!
Last edited by DuFace; 07-12-2008 at 05:07 AM.
Do you want this in svn?
Sure why not? Hopefully some people will find it beneficial.
Fields of Green
Bookmarks