Jump to content

What am i missing?


bakos133

Recommended Posts

(Before i start i would like to mention that my mod is based off of another similar mod by a man named Lemures.
Link: http://pz-mods.net/gameplay/CraftableSandbags/
Which allows you to craft sandbags from sheets and pillows in game using some thread/twine, a needle, and either a pillow or a sheet.

Full credit goes to him for the idea!)

----------------------------------------------------------------

Hello everyone!

My name is Nandor! :) I have been unsuccessfully testing out some recipe combinations here and there in Project Zomboid in the hopes to learn a bit of the modding scene. Unfortunately i cannot get my custom recipes to work in game!

For instance i have the recipe set up in a text file, but i have not been able to find a proper up-to-date tutorial on what else i need to do to get them to work, so i feel i've hit a snag!

I have my folders organized as such:

(F) = Folder
(.extension) = Type of file

My Mod(F)
|
|---->mod.info
|---->media(F)
|     |
|     |---->lua(F)
|     |    |

|     |    |---->sandbagin.lua

|     |
|     |---->scripts(F)
|     |    |
|     |    |---->recipes.txt
|     |

|

 

recipes.txt:

module Base{	recipe SandbagE Sheet	{		Sheet,		Thread,		keep Needle,		null,			Result:EmptySandbag,		Time:180.0,		OnCreate:recipe_sandBagE,	}		recipe SandbagE Pillow	{		Pillow,		Thread,		keep Needle,		null,				Result:EmptySandbag,		Time:60.0,		OnCreate:recipe_sandBagE,	}}

sandbagin.lua
 

function recipe_sandBagE(items, result, player)	local inv = player:getInventory();	inv:AddItem("Base.EmptySandBag");end

------------------------------------------------------------

 

Now my question is very basic. I have gotten the mod to show up, to activate, but NOT to run properly in-game.
Am i missing something very obvious that i am not seeing? Or did i even miss a post here and there that might fix/explain my issue better?

Any help would be appreciated :)

 

Ps. If you want to just give me grief for not doing the proper searches first, I do want to mention that the reason i have gotten this far is because i have been following tutorials of which only told me how to spawn items upon button presses and make basic recipes. I might have missed some though, so once again any help is much appreciated. ^_^

Link to comment
Share on other sites

(Before i start i would like to mention that my mod is based off of another similar mod by a man named Lemures.

Link: http://pz-mods.net/gameplay/CraftableSandbags/

Which allows you to craft sandbags from sheets and pillows in game using some thread/twine, a needle, and either a pillow or a sheet.

Full credit goes to him for the idea!)

----------------------------------------------------------------

Hello everyone!

My name is Nandor! :) I have been unsuccessfully testing out some recipe combinations here and there in Project Zomboid in the hopes to learn a bit of the modding scene. Unfortunately i cannot get my custom recipes to work in game!

For instance i have the recipe set up in a text file, but i have not been able to find a proper up-to-date tutorial on what else i need to do to get them to work, so i feel i've hit a snag!

I have my folders organized as such:

(F) = Folder

(.extension) = Type of file

My Mod(F)

|

|---->mod.info

|---->media(F)

|     |

|     |---->lua(F)

|     |    |

|     |    |---->sandbagin.lua

|     |

|     |---->scripts(F)

|     |    |

|     |    |---->recipes.txt

|     |

|

 

recipes.txt:

module Base{	recipe SandbagE Sheet	{		Sheet,		Thread,		keep Needle,		null,			Result:EmptySandbag,		Time:180.0,		OnCreate:recipe_sandBagE,	}		recipe SandbagE Pillow	{		Pillow,		Thread,		keep Needle,		null,				Result:EmptySandbag,		Time:60.0,		OnCreate:recipe_sandBagE,	}}

sandbagin.lua

 

function recipe_sandBagE(items, result, player)	local inv = player:getInventory();	inv:AddItem("Base.EmptySandBag");end

------------------------------------------------------------

 

Now my question is very basic. I have gotten the mod to show up, to activate, but NOT to run properly in-game.

Am i missing something very obvious that i am not seeing? Or did i even miss a post here and there that might fix/explain my issue better?

Any help would be appreciated :)

 

Ps. If you want to just give me grief for not doing the proper searches first, I do want to mention that the reason i have gotten this far is because i have been following tutorials of which only told me how to spawn items upon button presses and make basic recipes. I might have missed some though, so once again any help is much appreciated. ^_^

 

If you are trying to fill up a sandbag you are doing it the reverse... you are giving the player an empty sandbag and running an empty sandbag script...

 

I guess I am confused on what you are trying to accomplish... can you clarify?

Link to comment
Share on other sites

Oh sorry!

I am trying to make a recipe to make a sandbag out of either a pillow or a sheet.

 

So using a sheet/pillow, twine/thread, and a needle; it would be possible to make an empty sandbag. The only problem is, i am not sure how to go about using the recipe in-game.

 

Not trying to empty or fill really, just create.

 

