Japer Posted February 21, 2014 Share Posted February 21, 2014 I need help with custom pistols, my ones currently work in game but they have unlimited ammo. What I need it to do is use the vanilla pistol ammo with my weapon. I have custom reloading/clips with my created weapons and ammo but I can't get it to use vanilla ammo. Here is my code, I have tried 9mmbullets,pistol magazine and baretta clip in all different variations and can't seem to get it to work.Any help would be great, thanks local pistolstars = {name = getItemText("S.T.A.R.S. Pistol"),moduleName = 'ResidentEvilWeapons',reloadClass = 'ISSemiAutoWeapon',ammoType = 'Bullets9mm',clipName = '9mm Magazine',clipIcon = 'BerettaClip',shootSound = '',clickSound = '',ejectSound = '',insertSound = '',rackSound = '',containsClip = 1,maxCapacity = 17,reloadTime = 15,rackTime = 10,clipData = Bullets9mm};ReloadUtil:addMagazineType(pistolstars) Link to comment Share on other sites More sharing options...
rorschach Posted February 21, 2014 Share Posted February 21, 2014 What is this file's name and location in your mod folder structure?Since I also suffered from the 'infinite ammo' glitch, what I did to get mine to work was to rename the reloading .lua so it is 'alphabetically lower', that is, later in the alphabet than the other files it references. So call it something like this: "Z_MyPistolReloading.lua".That way, it loads after all the other reloading lua files have done so, and that way your code gets inserted into the main game. Something else I noticed, is this code for a pistol or its magazine? You've named it "STARS Pistol" and then reloadClass = 'ISSemiAutoWeapon',but at the bottom it says"ReloadUtil:addMagazineType(pistolstars)"So which is it? A pistol or its magazine? You'll also need to add the sound effects into your code, but I guess you already knew that... Link to comment Share on other sites More sharing options...
Japer Posted February 21, 2014 Author Share Posted February 21, 2014 In the lua folder it's called Reload (Which is least alphabetically) and within the same code 2 weapons reloading work.It is a weapon, trying to use the vanilla pistol ammo,The line "ReloadUtil:addMagazineType(pistolstars)" is probably just an error from the last phase of testing I done and it is set under Mods\Resident Evil Weapons\media\lua\ResidentEvilWeapons_ReloadIt's just specifically the lines; ammoType = 'Bullets9mm',clipName = '9mm Magazine',clipIcon = 'BerettaClip',clipData = Bullets9mm};That I can't get to access the vanilla pistol ammo, as you can see there are 3 different names for the clip/ammo. I tried putting in the code for a pistol mag in case it needed it to reference from but even that didn't work Link to comment Share on other sites More sharing options...
rorschach Posted February 21, 2014 Share Posted February 21, 2014 I'm a bit lost.The item in your first post is called 'S.T.A.R.S. Pistol', so it's a pistol, right?So, presumably there is a line in that file that says,ReloadUtil:addWeaponType(pistolstars)Because if there isn't, then PZ is going to think it's a magazine and add it to the MagazineType list. Link to comment Share on other sites More sharing options...
Japer Posted February 21, 2014 Author Share Posted February 21, 2014 Yes, it's a pistol, and that line is there at the bottomI just can't however make it use the vanilla pistol ammo, as im not sure how it's named for ammo type, clip name and clip data.The game just crashes when you try to reload that gun because it cannot find the ammo type/clip specified Link to comment Share on other sites More sharing options...
Japer Posted February 21, 2014 Author Share Posted February 21, 2014 I figured it out, the correct code to make a weapon use the vanilla pistol ammo is as follows; ammoType = 'BerettaClip',clipName = 'Beretta Clip',clipIcon = 'BerettaClip',clipData = BerettaClip}; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now