Jump to content

Recommended Posts

Because I love suffering and being sad, I'm adding one more feature to Winnie before she's fully released. She now can utilize her book of shadows in the form of various spells craftable from a unique tab in the toolbar. I figured out how to add a custom tab, and even added a custom recipe! But I'm struggling to link an item to the recipe. 

local carrotspell = AddRecipe("Carrots", {Ingredient("papyrus", 1), Ingredient("carrot", 2), Ingredient("nightmarefuel", 2)}, papyrustab, GLOBAL.TECH.NONE, nil, nil, nil, 5, "papyrustab", "images/inventoryimages/carrotspell.xml", "carrotspell.tex")

is in my modmain.lua, and I have carrotspell tex and xml in the appropriate folders as mentioned in the recipe line. 

STRINGS.NAMES.CARROTSPELL = "The Green Thumb Spell"
STRINGS.RECIPE_DESC.CARROTSPELL = "All it says is 'carrots.' Huh."

is also included in the modmain to lend a name and description to the recipe.

I have the carrotspell.lua file in my prefabs folder, though it's not really fleshed out since I don't know how to achieve the function of the spell just yet. Spawing Carrots can come later. Right now I just need to figure out how to make a basic custom item.

However, at the end of the prefab file, if I try to put 

return Prefab( "common/inventory/carrotspell", fn, Assets) 

like I'm supposed to, the game won't open correctly and then crashes. 

In addition to that, when you hover over the recipe for the carrotspell - for which the image shows up fine! - the image of the carrotspell and the name and desc is missing from the hovertab where you can hit 'build'.

If I gather the necessary materials and craft the carrotspell, Winnie will use the materials, busy about for a moment, and then say "I can't do that." 

I'm not sure exactly what I'm doing wrong here. I've been following another mod that uses custom items, to see where everything needs to be placed, but I must have gotten something mixed up along the way. 

I have the files available if anyone would need them to get a better idea of what I did. 

local carrotspell = AddRecipe("Carrots", {Ingredient("papyrus", 1), Ingredient("carrot", 2), Ingredient("nightmarefuel", 2)}, papyrustab, GLOBAL.TECH.NONE, nil, nil, nil, 5, "papyrustab", "images/inventoryimages/carrotspell.xml", "carrotspell.tex")

Maybe try change this in this :

local carrotspell = AddRecipe("carrotspell", {Ingredient("papyrus", 1), Ingredient("carrot", 2), Ingredient("nightmarefuel", 2)}, papyrustab, GLOBAL.TECH.NONE, nil, nil, nil, 5, "papyrustab", "images/inventoryimages/carrotspell.xml", "carrotspell.tex")

Because i don't see what "carrots" is, and as far as i understand, you need to put here the prefab name. So maybe after this the name and recipe desc will show.
Also, if you want better advices, attaching the mod is usually a good way to have some

Well this took care of the crafting tab - I'd thought that the slot was meant to serve as a name for the spell, was clearly mistaken. 

The appearance of the recipe is working fine now; however, it still refuses to be crafted, and when I try to complete the prefab file by adding the spell name to the last line, it crashes the game all together. 

 

Winifred the Witch TEST FILE.zip

On 1/25/2017 at 2:02 PM, Lumina said:

@FaerendipitousI wonder if you recipe doesn't miss a "nil", the exemple recipe i found have 5 nil, you should have one more nil after 5, i think. Not sure. I can't be sure there is no prob with the prefab too.

The 5 in the recipe should be nil instead.

local carrotspell = AddRecipe("carrotspell", {Ingredient("papyrus", 1), Ingredient("carrot", 2), Ingredient("nightmarefuel", 2)}, 
papyrustab, GLOBAL.TECH.NONE, 
nil, nil, nil, nil, "papyrustab", "images/inventoryimages/carrotspell.xml", "carrotspell.tex")

 

On 2/7/2017 at 7:01 PM, RedHairedHero said:

The 5 in the recipe should be nil instead.


local carrotspell = AddRecipe("carrotspell", {Ingredient("papyrus", 1), Ingredient("carrot", 2), Ingredient("nightmarefuel", 2)}, 
papyrustab, GLOBAL.TECH.NONE, 
nil, nil, nil, nil, "papyrustab", "images/inventoryimages/carrotspell.xml", "carrotspell.tex")

This has actually been sorted!! It was a problem with the syntax in the prefab file I think, but I managed to get carrotspell working re: crafting prior to the prefab file you'd sent me! (just without any effect!)

 

On 2/10/2017 at 11:48 AM, RedHairedHero said:

Glad to hear, let me know if you still need any help out. I've been busy between work and working on multiple character mods as well.

I bet!! I've been keeping busy myself, outside of Winnie's work. I just finished a DS tarot deck and started work on a character mod for a friend, which should prove a little easier than Winnie was (though the custom item might be difficult. I plan to draw from Lucy for a talking PDA item, but that's all in due time!)

First mod priority for me is Winnie - can't wait to see how she turns out!! And thank you again for all of your help, she'd be pretty much dead in the water otherwise!!

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