Jump to content
Sign in to follow this  
Moleon

How i can start?

Recommended Posts

Howdy!

 

I really want to make some mods, like a manga books, anime cds and more freak items.

 

I dont know how i can start... where i can learn how the code works?

What is the name of the programming lenguage?

 

i really want to know the first step that i have to do.

 

In the future i really want to contribute to the hydrocraft! :D

 

Thank you very much!

Share this post


Link to post
Share on other sites

Well if you want to make items you don't need to code. Items are in the scripts ZomboidInstallDirectory\media\scripts and that's a bunch of txt files that define various variables like what icon it's going to have, what are the effects on use, is it food etc. You'll need a .lua file that will add the to the loot distribution though.

Making those is really easy. Go to %HOMEPATH%\zomboid\mods and create a new folder there. A generic list of what stuff goes where is in spoiler

 

Spoiler

 


|   mod.info
|   poster.png
|   
\---media
    +---lua
    |   +---client
    |   |   \---ISUI
    |   |           ModUI.lua
    |   |           
    |   +---server
    |   |   |   ModRecipeFunctions.lua
    |   |   |   
    |   |   \---Items
    |   |           ModItemDistribution.lua
    |   |           
    |   \---shared
    |       \---Translate
    |           \---PL
    |                   Items_PL.txt
    |                   
    +---scripts
    |       ModItems.txt
    |       ModRecipes.txt
    |       
    +---sound
    |       ModSound.wav
    |       
    \---textures
            Item_IconName01.png
            Item_IconName02.png
            Item_IconName03.png

 

 

 

 


mod.info File in necessary for the game to recognize that there is in fact a mod to be read. It's a .txt file with .info extension, can create and edit with notepad

What it needs is this.
 

Spoiler

 


name=Mod Template
poster=poster.png
id=MODID000
description=Descritpion goes here.

 

 

 

 


The rest of that tree show a generic folder structure within the mod folder itself along with what types of files should be dropped where.

Now, creating an item is easy, the file that contains the item scripts in above tree is ModItems.txt (It can be named anything else) you can look at any mod or the game files themselves for examples.

There is a link in my signature to a thread with all my mods, feel free to download some and experiment by changing it. It's a good way to learn I think. On the bottom of that post is also a link to another thread where I listed all Item variables that I knew off.

Also, feel free to PM me if you need any help.

Edited by Svarog

Share this post


Link to post
Share on other sites

Thank you so much Svarog!!!

 

I'm gonna try this weekend to do something and i'll tell you my progress.

 

I really want to contribute with something to the community, because i really love this game!

:)

 

Share this post


Link to post
Share on other sites

Hi again Svarog!

 

I have been seeing your littering mod, and now i try this:

 

In "ProjectZomboid\mods\Mymod\media\scripts"

Cervezas.txt ->

Spoiler

 


module Cervezas
{
    imports
    {
        Base

    }
	item FullBeer
	{
	HungerChange	        =	-5,
	Weight	        	=	0.8,
	Type	        	=	Food,
	ThirstChange		=	-20,
	DisplayName		=	Beer,
	Alcoholic		=	TRUE,
        UnhappyChange		=	-10,
	ReplaceOnUse		=	BeerEmpy,
	Icon	        	=	Beer,
	CustomContextMenu 	= 	Drink,
	CustomEatSound    	= 	PZ_DrinkingFromBottle,
	AlcoholPower      	= 	1,
	}

	item EmpyBeer
	{
	HungerChange	        =	-5,
	Weight	        	=	0.8,
	Type	        	=	Food,
	ThirstChange		=	-20,
	DisplayName		=	Beer Empy,
	Alcoholic		=	TRUE,
        UnhappyChange		=	-10,
	ReplaceOnUse		=	FullBeer,
	Icon	        	=	Beer,
	CustomContextMenu 	= 	Drink,
	CustomEatSound    	= 	PZ_DrinkingFromBottle,
	AlcoholPower      	= 	1,
	}
}

 

"ProjectZomboid\mods\Mymod\media\lua\server\items"

MymodDistribution.txt

Spoiler

 


require 'Items/SuburbsDistributions'
------------------------ CustomEdibles ------------------------
------------------------ FullBeer ------------------------
table.insert(SuburbsDistributions["kitchen"]["counter"].items, "Cervezas.FullBeer");
table.insert(SuburbsDistributions["kitchen"]["counter"].items, 2);
table.insert(SuburbsDistributions["all"]["fridge"].items, "Cervezas.FullBeer");
table.insert(SuburbsDistributions["all"]["fridge"].items, 3);
table.insert(SuburbsDistributions["bar"]["counter"].items, "Cervezas.FullBeer");
table.insert(SuburbsDistributions["bar"]["counter"].items, 5);

 

 

 

"ProjectZomboid\mods\Mymod\media\lua\client"

EdiblesNecroForgePlugIn.txt ->

Spoiler

Events.OnGameStart.Add( function ()
	print ("Adding Edibles Items to NecroForge");
	if NecroList then
		if NecroList.Items.FullBeer then	
		else
			NecroList.Items.FullBeer = {"Food", nil, nil, "Beer", "Cervezas.FullBeer", "Item_Beer", nil, nil, nil};
		end		
	end
end)

 

And the mod file:

Spoiler

name=Mymod
poster=poster.png
id=Mymod
description=A mod for Freak stufffsssss!!!
url= The url resides in your hearth!

 

Can you tell me waht i do wrong?

 

Thank you very much! :D

Edited by Moleon

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...