• SWEP Construction Kit - developer tool for modifying viewmodels / ironsights
    714 replies, posted
  • Avatar of Clavus
  • Ah right, noted. Bug in how the panels are build up. [editline]4th December 2010[/editline] Wait, according to the code this shouldn't happen... I'll take a closer look.
  • Avatar of Azaz3l
  • Tactic00l Deagle : [IMG_thumb]http://img59.imageshack.us/img59/4835/gmconstruct0050.jpg[/img_thumb] Should I upload this to toybox? BTW , Great Addon!
  • Avatar of floof
  • Do I put the base script before or after my script? Sorry if this is a stupid question but i'm new to lua :p. Im assuming before, but.... On a side note this is a very great tool. Your tool was actually the only reason I attempted to create a swep, thank you.
  • Avatar of Ashmourne
  • Like said earlier, you need to include a skeleton swep in next release with your code in it.
  • Avatar of Clavus
  • Since some of you seem to be so intent on not-learning-how-to-script, I've copied the Desert Eagle code from the default CSS weapons GMod provides and added my base code: [lua] REMOVED because it's outdated [/lua] But promise me this: don't submit any 5-second-SWEPs created with the above base to Toybox. Try to come up with some cool / unique functionality.
  • Avatar of floof
  • Ok so basically what do I need to add/change to make this script work? There is going to be a lot wrong with it, i'm new to lua, and was never good with those sort of things.... [url]http://pastebin.com/sqGLsFTa[/url] Sorry to bother you.
  • Avatar of Clavus
  • [QUOTE=floof;26494103]Ok so basically what do I need to add/change to make this script work? There is going to be a lot wrong with it, i'm new to lua, and was never good with those sort of things.... [url]http://pastebin.com/sqGLsFTa[/url] Sorry to bother you.[/QUOTE] First off, SWEP.ViewModel and SWEP.WorldModel are the paths to the original viewmodel and the worldmodel that GMod will use for your weapon. Just look at the base code I posted above to see where you place the SWEP.VElements and SWEP.WElements table. Secondly, you define SWEP:Initialize twice, which means the last one overrides your first one. Merge them: [lua] function SWEP:Initialize() util.PrecacheSound(self.Primary.Sound) util.PrecacheSound(self.Secondary.Sound) self:SetWeaponHoldType( self.HoldType ) self.Weapon:SetNetworkedBool( "Ironsights", false ) if CLIENT then self:CreateModels(self.VElements) // create viewmodels self:CreateModels(self.WElements) // create worldmodels end end [/lua]
  • Avatar of Dark Slayre
  • Works perfectly, the only problem is the recoil of the HL2 SMG model pushes the gun back and the models just stay there, they don't move with the gun itself.
  • Avatar of [NUKE] Snipe
  • Or SWEP Appearance Customizer :P haha jk, but on a serious note, this addon is pretty epic and I've yet to encounter any bugs with it. Oh btw, that crossbow LOOKS EPIC.
  • Avatar of Clavus
  • [QUOTE=Dark Slayre;26497174]Works perfectly, the only problem is the recoil of the HL2 SMG model pushes the gun back and the models just stay there, they don't move with the gun itself.[/QUOTE] They do if you select the right bone for the models you added.
  • Avatar of GoldGrunt
  • I can `t open Wmodels.There's nothing. [url]http://i065.radikal.ru/1012/6f/84c89886bf94.jpg[/url]
  • Avatar of Clavus
  • [QUOTE=GoldGrunt;26502118]I can `t open Wmodels.There's nothing[/QUOTE] You probably still have the first version. Re-download it (from toybox or garrysmod.org).
  • Avatar of floof
  • Ok late reply but So I merged the initiatives, and what not and thank you..... but it still dosen't seem to show up. [url]http://pastebin.com/bQXGzJmQ[/url] Sorry for the constant questions.
  • Avatar of KwiggALT
  • So, I save the config? Because when i open it, i see boxes, and notepad++ has wierd icons everywhere: with SOH and BEL in everywhere
  • Avatar of Ashmourne
  • Okay so i am using this to make a swep from fallout (Silenced N99 pistol) I already had the N99 pistol, so i used the USP to make it look silenced. Please tell me what i did wrong here [b][u]In swep Construction Kit[/u][/b] [img]http://img139.imageshack.us/img139/1725/gmflatgrass0010.jpg[/img] [b][u]In my Swep[/u][/b] [img]http://img651.imageshack.us/img651/2968/gmflatgrass00040.jpg[/img] The swep functions correctly, it makes the correct sound, fires at the right rate at the right damage, And the world model worked perfectly, but the view model did this. I tried restarting but had similar results. i even reinstalled the swep construction kit. Please tell me what i did wrong.
  • Avatar of sentrygunman
  • @Ashmourne You set in your code SWEP.ViewModelFlip or something like that. Find somewhere where it says ViewModelFlip and change it to false. Hope this helped!
  • Avatar of Dark Slayre
  • You need to flip the model and make sure your constructor and your swep have the same fov. For some reason your swep is using the hl2 pistol as it's v_model, so make sure you set it to the fallout one.
  • Avatar of Clavus
  • [QUOTE=floof;26505493]Ok late reply but So I merged the initiatives, and what not and thank you..... but it still dosen't seem to show up. [url]http://pastebin.com/bQXGzJmQ[/url] Sorry for the constant questions.[/QUOTE] You placed the tables directly in the CreateModels calls this time. Still not doing it right! Just take a closer look at the [url=http://www.facepunch.com/threads/1032378-SWEP-Construction-Kit-developer-tool-for-modifying-viewmodels-ironsights?p=26491166&viewfull=1#post26491166]base code[/url]. It's easy, you'll figure it out. [QUOTE=KwiggALT;26506157]So, I save the config? Because when i open it, i see boxes, and notepad++ has wierd icons everywhere: with SOH and BEL in everywhere[/QUOTE] The settings saving in the Weapons tab is purely for the tool, so you can re-adjust designs later. If you want to generate the code, copy it using the buttons in the Ironsights, VModels and WModels tab.
  • Avatar of OnyxAlchemyst
  • I'm looking for a bit of help. I'm just starting scripting, and my first "project" (if you can even call it that) is to change the 3rd person holdtype for Madcow's weapons from the default "pistol" type. Madcow's script has nothing designating a hold type as far as I can tell, so I went into the coding for some other weapons and came up with this: [code]if (SERVER) then AddCSLuaFile("shared.lua") SWEP.HoldType = "pistol"[/code] What I'd like to know is this: If I change the holdtype to what I want (ar2 for example), and I stick this phrase of code into madcow's, would it work? If not, what would you suggest I do? Major props to you Calvus for making such a cool addon. It looks like a very useful tool, and I'm sure it will come in handy if I continue down the scripter's road.
  • Avatar of Lord Ned
  • I just poked around with this a bit while taking a break from my project, and noticed a few things: It'd be nice if there was a "Open Spawnmenu" button on the VGUI. It's annoying to close the menu, open spawn menu, find my prop, copy the path, then re-click to open it. There's no way to copy materials from GMod, perhaps in the material thing have "..." which pops up the Material Browser, but the one you select gets written as the path? It'd be nice to see a Pos x/y/z drag for objects instead of just ironsights. Can you adjust the FOV while in ironsights? That's what I first adjusted before realizing I was adjusting the FOV of the entire weapon. Perhaps add the $nocull option when you make things transparent? (It improves the look of transparent things sometimes). Ability to copy the VModels over to the WModel (Even without positions or rotation) would be nice instead of having to re-pick them all and transfer them all. There's no way to preview animations in first person view, at least for the default pistol. I tried the buttons but they only worked on third person. There's no way to preview ironsights either, though I assume it's just a transition between the idle and the new ironsight position. Other then that it's awesome, pretty easy to make stuff in so that's good. [img]http://i55.tinypic.com/21ch2yb.png[/img] Wish I could make that windmill blade spin though. :v:
  • Avatar of Ashmourne
  • You know... There are Alot of world models that never get turned into sweps due to lack of view models... And for this all you need to do is get that world model in the right location, and then you have a viewmodel. That gives Alot of options.
  • hi im kind of a noob at this kind of stuff, but i dont understand something. How do i make it an actual swep? i have what i want in the swep editor and i saved it.. now what? how do i make it useable? And another question, can you change the weapon projectiles? (bullets for those who dont know)
  • Avatar of Clavus
  • [QUOTE=Lord Ned;26516817] Ability to copy the VModels over to the WModel (Even without positions or rotation) would be nice instead of having to re-pick them all and transfer them all.[/QUOTE] This feature is implemented? Just press the import viewmodels button. in the WModels tab. [QUOTE=Lord Ned;26516817] There's no way to preview animations in first person view, at least for the default pistol. I tried the buttons but they only worked on third person. [/QUOTE] I really wouldn't know how to fix this. I'm calling the right functions, but the animations just seem to break once you change the viewmodel.
  • Avatar of Azaz3l
  • You should add an option to hide bones in VM.This addon is great anyways.