- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Tutorials >
- Modding - General - Tutorial: Sims 3 Object Modding
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Tutorials >
- Modding - General - Tutorial: Sims 3 Object Modding
#26
5th Jun 2011 at 10:14 AM
Ah, sorry about that. The assemblies I compile against have all the access modifiers changed to public. There was no reason to assume this particular interaction would be private. I'll see about changing that.
Just use it with the public modifier. There's really no reason to make an interaction so restricted (private) that "outsider" code doesn't know of its existence (during compile time, i.e. when you write your code).
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Just use it with the public modifier. There's really no reason to make an interaction so restricted (private) that "outsider" code doesn't know of its existence (during compile time, i.e. when you write your code).
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Advertisement
Test Subject
#27
5th Jun 2011 at 2:20 PM
Posts: 8
Cool, thanks! I complied it both as private and public and it worked either way; just wanted to know if that was a general rule.
Another general question that might not belong here... Intellisense doesn't work for me in this test project. Is that normal when dealing with these Sims reference libraries?
Another general question that might not belong here... Intellisense doesn't work for me in this test project. Is that normal when dealing with these Sims reference libraries?
#28
5th Jun 2011 at 2:49 PM
Quote: Originally posted by 3MTA3
Another general question that might not belong here... Intellisense doesn't work for me in this test project. Is that normal when dealing with these Sims reference libraries? |
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Test Subject
#29
10th Jun 2011 at 7:09 PM
Posts: 39
The tutorial refers to object modding but I wanted to add interactions to a specific type of objects in a given world and it didn't work...
For example ( Add a new interaction to all plants on a lot ).
Would startup work for this or OnWorldLoadFinishedHandler?
Also would I use a foreach function get all the objects of the type then add an interaction?
Good tutorial but I'm wondering if it would apply to a case like that because it hasn't worked for me.
For example ( Add a new interaction to all plants on a lot ).
Would startup work for this or OnWorldLoadFinishedHandler?
Also would I use a foreach function get all the objects of the type then add an interaction?
Good tutorial but I'm wondering if it would apply to a case like that because it hasn't worked for me.
#30
10th Jun 2011 at 7:16 PM
You need a pure scripting mod for that. I'll answer to your thread in Modding Discussion soonishly.
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Test Subject
#31
14th Jul 2011 at 2:17 AM
Posts: 28
Downloaded content in S3OC?
I recently purchased the Gothic Library with SimPoints on EA's website and I want to try to create an object mod to rig the Book of Spells with more interactions. I'm following the tutorial, but I got stuck at the part where you have to clone the object because I can't find the Book of Spells (or any of the other downloaded content) in the list of items. How can I access these items in s3oc? All help is appreciated; thanks in advance.
#32
14th Jul 2011 at 9:47 AM
I'm not at my workstation right now, but IIRC you need to load the object's package directly to clone a custom object (custom as in not part of the fullbuild/deltabuild packages).
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Test Subject
#33
15th Jul 2011 at 2:22 AM
Last edited by Simaholic123 : 15th Jul 2011 at 2:31 AM.
Reason: new info
Posts: 28
Quote: Originally posted by Buzzler
I'm not at my workstation right now, but IIRC you need to load the object's package directly to clone a custom object (custom as in not part of the fullbuild/deltabuild packages). |
Do you know where I would find the package? I see that in the Sims 3 folder in My Documents there is a downloads folder that contains the set as a TS3 custom content file, but I can't find where the individual packages for the objects are located. I tried looking in the Sims 3 folder in the program files too but I haven't found anything with a recognizable name.
Edit: Googling led me to this info:
Quote:
my documents>electronic arts>the sims 3>DCCache It's a strange and clunky system that makes one big file, so it's impossible to get rid of things one by one. Also, when you do delete them from your game, you don't get the disk space for it back. When I learned this, I stopped downloading anything that requires the launcher, because it's just not right to do stuff that way. |
So, if this is true, I'm not sure how I can open it directly. Does anyone know how to get around this? Is there a way to resave the item in a different way or something?
#34
15th Jul 2011 at 2:38 AM
Test Subject
#35
15th Jul 2011 at 6:34 PM
Last edited by Simaholic123 : 16th Jul 2011 at 12:03 AM.
Reason: new problem
Posts: 28
Another question... sorry :/
Thanks so much, whiterider for that; I think that part worked fine.New problem though, one of the steps in the tutorial says to find the objects original class and in the example it uses "Sims3.Gameplay.Objects.Miscellaneous.StuffedAnimal." For me this was "Sims3.Store.Objects.SpellBook" though and it wouldn't let me follow any of the next steps in the tutorial. I don't know how to fix this, though I know for a fact that it's possible to mod this item because I found someone on another site who made one to allow children to use it. Anyway, I'm guessing this problem has to do with the fact that one of the references I added was "Sims3GameplayObjects," but there wasn't one for the store items so I can't reference them properly... is there something I can do to fix this? Thanks in advance
#36
16th Jul 2011 at 7:52 AM
If you want to use that particular item in your code, you need to extract the dll (from the S3SA) from the package (the one you extracted from the sims3pack) and add it to the references in your Visual Studio project. Load it to your assembly browser if you want to see its code.
BTW: That other mod you've seen is probably just a simplistic XML mod.
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
BTW: That other mod you've seen is probably just a simplistic XML mod.
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Test Subject
#37
17th Jul 2011 at 3:35 AM
Posts: 28
Thanks!
Ah, got it to work now! Thanks so much for all your help, I really appreciate it
#38
23rd Aug 2011 at 12:59 AM
Last edited by lorenrose1013 : 23rd Aug 2011 at 1:12 AM.
Posts: 474
Thanks: 205 in 1 Posts
I just started script modding and got stuck on the first step. When it says to find the objects original class, there is no original class. The string is greyed out and empty. (I cloned a lollipop and am trying to add the 'Eat' interaction)
#39
23rd Aug 2011 at 6:44 AM
@lorenrose1013: The object you cloned is a prop, like the pencil for homework or knife/spoon for cooking. Props are instantiated for animations and are destroyed immediately afterwards. Therefore they have no functionality on their own and need no script class.
Now to start an object from scratch, derive it from the abstract GameObject class. Be aware, though, that what you're planning is not really a beginner's project. I dare say it's not even intermediate. An Eat interaction is a non-immediate interaction and needs a whole lot more than what's needed for the basic interaction from the tutorial.
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Now to start an object from scratch, derive it from the abstract GameObject class. Be aware, though, that what you're planning is not really a beginner's project. I dare say it's not even intermediate. An Eat interaction is a non-immediate interaction and needs a whole lot more than what's needed for the basic interaction from the tutorial.
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
#40
23rd Aug 2011 at 7:31 AM
Posts: 474
Thanks: 205 in 1 Posts
Quote: Originally posted by Buzzler
@lorenrose1013: The object you cloned is a prop, like the pencil for homework or knife/spoon for cooking. Props are instantiated for animations and are destroyed immediately afterwards. Therefore they have no functionality on their own and need no script class. Now to start an object from scratch, derive it from the abstract GameObject class. Be aware, though, that what you're planning is not really a beginner's project. I dare say it's not even intermediate. An Eat interaction is a non-immediate interaction and needs a whole lot more than what's needed for the basic interaction from the tutorial. |
Darn I thought this would be simple! If it's not even intermediate, I'm re-thinking this...(Tucks idea in the very back of notebook)
Oh well, thanks for the tip about it not being a beginners project. Now I just have to think of something that is beginner!
#41
5th Oct 2011 at 2:56 PM
Last edited by BloomsBase : 5th Oct 2011 at 3:50 PM.
Posts: 4,419
Thanks: 2481 in 21 Posts
According to the tutorial(the video) Koli imports 11 .DLL files as reference files in MS visual C but i only have 8....
Following the tutorial I took the files from:
Gameplay.package wich has 3 files in it(Sims3GameplaySystems.dll / Sims3GameplayObjects.dll / UI.dll)
SimsCore.package wich has 3 files in it(System.Xml.dll / System.dll / mscorlib.dll)
Script.package wich has 3 files in it(SimIFace.dll / ScriptCore.dll / Sims3Metadata.dll)
A total of 9 but according to the tut you dont need the mscorlib.dll as it is integrated in MS visual C already, so i have 8
I am still missing 3 files, wich ones and were to locate them?
Following the tutorial I took the files from:
Gameplay.package wich has 3 files in it(Sims3GameplaySystems.dll / Sims3GameplayObjects.dll / UI.dll)
SimsCore.package wich has 3 files in it(System.Xml.dll / System.dll / mscorlib.dll)
Script.package wich has 3 files in it(SimIFace.dll / ScriptCore.dll / Sims3Metadata.dll)
A total of 9 but according to the tut you dont need the mscorlib.dll as it is integrated in MS visual C already, so i have 8
I am still missing 3 files, wich ones and were to locate them?
Field Researcher
#42
5th Oct 2011 at 4:04 PM
Posts: 256
Thanks: 1130 in 6 Posts
Its the testing Dlls that were removed a while ago. They were put into the main Dlls.
#43
18th Feb 2012 at 11:45 AM
Posts: 65
Why doesn't my script work ?!!
I followed your tutorial and when I upload everything it say there is no interaction! is my problem within my script or within my uploading my namespace in the game OBJK?
Attached files:
ClassLibrary1.rar (21.8 KB, 19 downloads) - View custom content | ||||||||||
Size Packed Ratio Date Time Attr CRC Meth Ver ------------------------------------------------------------------------------- Abd123_PrayingRug2x1_696DF2D2.package 30820 21381 69% 18-02-12 10:45 .....A. 329C6BD8 m3b 2.9 Class1.cs 2290 801 34% 18-02-12 12:16 .....A. F739C8DC m3b 2.9 ------------------------------------------------------------------------------- 2 33110 22182 66% |
#44
18th Feb 2012 at 12:22 PM
Your script's namespace is Sims3.Gameplay.Objects.Decorations.Mimics.PrayingRug2x1, your class name is TalkingTeddy. Thus the full type name is Sims3.Gameplay.Objects.Decorations.Mimics.PrayingRug2x1.TalkingTeddy. The latter one is what you need to use as the script class in the OBJK.
Also the choices for the names are pretty poor. Take another modder who picks names like that and we're bound to have conflicts.
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Also the choices for the names are pretty poor. Take another modder who picks names like that and we're bound to have conflicts.
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
#45
19th Feb 2012 at 7:10 PM
Posts: 65
Quote: Originally posted by Buzzler
Your script's namespace is Sims3.Gameplay.Objects.Decorations.Mimics.PrayingRug2x1, your class name is TalkingTeddy. Thus the full type name is Sims3.Gameplay.Objects.Decorations.Mimics.PrayingRug2x1.TalkingTeddy. The latter one is what you need to use as the script class in the OBJK. |
so that solved a part of my problem
before I continue with this:
is this code inheritance because if it's correct then I made this code correct sense all rugs are suppose to inherit rug class!
Quote: Originally posted by Buzzler
Also the choices for the names are pretty poor. Take another modder who picks names like that and we're bound to have conflicts. |
you got that right over there!
Code:
class TalkingTeddy : Rug
First poorly named is
TalkingTeddy it should of been TalkingRug to make it more understandable for others.
This is what it should look like:
Code:
class TalkingRug : Rug
but still that doesn't do anything since it's just a name.
so I thought the problem was that maybe the rug doesn't have any interaction from the beginning so the said let me create a new script with the same code and the same object which was a "teddy bear" you give in the tutorial but the problem that happen is that when I used that code below with the "teddy bear"
Code:
using System; using System.Collections.Generic; using System.Text; using Sims3.Gameplay.Objects.Miscellaneous; using Sims3.Gameplay.Interactions; using Sims3.Gameplay.Actors; using Sims3.Gameplay.Autonomy; using Sims3.SimIFace; using Sims3.UI; namespace Sims3.Gameplay.Objects.Miscellaneous.KolipokiMod { class TalkingTeddy : StuffedAnimal { public sealed class TalktoMe : ImmediateInteraction<Sim, TalkingTeddy> { public static readonly InteractionDefinition Singleton = new Definition(); protected override bool Run() { base.Actor.ShowTNSIfSelectable("Hello!", StyledNotification.NotificationStyle.kSimTalking); return true; } [DoesntRequireTuning] private sealed class Definition : ImmediateInteractionDefinition<Sim, TalkingTeddy, TalkingTeddy.TalktoMe> { protected override string GetInteractionName(Sim a, TalkingTeddy target, InteractionObjectPair interaction) { return "Talk To Me"; } protected override bool Test(Sim a, TalkingTeddy target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { return !isAutonomous; } } } public override void OnStartup() { base.OnStartup(); base.AddInteraction(TalktoMe.Singleton); } } }
and with using
Code:
Sims3.Gameplay.Objects.Miscellaneous.KolipokiMod.TalkingTeddy
it says that there is no interaction with this object.
can I have a correct package for that talking teddy? to check what I made wrong ?
I hope I am not taking non-sense hehe!
#46
20th Feb 2012 at 7:48 AM
Quote: Originally posted by abd123
is this code inheritance because if it's correct then I made this code correct sense all rugs are suppose to inherit rug class! |
Quote:
This is what it should look like:
Code:
class TalkingRug : Rug
Code:
namespace Sims3.Gameplay.Objects.Miscellaneous.KolipokiMod{...} |
Quote:
Code:
Sims3.Gameplay.Objects.Miscellaneous.KolipokiMod.TalkingTeddy it says that there is no interaction with this object. |
The "no interactions available" thing is usually a dead certain sign that the game didn't find the script class referenced in the OBJK. In that case the object won't be instantiated with your class, but with a fallback class called FailureObject which has no actual functionality.
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
#47
20th Feb 2012 at 11:21 AM
Posts: 65
I have solved my problem !
the problem was with this code:
Wrong inheritance ! //This made my object look scraped and I couldn't buy it!
The correct code for my Inhertitance was:
Correct inheritance!
and in the script:
I am glade I fixed it ! now I can try and give it my animation !
the problem was with this code:
Code:
class TalkingTeddy : Rug
Wrong inheritance ! //This made my object look scraped and I couldn't buy it!
The correct code for my Inhertitance was:
Code:
class TalkingRug:RugCountryOval2x1
Correct inheritance!
and in the script:
Code:
Sims3.Gameplay.Objects.Decorations.Mimics.TalkingRug2x1.TalkingRug
I am glade I fixed it ! now I can try and give it my animation !
#48
5th Mar 2012 at 4:42 PM
I've been trying to poke around in Tree Of Prosperity script, to remove the check for the WishingWell to spawn the LightShow. This is what I did and it didn't work, obviously.
1. Opened the .dll in ILSpy.
2. Saved the code as a cs project.
3. Opened the cs project in VS 2008.
4. Specific not to use mscorlib.dll
5. Changed the reference path so it points to where I keep the game dlls
6. Add the mscorlib extracted from the game files
7. Change Copy Local to False for the references
So now I want to remove: && this.HasWishingWellOnLot from the function that checks if it's time to start the Light Show. I do that, but I can't compile because I get an error:
The type or namespace name 'IsValid' does not exist in the namespace 'Sims3.Store.Objects' (are you missing an assembly reference?)
I saw Buzzler say this:
But if I add the .dll for the Tree of Prosperity as reference in my project, I get many more errors, because there is a conflict.
Do I need to create a different namespace for the tree of prosperity to get this to work?
1. Opened the .dll in ILSpy.
2. Saved the code as a cs project.
3. Opened the cs project in VS 2008.
4. Specific not to use mscorlib.dll
5. Changed the reference path so it points to where I keep the game dlls
6. Add the mscorlib extracted from the game files
7. Change Copy Local to False for the references
So now I want to remove: && this.HasWishingWellOnLot from the function that checks if it's time to start the Light Show. I do that, but I can't compile because I get an error:
The type or namespace name 'IsValid' does not exist in the namespace 'Sims3.Store.Objects' (are you missing an assembly reference?)
I saw Buzzler say this:
Quote: Originally posted by Buzzler
If you want to use that particular item in your code, you need to extract the dll (from the S3SA) from the package (the one you extracted from the sims3pack) and add it to the references in your Visual Studio project. Load it to your assembly browser if you want to see its code. |
But if I add the .dll for the Tree of Prosperity as reference in my project, I get many more errors, because there is a conflict.
Do I need to create a different namespace for the tree of prosperity to get this to work?
#49
5th Mar 2012 at 5:34 PM
@nonamena: Please attach your code, so it's possible to see where and how exactly the error occurs.
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
#50
5th Mar 2012 at 5:58 PM
Quote: Originally posted by Buzzler
@nonamena: Please attach your code, so it's possible to see where and how exactly the error occurs. |
Thanks, Buzzler. I've attached the original .dll for the Tree of Prosperity as well as my own cs project.
Attached files:
StoreObjectsTreeOfProsperity.zip (13.5 KB, 17 downloads) - View custom content | ||
29184 02-17-12 21:14 StoreObjectsTreeOfProsperity.dll -------- ------- 29184 1 file |
||
Description: original dll | ||
Nonamena_code.zip (18.0 KB, 18 downloads) - View custom content | ||
0 03-05-12 17:35 Nonamena_code/bin/ 0 03-05-12 17:28 Nonamena_code/bin/Debug/ 0 03-05-12 17:35 Nonamena_code/bin/Release/ 0 03-05-12 17:35 Nonamena_code/obj/ 0 03-05-12 17:28 Nonamena_code/obj/Debug/ 0 03-05-12 17:28 Nonamena_code/obj/Debug/TempPE/ 0 03-05-12 18:55 Nonamena_code/obj/Release/ 0 03-05-12 17:40 Nonamena_code/obj/Release/build.force 19275 03-05-12 17:40 Nonamena_code/obj/Release/ResolveAssemblyReference.cache 175 03-05-12 18:55 Nonamena_code/obj/Release/StoreObjectsTreeOfProsperity.csproj.FileListAbsolute.txt 0 03-05-12 17:35 Nonamena_code/obj/Release/TempPE/ 0 03-05-12 17:28 Nonamena_code/Sims3.Gameplay.Interfaces/ 277 03-05-12 17:28 Nonamena_code/Sims3.Gameplay.Interfaces/IWishingWell.cs 0 03-05-12 17:35 Nonamena_code/Sims3.Store.Objects/ 44376 03-05-12 17:35 Nonamena_code/Sims3.Store.Objects/TreeOfProsperity.cs 2138 03-05-12 17:40 Nonamena_code/StoreObjectsTreeOfProsperity.csproj 185 03-05-12 17:35 Nonamena_code/StoreObjectsTreeOfProsperity.csproj.user 949 03-05-12 17:35 Nonamena_code/StoreObjectsTreeOfProsperity.sln 11264 03-05-12 18:56 Nonamena_code/StoreObjectsTreeOfProsperity.suo -------- ------- 78639 19 files |
||
Description: my failing project |
Who Posted
|