Jump to content

Modding public service announcement #1: Underscores


NovaSilisko

Recommended Posts

DO NOT under ANY CIRCUMSTANCES put underscores in your part names. It will make your vehicle unable to be re-loaded after it was saved.

Wrong:

// --- general parameters ---
name = 2m_fuel_tank
module = FuelTank
author = NovaSilisko

Right:

// --- general parameters ---
name = 2mfueltank
module = FuelTank
author = NovaSilisko

Be smart! Keep underscores out!

Link to comment
Share on other sites

Happy now?

Much better. k:)

Because I put it there, yet people are STILL making this mistake k:(

Ya, I know, following our little troubleshooting of your SRB. I went to add it afterwards and saw that your pirate monkey astronaut ninja'd me. Again.

Link to comment
Share on other sites

thanks for posting this.. when skunkmonkey mentioned it to me the other day i spend 30 minutes going through all the mods trying to find ones using underscores.. and there are a TON of them that use it. maybe this thread will finally help stop it.

Link to comment
Share on other sites

The fact is a lot of folks (like me) jump in without reading the docs. This thread is thus useful :)

It also helps to know why underscores are bad: The game uses them in save files, like partname1_partname2_partname3 -- so if your part has underscores in it it'll break part_name_with_underscores into 'part' 'name' 'with' 'underscores' and throw a fit when none of those parts exist.

Dots seem to be okay.

Link to comment
Share on other sites

The fact is a lot of folks (like me) jump in without reading the docs. This thread is thus useful :)

It also helps to know why underscores are bad: The game uses them in save files, like partname1_partname2_partname3 -- so if your part has underscores in it it'll break part_name_with_underscores into 'part' 'name' 'with' 'underscores' and throw a fit when none of those parts exist.

Dots seem to be okay.

That's not quite what's happening.

You are correct that the problem arises in the saving of craft files, but it's because it appends the instance number of the part to the name after an underscore. So if you have two 'sasmodule' parts in your craft, they each get saved as 'sasmodule_1' and 'sasmodule_2'. The game assumes everything after the first underscore is the instance number. This is why a simple appending of 'sasmodule_mycustompart' reverts to the original part when reloaded because the game reads it as simply 'sasmodule'.

Arrr!

Capt'n Skunky

Link to comment
Share on other sites

  • 1 month later...

This issue has been corrected. You can use underscores, but don't use a number as the last character after the underscore. It will still attempt to use it as the instance number.

Arrr!

Capt'n Skunky

Is that for 0.10? Because they still cause problems in 0.9.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

×
×
  • Create New...