Planetbase

Planetbase

Planetbase Workshop
Here you can download translations or challenges for Planetbase. Just subscribe to the desired item and it will appear in the game.
Learn More
Screech 26 Mar, 2019 @ 1:22pm
Adding a new building, but getting an error
So I'm very close to adding a new building type with my mod. Essentially, I'm copying the cabin type and making some tweaks so that I can understand how the different objects work together. My issue is that when I try to build the object, I'm getting a Null Reference Exception when I attempt to populate the mModels array in my new building using the cabin object's mModels.

As an experiment, I used the array for the moduleObjects and it "worked." So I know it's an issue with not obtaining a value. So my question is: what do I set this value with, and how do I use a pre-existing value as a stand-in until I create my own?

NOTE: I have other buildings I want to add along with technologies such as fission power, electrolytic converters for making O2 from water (the H2 would be used as fuel for a fusion plant), casino, suite, O2 storage, etc...

I've looked at the wiki and I'm not seeing anything helpful.
< >
Showing 1-15 of 19 comments
Screech 26 Mar, 2019 @ 1:24pm 
Error is : Could not load game object Prefab/Modules/PrefabSuite1 I am adding the new item in the Init() method.
That's awesome that you're adding more content to this game! It could really use it. I hope the devs chime in.

Someone should make a mod to lessen the pesky intruder rate...in the late game, it's 8 or 9 at a time, and it seems to be almost every other colonist ship
crumpetninja 28 Mar, 2019 @ 2:10am 
Yes! A mod to lower the intruder rate is definitely needed - the amount of times i have to go back on a save to attempt to up my guard and arms levels is redick
Screech 29 Mar, 2019 @ 5:50pm 
Originally posted by PDiddysDaddy:
That's awesome that you're adding more content to this game! It could really use it. I hope the devs chime in.

Someone should make a mod to lessen the pesky intruder rate...in the late game, it's 8 or 9 at a time, and it seems to be almost every other colonist ship
Well, one step at a time. Adding buildings, then modules for inside the buildings. I really want to make a casino (probably use the ultra large bio dome as the template and add some slot machines and such) and maybe pool (billiards) tables, ping pong tables, etc. I'll need help with the animations and textures, though.
Screech 31 Mar, 2019 @ 12:02pm 
Ok. I got the building added. I just need to figure out how to add additional items inside the building. Then I'll have a functioning mod that adds a new building type, "Suite," where you can have up to 4 people with beds, tv's, drinking fountain, table, plant, food dispenser. Essentially a hotel suite. It gives a little extra prestige.
Comric 3 Apr, 2019 @ 9:49am 
I always thought that the Pyramid was little valued as a building of prestige, so empty seems useless, it would be appropriate if work it as a sort of museum or informative center, this would make more sense.
If you can solve the problem of the insertion of the internal item, could you try it has modify that building. In theory it should be easier to edit because is an existing model.
Last edited by Comric; 3 Apr, 2019 @ 9:50am
diggidee 11 May, 2019 @ 2:53pm 
Ah the old NullReferenceException. My personal favourite! If the object is a string have you tried setting it to string.Empty?
Last edited by diggidee; 11 May, 2019 @ 2:54pm
Screech 12 May, 2019 @ 10:06am 
Originally posted by diggidee:
Ah the old NullReferenceException. My personal favourite! If the object is a string have you tried setting it to string.Empty?

Yes. I work in C# professionally, so that's the first thing I did. Seems to me that I'm populating the objects in the wrong order when I instantiate it. There's very little documentation out there so I was hoping someone would read my posts and be able to point me in the right direction.
NeoRider7 4 (Banned) 16 Feb, 2020 @ 4:31am 
Did anyone manage to add a new building to the game?

@Screech how did your attempts end?
Thank you for trying to create such an interesting mod for the game Planetbase!
NeoRider7 4 (Banned) 16 Feb, 2020 @ 1:32pm 
Information from this forum thread has been added to the guide:
Guide "What would you like to improve in the game?"
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1999352524
Screech 4 Mar, 2020 @ 3:10pm 
Originally posted by NeoRider7:
Did anyone manage to add a new building to the game?

@Screech how did your attempts end?
Thank you for trying to create such an interesting mod for the game Planetbase!

Never got it to work. I haven't given up, though. I am too close to do that. I think that after gaining some additional experience in Unity I might do better.
NeoRider7 4 (Banned) 4 Mar, 2020 @ 7:44pm 
Originally posted by Screech:
Never got it to work. I haven't given up, though. I am too close to do that. I think that after gaining some additional experience in Unity I might do better.
We are all looking forward! :-) If this happens, then this will be a new stage in the development of the game!
When your mod is ready and new buildings are available, I will be able to make new challenges and post works in the Steam workshop.
NeoRider7 4 (Banned) 5 Mar, 2020 @ 2:01am 
Originally posted by Screech:
after gaining some additional experience in Unity I might do better.

By the way, I highly recommend posting a question about Unity and a link to this forum thread on this site: https://www.reddit.com/r/Planetbase/
This community of players is alive. There are many people from different countries. Including there are many people who purchased the game not through Steam.

It will also be great if you will conduct your work in GitHub.
Example: Planetbase-Framework https://github.com/solidDoWant/Planetbase-Framework/wiki/Creating-mods
Then other programmers will be able to add their pieces of code and help you.
Together it will be faster to solve this problem and make the game better ;-)
Panahasi 1 Feb, 2021 @ 11:41am 
I love that someone is trying to add content to this game. There is so much potential. It must be impossible by design because even today there are no new buildings or items.

I also wish the devs would unlock the magic keys, I bet the userbase would expand like crazy building much more hype for future games. Has anyone tried Dawn of Man?
Screech 1 Mar, 2022 @ 2:34pm 
Update: So thanks to the reddit community posted by @NeoRider7 I now know how to add new components to buildings. I don't know if it's the Framework updates or something else, but it's much easier now. There's so many more steps than I thought there would be. I still need to get a new building to work, but I can add my slot machine to the bar building.

Now...How do I get new assets created and imported into the mod?
< >
Showing 1-15 of 19 comments
Per page: 1530 50