mod error

Place to get help with not working mods / modding interface.
Post Reply
User avatar
ZombieMooose
Filter Inserter
Filter Inserter
Posts: 289
Joined: Mon Feb 09, 2015 7:23 am
Contact:

mod error

Post by ZombieMooose »

I keep getting the error:
Error while loading item prototype "raw-fish" (capsule): Prototype "raw-fish" registered twice
I'm trying to change the raw-fish into an item so I can smelt it into a cooked fish.
"men will literally learn everything about ancient Rome instead of going to therapy"

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: mod error

Post by DaveMcW »

It's already an item, you can't define it again.

If you are trying to copy it and make a cooked-fish item, be sure to change the name.

User avatar
ZombieMooose
Filter Inserter
Filter Inserter
Posts: 289
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: mod error

Post by ZombieMooose »

Well then how do I change it to where when you "catch" a fish it gives you the item I'm creating?
"men will literally learn everything about ancient Rome instead of going to therapy"

Koub
Global Moderator
Global Moderator
Posts: 7203
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: mod error

Post by Koub »

you destroy the catched fish, and you spawn your own kind ?
(btw I know nothing to modding ^^)
Koub - Please consider English is not my native language.

User avatar
ZombieMooose
Filter Inserter
Filter Inserter
Posts: 289
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: mod error

Post by ZombieMooose »

Koub wrote:you destroy the catched fish, and you spawn your own kind ?
(btw I know nothing to modding ^^)
yeah kinda

I want to change raw-fish into an item that can be smelted (cooked) into cooked-fish to eat
"men will literally learn everything about ancient Rome instead of going to therapy"

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: mod error

Post by Arch666Angel »

just setup another recipe which turn the raw fish into cooked fish?

User avatar
ZombieMooose
Filter Inserter
Filter Inserter
Posts: 289
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: mod error

Post by ZombieMooose »

Arch666Angel wrote:just setup another recipe which turn the raw fish into cooked fish?
the problem is how do I catch the new raw-fish I made?
"men will literally learn everything about ancient Rome instead of going to therapy"

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: mod error

Post by Arch666Angel »

What is it you want to achieve?
1. Do you just want to cook the fish you can already catch into something?
-This can be done by setting up a recipe and an item for the cooked fish

2.Or do you want to add a second kind of fish which can be cooked?
-This is a bit more complex because I'm pretty sure you have to tweak something to have you new fish to spawn alongside the other.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: mod error

Post by daniel34 »

The fish you catch will still be the same fish as in vanilla, raw-fish.
(Note that the entity on the ground is called "fish", but the item you get when mined is "raw-fish")
You then add an extra item called cooked-fish and a recipe to convert the raw-fish in a furnace:

Code: Select all

data:extend(
{
  {
    type = "recipe",
    name = "cooked-fish",
    category = "smelting",
    enabled = true,
    energy_required = 10,
    ingredients = {{"raw-fish", 1}},
    result = "cooked-fish"
  }
}
)
To change the amount of health the cooked-fish gives you, make it into a capsule that gives you negative damage, the same as raw-fish does:

Code: Select all

  {
    type = "capsule",
    name = "cooked-fish",
    icon = "__base__/graphics/icons/fish.png",
    flags = {"goes-to-quickbar"},
    subgroup = "raw-resource",
    capsule_action =
    {
      type = "use-on-self",
      attack_parameters =
      {
        type = "projectile",
        ammo_category = "capsule",
        cooldown = 30,
        range = 0,
        ammo_type =
        {
          category = "capsule",
          target_type = "position",
          action =
          {
            type = "direct",
            action_delivery =
            {
              type = "instant",
              target_effects =
              {
                type = "damage",
                damage = {type = "physical", amount = -40}
              }
            }
          }
        }
      }
    },
    order = "f-e-a",
    stack_size = 100
  },
quick links: log file | graphical issues | wiki

User avatar
ZombieMooose
Filter Inserter
Filter Inserter
Posts: 289
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: mod error

Post by ZombieMooose »

well I don't know what happened, but it seems to work now

so there's that

I'm gonna check compatibility with my other mods to see why it didn't work in the first place

thanks everyone for their help!
"men will literally learn everything about ancient Rome instead of going to therapy"

Post Reply

Return to “Modding help”