View Full Version : [SOLVED] Object modding: Missing constant(?)
Kaiserschmarrn
7th Jul 2012, 11:14 PM
I went throug the object modding tutorial (http://www.modthesims.info/wiki.php?title=Tutorial:Sims_3_Object_Modding) some days ago. Now at some point appears following line of code:
base.Actor.ShowTNSIfSelectable("Hello!", StyledNotification.NotificationStyle.kSimTalking);
My problem is the constant (or property?) kSimTalking. It seems to be missing in my case. I have setup the project like described and if I start auto complete some options like kMessage appear, but not this one.
Anyone had a similar problem? Thanks in advance.
MDM
8th Jul 2012, 12:00 AM
Did you add using Sims3.UI; at the top? kSimTalking is inside Sims3.UI.
If you already have it, what kind of error are you getting from VS?
Digitalchaos
8th Jul 2012, 10:38 AM
You may have used an import (VB.NET) or using (C#.NET) statement that conflicts with StyledNotification.NotificationStyle or IntelliSense/autocomplete is not properly setup.
Try replacing 'StyledNotification.NotificationStyle.kSimTalking' with 'Sims3.UI.StyledNotification.NotificationStyle.kSimTalking'
For Reference (Defined in Sims3.UI.StyledNotification):
public enum NotificationStyle : uint
{
kCelebrityUpdate = 7,
kCustom = 6,
kDebugAlert = 5,
kGameMessageNegative = 4,
kGameMessagePositive = 3,
kSimTalking = 1,
kSystemMessage = 2
}
Kaiserschmarrn
8th Jul 2012, 11:38 AM
Did you add using Sims3.UI;
Yes.
Try replacing 'StyledNotification.NotificationStyle.kSimTalking' with 'Sims3.UI.StyledNotification.NotificationStyle.kSimTalking'
I tried this, but it gives me the same error. Both options will output ".... doesn't contain the definition for 'kSimTalking''.
MDM
8th Jul 2012, 12:13 PM
Did you also try to copy & paste the exact final code of the tutorial to see if that one produces the same error?
If it doesn't, we know there is something wrong in your code, but if it does we can focus on something else.
Cherry92
8th Jul 2012, 1:23 PM
did you remember to include UI.dll in reference?
Kaiserschmarrn
8th Jul 2012, 3:06 PM
did you remember to include UI.dll in reference?
Yes.
Did you also try to copy & paste the exact final code of the tutorial to see if that one produces the same error?
Yes, I tried that already. It produces the same error.
Ok, now that we know it's not the code, let's try this.
First, make sure everything is setup as described in here ---> Setup Project (http://www.modthesims.info/wiki.php?title=Sims_3:Creating_a_game_compatible_Visual_Studio_project)
After you're 500% or better 505% sure that everything is setup correctly, see if the error appears again.
If it still appears, try using this UI.dll I'm attaching, make a backup of the one you're using and place mine instead. You might have to close and reopen the project before trying again.
P.S. If you're on a different patch level don't worry, we're just testing if it's your UI.dll corrupted or something. If it works, do not use it for a mod of course, unless you're on the same patch level.
Kaiserschmarrn
8th Jul 2012, 3:22 PM
Wow thanks a lot! Using your UI.dll fixed everything. But what does this mean? Do I have to patch my game or something?
Wow thanks a lot! Using your UI.dll fixed everything. But what does this mean? Do I have to patch my game or something?
That means your UI.dll is somehow corrupted or maybe a really early patch level where the resource you're looking for has a different name or is placed somewhere else.
What's your patch level atm?
Also, try reextracting it from gameplay.package,the first time maybe came out corrupted.
Kaiserschmarrn
8th Jul 2012, 4:52 PM
1.0.631 is my patch level (never change a running system). I think I am at the right point to finally update my game.
1.0.631 is my patch level (never change a running system). I think I am at the right point to finally update my game.
Definitely, especially if you're planning on making mods :)
Let us know how it goes after patching.
Digitalchaos
9th Jul 2012, 7:18 AM
I tried this, but it gives me the same error. Both options will output ".... doesn't contain the definition for 'kSimTalking''.
What program are you using to compile the project? (I should have asked earlier)
Because it does not sound like you are using Visual Studio (or the C# compiler CSC).
What program are you using to compile the project? (I should have asked earlier)
Because it does not sound like you are using Visual Studio (or the C# compiler CSC).
Hrm....the problem has been solved, he was on a base game and UI.dll did not have that reference or it was somewhere else :)
Kaiserschmarrn
19th Jul 2012, 8:27 PM
What program are you using to compile the project?
I am using Visual Studio 2008. And like others already said; the problem is not the compiler or project setup.
-------------------
Sorry for the late reply: I was busy with some stuff. I patched my game to the newest version and extracted all DLLs again. Then I went through the object modding tutorial, compiled my project and tested the mod ingame. Everything works fine!
Thanks for the quick replies. I really appreciate that.
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.