What have I done wrong? [Help]

Started by Horizon, July 25, 2014, 06:26:47 PM

Previous topic - Next topic

Horizon

The basis of the idea I have for this mod is to create a retextured hydroponics table that grows only a custom resource, which in turn is then usable to build structures. (Those come later.)

Currently what I have done is to the best of my abilities, following the wiki and studying the core mods folder.

Included is my attempt at the above, complete with a test block to be used.
I have looked at the dev menu but I don't understand it. Anyone kind enough
please have a look and help me troubleshoot?

https://www.mediafire.com/?3pivmij8kblx19b

Lancer447

To have a new custom resource, I'm pretty sure you need a custom .dll file, since I've tried many times to create a custom resource of my own. If I'm wrong, then somebody should correct me.
Outdated mods: Lancer's Mods Bundle.
Shamless advertising mods and stories... Penana.

ItchyFlea

#2
A couple of def's are missing the thingdef parent's. You've left that part out for both your plant and your building. There's also a few old def names being used. While these aren't too much of an issue, you should fix them. The game will tell you what they are when you activate your mod in-game. (If it doesn't, hit the tilde key (~))

Also, most of the texture paths you've got are wrong. Be especially careful with the texture path for the plantdef. For some reason the game absolutely shits itself if that's wrong. (Definitely a bug which has been reported.)
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Horizon

Quote from: ItchyFlea on July 26, 2014, 06:52:36 PM
A couple of def's are missing the thingdef parent's. You've left that part out for both your plant and your building. There's also a few old def names being used. While these aren't too much of an issue, you should fix them. The game will tell you what they are when you activate your mod in-game. (If it doesn't, hit the tilde key (~))

Also, most of the texture paths you've got are wrong. Be especially careful with the texture path for the plantdef. For some reason the game absolutely shits itself if that's wrong. (Definitely a bug which has been reported.)

Any hints on where to start? The debug menu doesn't help much.

Horizon

Quote from: Horizon on July 27, 2014, 03:41:49 AM
Quote from: ItchyFlea on July 26, 2014, 06:52:36 PM
A couple of def's are missing the thingdef parent's. You've left that part out for both your plant and your building. There's also a few old def names being used. While these aren't too much of an issue, you should fix them. The game will tell you what they are when you activate your mod in-game. (If it doesn't, hit the tilde key (~))

Also, most of the texture paths you've got are wrong. Be especially careful with the texture path for the plantdef. For some reason the game absolutely shits itself if that's wrong. (Definitely a bug which has been reported.)

Any hints on where to start? The debug menu doesn't help much.

So far the errors that I can't fix try as I might are the lighting levels for growth and the image path files.
Updated: https://www.mediafire.com/?3pivmij8kblx19b

ItchyFlea

#5
I have attached a fixed up version to this post. Well, it doesn't give any errors when activating anyway. It seems to work in-game.
Compare it to what you've got to see what I've changed to fix the problems. :)

The in-game debug menu isn't really going to help much when fixing issues with mods. Although it does help for fine-tuning. You'll want the output_log for locating issues. It's not very specific, but most of the time it gives you a hint as to where to look.

[attachment deleted by admin: too old]
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Horizon

Changelog for future reference and for anyone possibly facing future issues.

Horizon Mod A.1 Revised [Fixed by Itchy]
------------------------------------------