Anything i'm missing there?

 

Ps. Thank you for responding.


Quote:

 

(Before i start i would like to mention that my mod is based off of another similar mod by a man named Lemures.
Link: http://pz-mods.net/gameplay/CraftableSandbags/
Which allows you to craft sandbags from sheets and pillows in game using some thread/twine, a needle, and either a pillow or a sheet.

Full credit goes to him for the idea!)

----------------------------------------------------------------

Hello everyone!

My name is Nandor! :) I have been unsuccessfully testing out some recipe combinations here and there in Project Zomboid in the hopes to learn a bit of the modding scene. Unfortunately i cannot get my custom recipes to work in game!

For instance i have the recipe set up in a text file, but i have not been able to find a proper up-to-date tutorial on what else i need to do to get them to work, so i feel i've hit a snag!

I have my folders organized as such:

(F) = Folder
(.extension) = Type of file

My Mod(F)
|
|---->mod.info
|---->media(F)
|     |
|     |---->lua(F)
|     |    |

|     |    |---->sandbagin.lua

|     |
|     |---->scripts(F)
|     |    |
|     |    |---->recipes.txt
|     |

|

 

recipes.txt:

module Base{	recipe SandbagE Sheet	{		Sheet,		Thread,		keep Needle,		null,			Result:EmptySandbag,		Time:180.0,		OnCreate:recipe_sandBagE,	}		recipe SandbagE Pillow	{		Pillow,		Thread,		keep Needle,		null,				Result:EmptySandbag,		Time:60.0,		OnCreate:recipe_sandBagE,	}}

sandbagin.lua
 

function recipe_sandBagE(items, result, player)	local inv = player:getInventory();	inv:AddItem("Base.EmptySandBag");end

------------------------------------------------------------

 

Now my question is very basic. I have gotten the mod to show up, to activate, but NOT to run properly in-game.
Am i missing something very obvious that i am not seeing? Or did i even miss a post here and there that might fix/explain my issue better?

Any help would be appreciated :)

 

Ps. If you want to just give me grief for not doing the proper searches first, I do want to mention that the reason i have gotten this far is because i have been following tutorials of which only told me how to spawn items upon button presses and make basic recipes. I might have missed some though, so once again any help is much appreciated. ^_^

 

If you are trying to fill up a sandbag you are doing it the reverse... you are giving the player an empty sandbag and running an empty sandbag script...

 

I guess I am confused on what you are trying to accomplish... can you clarify?

 

Link to comment
Share on other sites

 

Oh sorry!

I am trying to make a recipe to make a sandbag out of either a pillow or a sheet.

 

So using a sheet/pillow, twine/thread, and a needle; it would be possible to make an empty sandbag. The only problem is, i am not sure how to go about using the recipe in-game.

 

Not trying to empty or fill really, just create.

 

Anything i'm missing there?

 

Ps. Thank you for responding.

Quote:

 

(Before i start i would like to mention that my mod is based off of another similar mod by a man named Lemures.

Link: http://pz-mods.net/gameplay/CraftableSandbags/

Which allows you to craft sandbags from sheets and pillows in game using some thread/twine, a needle, and either a pillow or a sheet.

Full credit goes to him for the idea!)

----------------------------------------------------------------

Hello everyone!

My name is Nandor! :) I have been unsuccessfully testing out some recipe combinations here and there in Project Zomboid in the hopes to learn a bit of the modding scene. Unfortunately i cannot get my custom recipes to work in game!

For instance i have the recipe set up in a text file, but i have not been able to find a proper up-to-date tutorial on what else i need to do to get them to work, so i feel i've hit a snag!

I have my folders organized as such:

(F) = Folder

(.extension) = Type of file

My Mod(F)

|

|---->mod.info

|---->media(F)

|     |

|     |---->lua(F)

|     |    |

|     |    |---->sandbagin.lua

|     |

|     |---->scripts(F)

|     |    |

|     |    |---->recipes.txt

|     |

|

 

recipes.txt:

module Base{	recipe SandbagE Sheet	{		Sheet,		Thread,		keep Needle,		null,			Result:EmptySandbag,		Time:180.0,		OnCreate:recipe_sandBagE,	}		recipe SandbagE Pillow	{		Pillow,		Thread,		keep Needle,		null,				Result:EmptySandbag,		Time:60.0,		OnCreate:recipe_sandBagE,	}}

sandbagin.lua

 

function recipe_sandBagE(items, result, player)	local inv = player:getInventory();	inv:AddItem("Base.EmptySandBag");end

------------------------------------------------------------

 

Now my question is very basic. I have gotten the mod to show up, to activate, but NOT to run properly in-game.

Am i missing something very obvious that i am not seeing? Or did i even miss a post here and there that might fix/explain my issue better?

Any help would be appreciated :)

 

Ps. If you want to just give me grief for not doing the proper searches first, I do want to mention that the reason i have gotten this far is because i have been following tutorials of which only told me how to spawn items upon button presses and make basic recipes. I might have missed some though, so once again any help is much appreciated. ^_^

 

