Plantsim Mod - Create plant out of thin air

Talk nerdy to us here.
Post Reply
User avatar
xantak22
Reactions:
Posts: 16
Joined: December 7th, 2020, 12:59 pm

Plantsim Mod - Create plant out of thin air

Post by xantak22 » December 8th, 2021, 1:55 pm

Hello!
I am currently making a mod where if you're playing as a plantsim, you can click on the ground and create a "build-mode-plant".
Here are the code lines for that

Code: Select all

LotLocation invalid = LotLocation.Invalid;

GameObject gameObject = GlobalFunctions.CreateObject("PlantLavender,EP1,Sims3.Gameplay.Core.Null", Destination, invalid.mLevel, Vector3.UnitZ) as GameObject;

World.GetLotLocation(Destination, ref invalid);

However, I am having some troubles. When using the interaction in game, a white box is created at the location, saying "Missing object resource instance PlantLavender,EP1,Sims3.Gameplay.Core.Null"
Image

However...
I have Nraas DebugEnabler installed and when I click on the ground and choose Nraas > Debug, and select "Create Object" and use the same line as in my code (PlantLavender,EP1,Sims3.Gameplay.Core.Null), the plant is created without any issues.

Does anyone have any idea why the plant won't be created with my mod when it can be created with DebugEnabler?