Jump to content

A few noob questions?


Jopo80

Recommended Posts

Hello, I just joined the forums and am learning how to mod PZ.

 

My first mod was to make a recipe for making sandbags out of sheets, here´s the code; 

 

 

recipe Make Empty Sandbag
{
Sheet=2,
Thread/Twine/FishingLine,
keep Needle,
Result:EmptySandbag,
Time:15,
}

 

You´re all free to use the code in your mods, if I need to give permissions that is.

 

Now for my questions;

 

I´m trying to make a recipe for making an improvised silencer for pistols for use with ORGM gun mod which me and my friends use and if the maker of the ORGM sees this, I´d like to ask for permissions to reference the mod in my future work (will be sending a PM for that purpose as well)

 

Here is the current code for the improvised pistol silencer;

 

 

item ImprovisedPistolSilencer
{
Type = WeaponPart,
DisplayName = Improvised Pistol Silencer,
Icon = ShotgunChoke,
Weight = 0.2,
WeightModifier = 0.2,
MountOn = Ber92; BrenTen; Colt38S; BrownHP; ColtDelta; FN57; Glock17; Glock21; Glock22; M1911; SIGP226; WaltherP22; Taurus38; DEagle; Mac10; Mac11; WaltherPPK; Uzi; Glock20; DEagleXIX; AutomagV; RugerSR9; XD40; KahrCT40; KahrP380; Ber93R; Ber93RSA; CZ75; Glock18; Glock18SA; Skorpion; Spr19119,
PartType = Canon,
Tooltip = An improvised silencer for pistols,
}

 

Currently I lack an icon for the silencer and there is no effect in the item yet as I tried getting the item to simply spawn after crafting without result.

 

Here are the recipes for this weapon mod;

 

 

recipe Make Improvised Silencer for Pistol Using Hot Glue
{
WaterBottleEmpty/PopBottleEmpty,
RippedSheets=2,
HCHotgluegunfull,
Result:ImprovisedPistolSilencer,
Time:15,
}

recipe Make Improvised Silencer for Pistol Using Glue
{
WaterBottleEmpty/PopBottleEmpty,
RippedSheets=2,
Glue,
Result:ImprovisedPistolSilencer,
Time:15,
}

 

So, as my friends suggested, I made a recipe for a rudimentary silencer using a plastic bottle filled with ripped sheets.

 

Now, the recipe appears in the game as a build/crafting option, but when I try crafting the item with either option, no new item spawns in my inventory as expected??? Is there an error in my code that I haven´t spotted?

 

Now, another question is, how do I make the silencer work as it´s supposed to, reducing sound of guns? Is there a SoundVolumeModifier option and a SoundRadiusModifier option or do those need to be created in lua?

 

Another thing I´d like to mod is an electricity free refrigeration system, in other words a basic earthen cellar, which would give some refrigeration ability and would be buildable/craftable with a spade, a hammer and some planks. So when the water and electricity fail, the survivors go back to living like they used to in the previous centuries.

 

Thank you in advance for your help.

 

Cheers!

Link to comment
Share on other sites

There is no soundmodifier thing for WeaponParts that I can find, I suppose you could do it through .lua though.

Also you need to import all modules from which you use items.

 

Ex

module SilencerMod{    imports    {    Base,    Hydrocraft    }}
Link to comment
Share on other sites

OK, I was able to make the crafting work, thx Svarog for pointing out the error, the imports were missing commas... :-D

 

However, now I need to make the weapon mod work as it´s supposed to, reducing weapon sound...

The idea my friends had for this improvised silencer was that it would not last very long, but alas, weapon mods don´t have a health/condition value as far as I know... In the future it might be prudent to make a recipe for a proper silencer, maybe using steel tube etc. and requiring high engineering skill to craft, etc.

 

Now as I´m not very familiar with lua coding, could someone more skilled post a suitable code snippet for me (and everyone else of course)?

 

If someone could make the SoundVolumeModifier and SoundRadiusModifier functions for me then that would be awesome.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...