'Echolocation' effect / possible gametype (code release)
6 replies, posted
[video=youtube;9F-7Q5OnRko]http://www.youtube.com/watch?v=9F-7Q5OnRko&hq=1[/video]
Code + map source: [url]https://www.dropbox.com/s/jhie73xkiwvbdji/wt_echolocation.zip[/url]
Workshop addon: [url]http://steamcommunity.com/sharedfiles/filedetails/?id=211455847[/url]
-What is this addon-
It includes a level and some code. The level is completely dark with a custom material on the walls for effect.
By binding a key to the command "wt_echo" you can fire out an invisible beam that makes light when it hits the wall. The invisible beam (your 'echo') can bounce up to 3 times. Each player only sees their own echo lights.
-Why?-
See the video for what it's like and to get an idea of what could be done with it. I am releasing the code for anyone to learn from (even though it's somewhat messy and all in one file (not a good idea for writing a proper gamemode)) or play with. 'Echolocation' is an interesting concept for use in a game and I wanted to see what I could get working in Garrysmod. It would be interesting to see if anyone uses this for a new gamemode or something.
-The code + map source-
Download the zip file from here [url]https://www.dropbox.com/s/jhie73xkiwvbdji/wt_echolocation.zip[/url]
Unpack to your addons folder
(If you have this in your addons folder you should disable the workshop version)
-Misc Details-
The code will only run when on a map with a matching name ( starting with wt_el_ ), so it won't interfere with standard gameplay. In this addon it includes a simple bar on the hud showing your 'power level' which limits how often you can shoot out echo beams; the hud and the power limit can be turned off easily within the code, but not in the workshop version. (Hud only shows when the addon is active, when on the correct level).
Each player only sees their own echo lights, this can also be easily changed in one line in the code.
Neat idea, a PvP gamemode like this could be fun
Imagine if players only showed up if they were moving, or bullets creating noise
If anyone wants to write something, I'd be more than happy to help out
[QUOTE=rejax;43389280]Neat idea, a PvP gamemode like this could be fun
Imagine if players only showed up if they were moving, or bullets creating noise[/QUOTE]
It's pretty fun, I had a few players join and it gets pretty intense.
I considered doing a simple pistol swep that fires an echo in bullet impact, but I did this all just this afternoon and wanted to get it off my hands :p
Yeah, I'll play around with it when I get home.
Is the echo written as an entity that can be "fired" from a player? And how are the echos defined?
[QUOTE=rejax;43389474]Yeah, I'll play around with it when I get home.
Is the echo written as an entity that can be "fired" from a player? And how are the echos defined?[/QUOTE]
They aren't proper entities, just lua objects with an Update method thats called on a timer. On the server the Update does a trace and moves its position, when it collides it tells the client to create a light there (it actually creates another entity/object that fades the light over time).
As the code is, the only way of firing them from an external function is via the player meta table, but there is EchoBeam and BeamManager class that could be globalised.
If a 'beam' doesn't have an owner then when it collides the light is sent to all players, so they can be fired from anywhere/anything.
Everything is literally in the one file, but its all pretty much commented. If you use an editor with code folding it helps to fold everything down and then dig into it. It could be cleaned up simply by moving the if CLIENT and if SERVER parts to separate files, maybe with another file for the hud.
Slender like this could be interesting too
This is pretty cool
[editline]swag[/editline]
penis
Sorry, you need to Log In to post a reply to this thread.