• SWEP Construction Kit - developer tool for modifying viewmodels / ironsights
    714 replies, posted
  • [img]http://i.imgur.com/ILfaTuA.jpg[/img] [B]What this is:[/B] The SWEP Construction Kit is a developer utility to create weapon designs without having to find completely new weapon models. The tool allows you to position models on both the viewmodel and the worldmodel of a SWEP. Additionally, you can finetune ironsights. Created designs can easily be used by pasting the created code in your SWEP script (which contains the base code further down this post). [B]WHAT THIS ISN'T:[/B] A lot of people have been nagging about adding functionality such as "how fast it shoots", "what sound it makes when shooting". [B]THIS IS NOT THE PURPOSE OF THIS TOOL[/B]. If you want to add actual weapon functionality you will need to learn how to code a SWEP (since this tool is only used to make WEAPON DESIGNS. The code provided is only used to easily add these designs to your own scripted weapons). I recommend beginners to look at SWEP code made by experienced scripters, and to read the tutorials on the [url=http://wiki.garrysmod.com/?title=Lua_Tutorial_Series]GMod wiki[/url]. [b]SCK user guide (more up-to-date than the rest of this post):[/b] [url]http://steamcommunity.com/sharedfiles/filedetails/?id=153130501[/url] [b]How to use:[/b] First grab it from the workshop: [url]http://steamcommunity.com/sharedfiles/filedetails/?id=109724869[/url] (or download the [url=https://dl.dropbox.com/u/11217331/releases/swep_construction_kit.zip]legacy addon version[/url]) The source code is on [url=https://github.com/Clavus/SWEP_Construction_Kit/]GitHub[/url]. Submit pull requests if you want to help improve it. [B]Tutorial steps in this Steam user guide:[/B] [url]http://steamcommunity.com/sharedfiles/filedetails/?id=153130501[/url] [B]Base code:[/B] The base code can be found in the base_code.lua file provided with the SWEP. If you have the workshop version, just press the "Copy base code" button in the tool's main menu while ingame and paste the code in your editor of preference. [B]Known issues:[/B] * Viewmodel animations are buggy. Especially after changing the viewmodel. [B]Credits:[/B] Devenger - original ironsight designer _Kilburn - Melonium revolver [b]FAQ:[/b] [quote][b]I can't get the Lua code to work[/b] 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. Please only contact me if you have at least some basic experience with Lua scripting, and made a SWEP or two before. [b]It won't shoot[/b] Read the post. Especially the part that says "WHAT THIS ISN'T". [/quote] [b]Changelog:[/b] v.Workshop: [quote]Too much shit to mention. Just go try it out.[/quote] v1.7: [quote]- Added viewmodel bone translating and rotating under the Weapon tab. Be sure to get the new base code. In order for your old model scaling to work, load your design in the new SCK and re-save / copy weapon code again - Fixed printing weapons text to console (got chopped off when it was too long)[/quote] v1.6: [quote]- Added button in the Weapons tab to drop your current weapon design. This way you can use it with ragdoll poses and such. Hold reload button to pick it back up.[/quote] v1.5: [quote]- Added the 'Relative' field for every element. Allows you to parent an element to another element instead of a bone. Simplifies editing of complex designs and allows for animating movement around different positions instead of only bone positions - Brought back the animation buttons. Still buggy (switching to 3rd person mode and back seems to fix the 1st person animations after opening the menu for the first time) - Added several tooltips[/quote] v1.4: [quote]- Added option to change parent bone for world models. You can use this to make weapon specific outfits and stuff (like a back mounted canister for a flamethrower) - Added button to open this thread directly from the SCK menu[/quote] v1.3.1: [quote]- Added a copy button for elements - Fixed a bug with the model browser where it created multiple tree nodes for subfolders[/quote] v1.3:[quote]- Fixed duplicate viewmodel bone listing - Added link to this thread to tool - Added quads[/quote] v1.2: [quote]- Fixed bug with loading model sizes - Fixed table references after importing viewmodels to worldmodels - 3rd person view now rotates around the player's right hand - Position drag limits set from 20 to 30 (although you can always just type in any number) - Added model browser to every model field - Added material browser to every material / sprite field - Added Tool tab, changed Weapon tab. Tool tab is for triggering animations (which are sadly still broken / buggy) and saving/loading designs, Weapon tab is for weapon settings and generating code of these settings - Added view model bone resizing to Weapon tab - Added view model / world model hiding to Weapon tab - Added setting skins and bodygroups to VModels and WModels[/quote] v1.1: [quote]- Added worldmodel positioning! - Added design saving and loading - Fixed sprites being drawn behind models - Changing numberwang textfields now directly updates the value [/quote] v1.0: Release [B]Gallery:[/B] (just post pictures of your designs and I'll add it!) [quote] [img]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/gallery1.jpg[/img] [img]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/gallery2.jpg[/img] [img]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/gallery3.jpg[/img] [t]http://forums.left4green.com/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=4481[/t][t]http://forums.left4green.com/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=4478[/t][t]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/dinotophat.jpg[/t][t]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/oldtut.jpg[/t] [img]http://i51.tinypic.com/33pezja.gif[/img][img]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/blade.gif[/img][t]http://cloud.steampowered.com/ugc/560916639802599192/D0A05054C998811E6BB141DB1003EE1BC22811F9/[/t][/QUOTE] [QUOTE=huntingrifle;31693982]I was able to do this recently because of the bone-editing [IMG]http://i812.photobucket.com/albums/zz43/Etgar/Pip%20Boy%20Inventory/Pip1.jpg[/IMG] [IMG]http://i812.photobucket.com/albums/zz43/Etgar/Pip%20Boy%20Inventory/Pip2.jpg[/IMG] pretty fun to do[/QUOTE] Let me know if there are any issues or if you want to suggest functionality! Also post your designs, I love to see what you guys come up with!
  • Wow! I've dreamed about this day for 4 years, since I got GMod. Thank you Clavus!
  • [QUOTE=Ywa;26387694]Wow! I've dreamed about this day for 4 years, since I got GMod. Thank you Clavus![/QUOTE] I knew linking this on our IRC channel was a bad idea.
  • This is genius when you think about it. A lot of the interesting SWEPs used a similar method of making their view models as it gives you a bit more flexibility compared to using someone else's model. I still expect an influx of shit though.
  • Glad you released it,i was bored lately at making sweps,this tool just gave me inspiration to work on them again,thank you.
  • When i "put in a prop" in the weapon, it just shows up as an error, why?
  • [QUOTE=Llamalord;26393513]You should allow animations for dynamic props[/QUOTE] Scripters can do this themselves in their weapons by calling SWEP.VElements[<element name>].modelEnt:SetSequence. [QUOTE=Simzen;26401291]When i "put in a prop" in the weapon, it just shows up as an error, why?[/QUOTE] Make sure the model path is correct. Should look like "models/.../.. .mdl". Just copy-paste paths from the spawn menu. Also make sure the model is actually on your disk.
  • Another example design [img]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/example.jpg[/img] [editline]30th November 2010[/editline] Lazy automerge. [editline]30th November 2010[/editline] Updated the tool on toybox and my dropbox. Contains a fix for the console printing of viewmodel tables.
  • Jvs suggested a method for worldmodel positioning in the toybox comments. I just made a proof of concept, and it works out. I'll add worldmodel positioning soon :)
  • [QUOTE=Clavus;26411233]Jvs suggested a method for worldmodel positioning in the toybox comments. I just made a proof of concept, and it works out. I'll add worldmodel positioning soon :)[/QUOTE] Good progress! Are you making it so that if you have just designed the view model, you can just press a button or something to convert it to the world model using the current attached models and positions? That would save a lot of time. Also, I made a quick something earlier in the spirit of Christmas (The bad graphics is due to me installing new graphics drivers and not being able to restart my PC without a save feature): [img]http://i55.tinypic.com/qqd3dj.png[/img]
  • [QUOTE=Clavus;26411233]Jvs suggested a method for worldmodel positioning in the toybox comments. I just made a proof of concept, and it works out. I'll add worldmodel positioning soon :)[/QUOTE] [img]http://static.facepunch.com/fp/ratings/heart.png[/img] [QUOTE=Jamie932;26412269]Good progress! Are you making it so that if you have just designed the view model, you can just press a button or something to convert it to the world model using the current attached models and positions? That would save a lot of time.[/QUOTE] Sadly,that is not going to be so easy to make,worldmodels and viewmodels uses different bonenames and such,you'd need to adjust the wordmodel according to the viewmodel,_Kilburn stated that too when talking about his multimodels module (that's about the same thing this tool does). [QUOTE=_Kilburn;26176369]It requires some repositioning, so that the worldmodel and the viewmodel look identical.[/QUOTE]
  • Yeah, worldmodels and viewmodels have different bones, but I'll make a button in the WModels tab to import the current viewmodels so you'll only have to reposition those elements. I'll also have to sync the worldmodels properly when the weapon is dropped (when it's being held, the models are relative to the player's right hand bone instead of the weapon itself).
  • GENTLEMEN, BEHOLD!.... Unusual Weapons!!! :suicide: Also, anyone knows where i can find the TF2 Unusual effects?
  • I'm a complete fucktard and wanted to make a certain weapon I have look neat so I toyed around with this and it's really easy to use, the hardest part is getting the lue part I don't know much of LUA and I figured how to add stuff to weapons :v: Though for now, I was thinking for those of us who aren't so great at LUA add a save/load feature for positioning and a transplant feature.
  • [QUOTE=lol user;26415138]GENTLEMEN, BEHOLD!.... Unusual Weapons!!! :suicide: Also, anyone knows where i can find the TF2 Unusual effects?[/QUOTE] They effects are Particle effects. I think they are also in a encrypted/ locked pcf that you need to run TF2 to view. The materials that make them up should be accessible, but I don't know where from.
  • You can too use them. How I look them up is with the particle effect tester SWEP on the toybox. Only has TF2, EP2 and Portal effects on it though.
  • [img]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/derp1.jpg[/img] [img]http://dl.dropbox.com/u/11217331/Screens/gmod/swep_construction_kit/derp2.jpg[/img] Expect the update in a few days, after I added some additional functionality (view model transfer and save/load settings).
  • oh gawd, this HAS to be combined with that SWEPmaker addon\tool\programm. Then my pneumatic grenade launcher with revolver magazine will come true >;3
  • 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