• Stargate Railgun
    154 replies, posted
[release][b]What is that?[/b] Everybody knows Railguns from Stargate TV show series :) I made my own version (because nobody did that), based on Atlantis (and maybe Universe) Railguns. It is still in progress, so don't complain, but help![/release] [release][b]Features:[/b] [list] [*] completely wirable, [*] HUD, [*] control it by keys, mouse or wire, [*] awesome tracer, [/list] [b]Wire:[/b] [list] [*] Bearing, Elevation, X, Y, Z, Angle, Vector, Entity inputs - easy to make auto-tracking system, [*] Fire, Active, Reload inputs, [*] Ammo and Heat output, [/list] [b]To-do list:[/b] [list] [*] finish model, [*] new textures (especially Universe textures), [*] new sounds, [*] sitting animation, [*] better mouse controlling, [/list] [/release] [release]Download: [url=http://www.garrysmod.org/downloads/?a=view&id=92762][img]http://www.garrysmod.org/img/?t=dll&id=92762[/img][/url][media]http://www.youtube.com/watch?v=jTWWiDVZO3w[/media] [IMG]http://i41.tinypic.com/5nu936.jpg[/IMG][/release]
Can we have pictures?
well,...i already downloaded it...but am still a bit curious about the ingame looks of it before i unzip the file... are there sounds already? if not,...i could try to provide you with the sounds of the daedalus railgun...
That's no problem, I added one picture for now. Uhm, I'm not sure if daedalus railgun sounds a bit different that stationary railgun, but please send me that sounds :) I will add more pictures when i will make more things :)
You better use the clientside KeyPress hook instead of checking every 0.2 seconds if a player presses a key in that SENT's Think-Function. Also: Code looks like a huge copy & paste: Variables are not always localized (breaking other scripts) and intending is random. You might also add a muzzle-flash and a better bullet-tracer effect so it is not only a prop which shoots bullets.
I know, that code look very bad, but its the way how im learning lua (I know C so programming isn't a problem). For now, i have problems with sending any data between client and server, i know that i should use SetNWInt, etc. but whatever I do, it's not working. I suppose that camera view should be also made on client-side, just like hud and keys? Use key, that we entering vehicle should be in server side?
For the KeyPress on clientside use [url]http://wiki.garrysmod.com/?title=Input.IsKeyDown[/url] and [url]http://wiki.garrysmod.com/?title=IN_KEYS[/url] for the Key Enumerations. Also, for SetNWInt something like: [lua] function ENT:Example() self:SetNWBool("Moving",self.Moving) -- Sets "Moving" to whatever self.Moving is EG. false or true if(self.Moving) then self:SetNWInt("Speed",0) -- Sets "Speed" to the number 0 self:SetNWEntity("Railgun",NULL) -- If were not using it set it as NULL self.Moving=false end if(not(self.Moving)) then self:SetNWInt("Speed",1) -- Were moving so lets set a number self:SetNWEntity("Railgun",self) -- Were moving set the entity as 'not' NULL self.Moving=true end end [/lua] Thats only a little help with SetNW*(This will just loop as self.Moving changes each time. It's just an example)
Ok, I figured it out, now I making HUD and keypressing on client side :)
Ok i updated my railgun. New link to the addon, with pictures is in first my post. Still much to do, but now its better. For now I have no idea how send data from client to server, it not working whatever i do. It recognise if i press key, but i cant receive any data in init. Second, my view isn't perfect. Im using a little part from Puddle jumper v2.5 with hud (i love that) but almost always model isn't drawing, see yourself. Third, it's bad idea to turn something using SetAngle(). If u throw it, then it can turn in air or do something strange. What should i do? Maybe some angular force? 4th, it take damage from players weapon, but not from spawned turret, i have no idea why... And 5th, i have problems with deleting. Remover working, but I need to remove all parts manually (stand, turn and cannon). Z key also not working. How to repair that? I know its because its 3 props connected by ballsockets. To do: - better model, - fix textures, - fix HUD texture, - fix camera, - put keys to the client side, - better turning, - fix taking damage, - fix feleting, - and of course, sound, im terrible at sound (and im musican) :P
found a slight error... ok ok,...it too obvious to be "found",...but when spawned, the textures don't show up (black/purple)
aww, forgot to copy textures. fixed.
[QUOTE=Madman07;19726217]Ok i updated my railgun. New link to the addon, with pictures is in first my post. Still much to do, but now its better. For now I have no idea how send data from client to server, it not working whatever i do. It recognise if i press key, but i cant receive any data in init. Second, my view isn't perfect. Im using a little part from Puddle jumper v2.5 with hud (i love that) but almost always model isn't drawing, see yourself. Third, it's bad idea to turn something using SetAngle(). If u throw it, then it can turn in air or do something strange. What should i do? Maybe some angular force? 4th, it take damage from players weapon, but not from spawned turret, i have no idea why... And 5th, i have problems with deleting. Remover working, but I need to remove all parts manually (stand, turn and cannon). Z key also not working. How to repair that? I know its because its 3 props connected by ballsockets. To do: - better model, - fix textures, - fix HUD texture, - fix camera, - put keys to the client side, - better turning, - fix taking damage, - fix feleting, - and of course, sound, im terrible at sound (and im musican) :P[/QUOTE] For key press: Init: [lua] function RecieveRGKeyPress(um) -- Make it move when self.UpPressed is true etc. self.UpPressed = um:ReadBool() self.DownPressed = um:ReadBool() end usermessage.Hook("RGKeyPress", RecieveRGKeyPress) [/lua] cl_init: [lua] function ENT:Think() umsg.Start("RGKeyPress",p) umsg.Short(self.UpPressed) -- do this for each key. Also when you check the KeyPress set EG. self.UpPressed to true and when its not to false. This is very hacky. umsg.End() end [/lua] THIS IS KEY PRESS SYSTEM IS NOT TESTED For model not drawing put: [lua]function ENT:Draw() self:DrawModel() end[/lua] in cl_init
I think there already is a model for this, which looks pretty much a lot better, it is in the SGmod addon, the only problem is, that I dont think it has a base to stand on. Check out the model, I think it will help you.
lol well i love it :P the only problem iv had is when i turn it with the physics gun it never turns lol
This is great! Only suggestions I have is change the textures to the original steel/metallic design and change the bullets into the small bright spheres as seen in the show.
i think u should make it destroyable that might sound stupid but u wanted ideas so i threw one out.
For now im working on ApplyAngForce, which is better than SetAngle, just few changes and it will work nice. OK i will change that texture :) Hmm i thought on making it destryable, I will do that, when i will fix some problems. Still, i have problems with model visibility when i enter this. I tryed everything, sometimes i see my model (when its moving), but often its invisible. Its also invisible for normal or rt camera so i have no idea what's wrong. That not working: [lua] function ENT:Draw() self:DrawModel() end function ENT:Think() self.Entity:DrawModel(); end [/lua]
[QUOTE=Madman07;19840155]Hmm i thought on making it destryable, I will do that, when i will fix some problems.[/QUOTE] Naaaw, don't make it destroyable lol, that will only give Mingebags and general assholes something to annoy other players with. Maybe you could just make it overheat like the .50 caliber gun in L4D2 if you fire it for too long, then have a long wait before it's useable again?
[QUOTE=Madman07;19840155]For now im working on ApplyAngForce, which is better than SetAngle, just few changes and it will work nice. OK i will change that texture :) Hmm i thought on making it destryable, I will do that, when i will fix some problems. Still, i have problems with model visibility when i enter this. I tryed everything, sometimes i see my model (when its moving), but often its invisible. Its also invisible for normal or rt camera so i have no idea what's wrong. That not working: [lua] function ENT:Draw() self:DrawModel() end [b] function ENT:Think() self.Entity:DrawModel(); end [/b] [/lua][/QUOTE] WTF?!? DrawModel should only be called in Draw.
[QUOTE=VaSTinY;19841174]Naaaw, don't make it destroyable lol, that will only give Mingebags and general assholes something to annoy other players with. Maybe you could just make it overheat like the .50 caliber gun in L4D2 if you fire it for too long, then have a long wait before it's useable again?[/QUOTE] Nice idea. Now u can fire until temp reach 100% (250 bullets), then u have to wait until it drops belowe 75%. Im thinking of making it using smal, white and red squares, like its in Battlefield 2. Ok RononDex, now i making only something like that: [lua] function ENT:Draw() self:DrawModel() end [/lua] and still its not working. I tryed to add in shared [lua] ENT.RenderGroup = RENDERGROUP_OPAQUE [/lua] but that didn't helped. Edit: When i dont see my model, i even dont see any props or NPC. When i spawn camera and activate it, then i see everything normally.
If you don't see any props or NPC's then it's probably not related to the Railgun.
It wasn't really working for me either, models and npc's wasn't showing up. Then I added this to cl_init, and it started working. [lua] function ENT:Draw() self:DrawModel() end [/lua]
I have some annoying error. Normally, when u press Z, everything u spawned, is undone. I can't undone my entity. punkrjp, how did u do that? I see everything normal (after entering my gun) only if I would spawn a camera, and switch to camera (when I'm inside of my gun). Without that, I cant see any models. But i see everything normally, when I'm not in my gun. There is some way to change bullet tracer to own tracer? I made new HUD: [IMG]http://i45.tinypic.com/xn6mo0.jpg[/IMG]
Very nice. [editline]09:19AM[/editline] Might be a lil bit to big though.
Looks like nice, but for me it's not completed yet. First off, you should change that texture, it actually looks like a sort of Flak 88 Second, change the bullet to make it as seen in the show, and make it destroy props Also, don't start bitching about mingebags, just get admins and no mingebag will be pissing you off with this Railgun ^^ I'm expecting a lot of change, and I'm pretty sure you can do it, let's just wait =)
[QUOTE=Opto;19858352]Looks like nice, but for me it's not completed yet. First off, you should change that texture, it actually looks like a sort of Flak 88 Second, change the bullet to make it as seen in the show, and make it destroy props Also, don't start bitching about mingebags, just get admins and no mingebag will be pissing you off with this Railgun ^^ I'm expecting a lot of change, and I'm pretty sure you can do it, let's just wait =)[/QUOTE] Your attitude is what makes great people leave facepunch, stop it.
I see, you are working nicely on it and including suggestions. Well done :)
[QUOTE=mobrockers;19858696]Your attitude is what makes great people leave facepunch, stop it.[/QUOTE] I'm not at all, I'm just giving my point about his rail gun, I'm not saying it's bad, I'm just saying it could be better =)
[QUOTE=Opto;19860240]I'm not at all, I'm just giving my point about his rail gun, I'm not saying it's bad, I'm just saying it could be better =)[/QUOTE] Thats what you think you are doing. This was not constructive at all. [editline]05:14PM[/editline] You are "expecting" him to change it because you dont think it is finished.
[QUOTE=mobrockers;19860303]Thats what you think you are doing. This was not constructive at all. [editline]05:14PM[/editline] You are "expecting" him to change it because you dont think it is finished.[/QUOTE] I just think it needs improvements. I just told my opinion about how to improve it.
Sorry, you need to Log In to post a reply to this thread.