- Site Map >
- Modding and Creation >
- Creator Feedback Forum >
- Sims 3 >
- Other - Plantsim Mod - Create plant out of thin air
- Site Map >
- Modding and Creation >
- Creator Feedback Forum >
- Sims 3 >
- Other - Plantsim Mod - Create plant out of thin air
Replies: 2 (Who?), Viewed: 740 times.
#1
9th Dec 2021 at 12:09 PM
Posts: 195
Thanks: 2017 in 7 Posts
Plantsim Mod - Create plant out of thin air
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 the object creation:
Code:
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. The interaction appears in game, but when using the interaction, 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?
Advertisement
#2
9th Dec 2021 at 2:03 PM
Posts: 437
Thanks: 5337 in 22 Posts
The format of the CreateObject method is a bit different from the "Create Object" debug interaction. What you're looking for is an object from EP1 with an instance name of "PlantLavender", but instead you're telling the game to create an object from the base game with an instance name of "PlantLavender,EP1,Sims3.Gameplay.Core.Null."
Try using the following overload of the CreateObject method instead:
Try using the following overload of the CreateObject method instead:
Code:
GameObject gameObject = GlobalFunctions.CreateObject("PlantLavender", ProductVersion.EP1, Destination, invalid.mLevel, Vector3.UnitZ, null, null) as GameObject;
"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt
If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
#3
9th Dec 2021 at 2:16 PM
Posts: 195
Thanks: 2017 in 7 Posts
Quote: Originally posted by gamefreak130
The format of the CreateObject method is a bit different from the "Create Object" debug interaction. What you're looking for is an object from EP1 with an instance name of "PlantLavender", but instead you're telling the game to create an object from the base game with an instance name of "PlantLavender,EP1,Sims3.Gameplay.Core.Null." Try using the following overload of the CreateObject method instead:
Code:
GameObject gameObject = GlobalFunctions.CreateObject("PlantLavender", ProductVersion.EP1, Destination, invalid.mLevel, Vector3.UnitZ, null, null) as GameObject; |
It worked!
Thank you so much gamefreak, I really appreciate it!
Who Posted
|