• SWEP Construction Kit - developer tool for modifying viewmodels / ironsights
    714 replies, posted
  • Avatar of Clavus
  • [QUOTE=.\\Shadow};26439570]Mind including an example weapon with this, or someone handing one out? Mainly how to get the view model to work on a dedi... :P[/QUOTE] If you follow the base code instructions by the letter it should work just fine. Give me a link to your SWEP code and I'll tell you why it doesn't work.
  • I don't really get the [quote]Call SWEP:CreateViewModels() in your SWEP:Initialize() function[/quote] part. Mind giving an example? Do I just add the code to the weapon base the swep uses, then do whatever above is? :P
  • Avatar of Clavus
  • [QUOTE=.\\Shadow};26449789]I don't really get the part. Mind giving an example? Do I just add the code to the weapon base the swep uses, then do whatever above is? :P[/QUOTE] [lua] function SWEP:Initialize() // here goes your other initialize code if CLIENT then self:CreateViewModels() end end [/lua]
  • Avatar of Ashmourne
  • [QUOTE=Clavus;26451992][lua] function SWEP:Initialize() // here goes your other initialize code if CLIENT then self:CreateViewModels() end end [/lua][/QUOTE] I myself am confused. I'm not all that much of a scripter, but i can script sweps. The longer code in the original post that is client side is what i am confused about. Am i supposed to put that in the cl_init file? or am i supposed to create a new file all together and put it in lua/autorun/client? or something else?
  • Avatar of Clavus
  • If a SWEP folder only contains a shared.lua, both the client and the server will load it. If you add an init.lua and cl_init.lua, the server and client will load those respectively (and you have to add include("shared.lua") in both so the shared code gets called too). In shared code you can use the global constants CLIENT and SERVER to point that only one of them should execute that specific piece of code.
  • Avatar of Ashmourne
  • [QUOTE=Clavus;26455073]If a SWEP folder only contains a shared.lua, both the client and the server will load it. If you add an init.lua and cl_init.lua, the server and client will load those respectively (and you have to add include("shared.lua") in both so the shared code gets called too). In shared code you can use the global constants CLIENT and SERVER to point that only one of them should execute that specific piece of code.[/QUOTE] Alright thx, i thought you meant add a new file
  • Avatar of Xx_^^69^^_xX
  • [ snipped ] click a mouse button? [highlight](User was banned for this post ("Quoting a humongous post with a four-word reply (?!)" - mahalis))[/highlight]
  • Avatar of ralle105
  • Please make the x/y/z and pitch/yaw/roll controls sliders:sigh: Also nice to get WModels too:clint:
  • Avatar of Andriko1
  • You need to add onto this, such as make the first tab's stuff saveable, or save all settings to console/to clipboard, or even better, TO A FILE
  • Avatar of Clavus
  • [QUOTE=Andriko1;26459970]You need to add onto this, such as make the first tab's stuff saveable, or save all settings to console/to clipboard, or even better, TO A FILE[/QUOTE] Implemented that yesterday evening. The entire configuration can be saved to a glon encoded file. That update will go public once I have viewmodel to worldmodel transfers done.
  • Avatar of ozzypozzy
  • Awesome. Could you make it so you make it so you can mess around with the power, recoil, accuracy or even launching stuff. I don't code so I don't know how hard it will be. I understand that some things simply can't be coded. :)
  • Avatar of ralle105
  • [QUOTE=ozzypozzy;26466910]Awesome. Could you make it so you make it so you can mess around with the power, recoil, accuracy or even launching stuff. I don't code so I don't know how hard it will be. I understand that some things simply can't be coded. :)[/QUOTE] This isn't a swep creator, it's just a dev tool to create more interesting looking weapons.
  • Avatar of ozzypozzy
  • Oh, OK but I'd immediately change the name. When I saw "SWEP Construction Kit" I thought that it'd make SWEP's rather than V_models. Don't get the wrong end of the stick this is a good release.
  • Avatar of Clavus
  • UPDATE: * Added worldmodel positioning! * Added design saving and loading * Fixed sprites being drawn behind models * Changing numberwang textfields now directly updates the value [url=http://www.garrysmod.org/downloads/?a=view&id=114233][img]http://www.garrysmod.org/img/?t=dll&id=114233[/img][/url] Updated OP with new tutorial!
  • Avatar of Cardcapture1
  • For some reason I put the self:CreateViewModels() in the shared file under Initialize() and only run for CLIENT, but i still cant see it. I put it in the weapon base I have for TTT. I executed it clientside while I have the weapon out and it works. Also if I ran the command more than once on a client the models/sprites won't stack right?
  • Avatar of Clavus
  • [QUOTE=Cardcapture1;26472898]For some reason I put the self:CreateViewModels() in the shared file under Initialize() and only run for CLIENT, but i still cant see it. I put it in the weapon base I have for TTT. I executed it clientside while I have the weapon out and it works. Also if I ran the command more than once on a client the models/sprites won't stack right?[/QUOTE] They won't stack. Do mind that for the new version there is new base code.
  • Avatar of Cardcapture1
  • [QUOTE=Clavus;26472965]They won't stack. Do mind that for the new version there is new base code.[/QUOTE] Ya I see that. Plan on adding an import function that opens a text field to input the VElements data in-case you want to edit without having to recreate? EDIT: Nvm. Lol didn't check the new update before typing that. EDIT v2: The viewmodel position looks entirely different. It looks a lot closer then normal and none of the animations are working for the AWP when it used to for the other version.
  • Avatar of Clavus
  • [QUOTE=Cardcapture1;26473001] The viewmodel position looks entirely different. It looks a lot closer then normal and none of the animations are working for the AWP when it used to for the other version.[/QUOTE] Toy with the Weapon settings. I probably changed the default Viewmodel FOV. The animations are a different issue. GMod isn't happy that the viewmodel is changed and decides it doesn't want to animate it any more. Can't do much about that.
  • Avatar of Cardcapture1
  • [QUOTE=Clavus;26473316]Toy with the Weapon settings. I probably changed the default Viewmodel FOV. The animations are a different issue. GMod isn't happy that the viewmodel is changed and decides it doesn't want to animate it any more. Can't do much about that.[/QUOTE] For your next update can you change the 3rd person view position to the center of the weapon or possibly even the Sprite/Model your working on. It would be of more use.
  • Avatar of Ashmourne
  • Slight suggestion. How about next update you include a skeleton swep, like the "Swep Creator" that gives you a shared file, only include all of your code so people who don't know how to script can make there sweps work, by just putting in stuff like Damage and recoil and stuff... just a suggestion, will satisfy alot of people who don't take the time to learn lua. Though a problem with my suggestion there would be that people would create very simple creations that they think are cool, and suck. Still, it would help rack in downloads and pleasure nubs.
  • Avatar of ThePunchmaster
  • The only thing that would Perfect this is one thing...... Make a button, that you can click to make it a Fully working swep. But, then you need to copy the SWEP codes and everything to make it fire etc, into a Garrysmod addon folder. Then restart gmod, and BOOM! you got the sweps :D
  • Avatar of jonnspartan
  • Can't seem to understand your lua settings.... Ive got the stuff I want... But when it comes time to do the Lua part... I don't understand what to do exactly... Is it possible to post a tutorial on how to do the lua portion... I'm not a lua guy so this is rather difficult for me.
  • Avatar of Clavus
  • [QUOTE=Ashmourne;26478855]Slight suggestion. How about next update you include a skeleton swep, like the "Swep Creator" that gives you a shared file, only include all of your code so people who don't know how to script can make there sweps work, by just putting in stuff like Damage and recoil and stuff... just a suggestion, will satisfy alot of people who don't take the time to learn lua. Though a problem with my suggestion there would be that people would create very simple creations that they think are cool, and suck. Still, it would help rack in downloads and pleasure nubs.[/QUOTE] I could do this, but I don't think I want to. It really is piss easy to add my base code if you know even a tiny bit about how a SWEP script actually works. I'm trying to encourage SWEP creators to actually learn this stuff, instead of being stuck at changing recoil and damage values. [editline]4th December 2010[/editline] If you really can't get it to work, dump your SWEP code on [url=http://pastebin.com/]pastebin.com[/url] and give me a link. I'll tell you where it goes wrong. [editline]4th December 2010[/editline] Mr. Green community member NECROSSIN created this design: [img]http://forums.left4green.com/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=4478[/img] I'd love to see what you guys are making!
  • Avatar of Problematic.
  • @Clavus- I thing that Ashmourne is right. You should make SWEP Creator because not everyone have time to learn code but they want have some fun with yours tool. And if you advanced then you can just modify file of sweep :D And if you make it it will become popular like PAC2 (maybe ;p)
  • Avatar of Jamie932
  • I disagree with all of you who think that this should have a SWEP creator within. In my opinion, this should be used as a developer tool to make your weapons more unique, and to avoid the trouble of getting a modeller. If you don't know how to code - then either learn or leave this alone. I'm sure none of us would want a load more 5 second SWEPs coming onto GMod.org.
  • Avatar of Clavus
  • Added a gallery to OP. [img]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/gallery1.jpg[/img]
  • Avatar of Jamie932
  • I think I found a bug. In the current version on Toybox, when you save and load (tried this with a few sprites) - the second size box reverts to what the first box says. For example, [img]http://img228.imageshack.us/img228/9/ss20101204181115.png[/img] is what the size boxes first read. Then I saved and loaded it, and it reverted to [img]http://img228.imageshack.us/img228/2279/ss20101204181135.png[/img]