If you are trying to fill up a sandbag you are doing it the reverse... you are giving the player an empty sandbag and running an empty sandbag script...

 

I guess I am confused on what you are trying to accomplish... can you clarify?

 

 

 

Okay so,

 

First, change your module name

 

"Base" is meant to designate the base game. instead rename it to Improvisedsandbag or something.

 

Second you need to do an import to use base game items in a recipe.

 

it is formatted as follows:

 

module improvisedsandbag (or whatever you want to call it)

{

imports

{

Base

}

 

That way you can pull in the base items. If you use other mod items you need to import those as well.

 

Anyway give that a go and if it still doesn't work we can do a bit more tweaking.

 

Anyway I like the idea of you mod, sandbags are entirely too hard to come by!

Link to comment
Share on other sites

Thank you for helping by the way! I will try that right now and get back to you!
I don't mean to be a bother if i am at all.

While i try this, would other mods by any chance cause any conflicts?

Also I agree about the sandbags, and when i saw Lemures working on the sandbag mod, i was like WOW thats genius! I think i want to update what he was doing! But so far no luck :(

Anyhow, i shall be right back and i'll let you know the verdict.

Thanks again.

Ps. Hows my folder organization by the way?
Do i need to add any folders like "Client", "Server", and/or "Shared"?

 

Pps. Also, is it:
Imports or Import?
And do i need a comma at the end of the Base?

Link to comment
Share on other sites

Thank you for helping by the way! I will try that right now and get back to you!

I don't mean to be a bother if i am at all.

While i try this, would other mods by any chance cause any conflicts?

Also I agree about the sandbags, and when i saw Lemures working on the sandbag mod, i was like WOW thats genius! I think i want to update what he was doing! But so far no luck :(

Anyhow, i shall be right back and i'll let you know the verdict.

Thanks again.

 

No conflicts that I know of.

 

Don't worry you aren't being a bother, I'm glad to help.

 

Also I found you a helpful little tutorial, though I am not sure how complete it is, but it should help.

 

http://pz-mods.net/guide/the-basics-of-adding-items-and-recipes/

Link to comment
Share on other sites

Unfortunately it didn't work :(

Do i need the any specific order? :o And/Or do i maybe need a "Client", "Server", and/or "Shared" folder for this to work?

I read somewhere on the forums that the next update requires that stuff.

 

You should be fine with the distribution. you actually do not need that .lua you have there.

 

In your recipe formats you do not need the null, or the Oncreate Script run. the recipe will generate the item without it.

 

Here is how the .txt should look.

 

module improvsandbag

{

    imports

    {

             Base, farming, camping, Hunting,

    }

    recipe Make Sandbag from Sheet

    {

        Sheet,

        Thread,

        keep Needle,   

        Result:EmptySandbag,

        Time:180.0,

    }

    

    recipe Make Sandbag from Pillow

    {

        Pillow,

        Thread,

        keep Needle,

        Result:EmptySandbag,

        Time:60.0,

    }

}

 

Because you are using standard items and a standard function (recipe) you don't need the LUA.

 

I imported all those functions just to be safe because I am not sure which one will be helpful (and it doesn't hurt)

 

Also make sure the module at the top of the .txt matches those for your mod file.

Link to comment
Share on other sites

So hey! It seems like its working now!
Thank you so much! This would make things SOO much easier! Phew!

I don't suppose you would be willing to help run me through a brief(or however long one of these takes) tutorial on adding interactivity to custom items would you?
Maybe something like being able to get a custom UI to pop up?

If not that is perfectly fine! I am not looking for anyone to do my work for me ^_^
I am a game designer myself but i work with unity3D and Unreal, so working with lua is kind of familiar to me. I've been self-taught since i can even remember and i'm always interested in learning new things!

But as i said, if not, no hard feelings!
I thank you for helping me resolve the issue i had at hand! :)
Be safe on your travels and i wish you all the best!

Link to comment
Share on other sites

So hey! It seems like its working now!

Thank you so much! This would make things SOO much easier! Phew!

I don't suppose you would be willing to help run me through a brief(or however long one of these takes) tutorial on adding interactivity to custom items would you?

Maybe something like being able to get a custom UI to pop up?

If not that is perfectly fine! I am not looking for anyone to do my work for me ^_^

I am a game designer myself but i work with unity3D and Unreal, so working with lua is kind of familiar to me. I've been self-taught since i can even remember and i'm always interested in learning new things!

But as i said, if not, no hard feelings!

I thank you for helping me resolve the issue i had at hand! :)

Be safe on your travels and i wish you all the best!

 

I am really happy that worked out for you! Don't forget to post that mod when you are done I know some people might want to download that (including myself)

 

As for, ui, that would require the use of .LUAs and possibly drawing ui elements. I am not as familiar with coding for ui but if you elaborate on what you would like to accomplish maybe we can figure this out together. (I should probably learn to code ui at some point anyway)

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...