Plantdef was reverted back to the Core standard.
Plant was properly tagged as such in XML name. (Possibly for better reference?)
Texture paths ignored addition of texture file in the path. (Game read it as Textures/Textures/....)
Plant added to Defname. (Confused the game about the resource and the plant.)
Raw added to resource. (Confused the game about the resource and the plant.)
Lifespan reverted back to 200000. (Unknown reason for change.)
Traderscarry true was added to resource def. (For compatability with game?)
Sound paths added to define sound. (Weird I didn't notice that before.)
Food paths added to define food. (Weird I didn't notice that before.)

Total changes: Many
Change Severity: Major

Questions to fixer: Can nutrition be set to a negative value?

ItchyFlea

I'll write my answers in red in the quote below:

Quote from: Horizon on July 27, 2014, 07:48:38 AM
Changelog for future reference and for anyone possibly facing future issues.

Horizon Mod A.1 Revised [Fixed by Itchy]
------------------------------------------

Plantdef was reverted back to the Core standard.
Plant was properly tagged as such in XML name. (Possibly for better reference?) I find doing so helps me to remember what is what.
Texture paths ignored addition of texture file in the path. (Game read it as Textures/Textures/....)
Plant added to Defname. (Confused the game about the resource and the plant.) Not exactly. Just did that as a personal preference.
Raw added to resource. (Confused the game about the resource and the plant.) Again, mostly for personal preference. In this case though both the plant and the resource initially had the same name. This would have caused issues.
Lifespan reverted back to 200000. (Unknown reason for change.) The lifespan you had initially was far too high, and was causing problems. Specifically this: Exception parsing <lifeSpan>20000000000000</lifeSpan> to type System.Int32: Exception parsing System.Int32 from "20000000000000"
Traderscarry true was added to resource def. (For compatability with game?) You initially had <purchasable>true</purchasable>. That tag no longer exists in this version of RimWorld, and was replaced with <tradersCarry>. A few other tags were also replaced with their A5 equivalent. IE: <MenuUIIcon> changed to <uiIconPath>.
Sound paths added to define sound. (Weird I didn't notice that before.)
Food paths added to define food. (Weird I didn't notice that before.)

Total changes: Many
Change Severity: Major

Questions to fixer: Can nutrition be set to a negative value? I don't know, I've never tried it. I set it to a positive value while trying to find the cause of a bug that was occurring.

While there probably wouldn't have been too much of a noticeable effect if the small xml errors had been left in the mod, it's best to not have any errors at all. Makes it easier to find the cause of a problem that way. :) The game doesn't pop up the dev console if these errors exist. To find out if they do, when you've activated your mod in-game (or have started the game with it already active) hit the tilde key (~) and see if there is anything written in yellow. If there is, it'll tell you what it's found and usually why it thinks it's a problem.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Horizon

Quote from: ItchyFlea on July 27, 2014, 08:40:30 AM
I'll write my answers in red in the quote below:

Quote from: Horizon on July 27, 2014, 07:48:38 AM
Changelog for future reference and for anyone possibly facing future issues.

Horizon Mod A.1 Revised [Fixed by Itchy]
------------------------------------------

Plantdef was reverted back to the Core standard.
Plant was properly tagged as such in XML name. (Possibly for better reference?) I find doing so helps me to remember what is what.
Texture paths ignored addition of texture file in the path. (Game read it as Textures/Textures/....)
Plant added to Defname. (Confused the game about the resource and the plant.) Not exactly. Just did that as a personal preference.
Raw added to resource. (Confused the game about the resource and the plant.) Again, mostly for personal preference. In this case though both the plant and the resource initially had the same name. This would have caused issues.
Lifespan reverted back to 200000. (Unknown reason for change.) The lifespan you had initially was far too high, and was causing problems. Specifically this: Exception parsing <lifeSpan>20000000000000</lifeSpan> to type System.Int32: Exception parsing System.Int32 from "20000000000000"
Traderscarry true was added to resource def. (For compatability with game?) You initially had <purchasable>true</purchasable>. That tag no longer exists in this version of RimWorld, and was replaced with <tradersCarry>. A few other tags were also replaced with their A5 equivalent. IE: <MenuUIIcon> changed to <uiIconPath>.
Sound paths added to define sound. (Weird I didn't notice that before.)
Food paths added to define food. (Weird I didn't notice that before.)

Total changes: Many
Change Severity: Major

Questions to fixer: Can nutrition be set to a negative value? I don't know, I've never tried it. I set it to a positive value while trying to find the cause of a bug that was occurring.

While there probably wouldn't have been too much of a noticeable effect if the small xml errors had been left in the mod, it's best to not have any errors at all. Makes it easier to find the cause of a problem that way. :) The game doesn't pop up the dev console if these errors exist. To find out if they do, when you've activated your mod in-game (or have started the game with it already active) hit the tilde key (~) and see if there is anything written in yellow. If there is, it'll tell you what it's found and usually why it thinks it's a problem.

Thanks for all the help! I used quite a bit of code referenced from other mods to edit to my usage, perhaps causing the outdated code.
Thanks again!

Horizon

#9
As a side note, is resizing the geothermal generator into a 1x1 the wrong way of going about things if I plan to make an indoor small generator?
Also, is there a reason that I can't use food as a resource cost?

ItchyFlea

Quote from: Horizon on July 27, 2014, 09:20:43 AM
As a side note, is resizing the geothermal generator into a 1x1 the wrong way of going about things if I plan to make an indoor small generator?
Also, is there a reason that I can't use food as a resource cost?
I've never made a generator, so I don't know. Try it and see what happens. :)
Don't know about the food one. The game might currently not accept food as a building material.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Horizon

Quote from: ItchyFlea on July 27, 2014, 08:54:34 PM
Quote from: Horizon on July 27, 2014, 09:20:43 AM
As a side note, is resizing the geothermal generator into a 1x1 the wrong way of going about things if I plan to make an indoor small generator?
Also, is there a reason that I can't use food as a resource cost?
I've never made a generator, so I don't know. Try it and see what happens. :)
Don't know about the food one. The game might currently not accept food as a building material.

The generator failed quite badly, but the food one works now.
I'll try to get a file from the generator out soon.