| Search this Thread |
|
|
|
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
The tutorial is located in the wiki: Sims 3 Pure Scripting Modding If you have questions concerning the tutorial, this thread is the place to ask them. |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
|
|
|
|
|
5 users say thanks for this.
[ Click here to view a longer list ] |
|
|
|
#2 |
| gladosrev2 |
Thanks! It works perfectly. I was just wondering how to write a mod without custom objects and then you posted this ^^ And this tutorial seems to hint at the precise reason why the game crashes with some mods that use only a custom namespace name, without nesting it in an existing EA namespace (this topic ). So if you use only your own namespace, without putting it inside, lets say, Sims3.Gameplay, and don't use a static instantiator variable and a xml file to instantiate the class, then clicking on that custom object in game in buy mode will cause a crash to desktop when the game tries to create the object, because the object wasn't initialized. Because the game didn't know it was there, since the namespace of that object was not within Sims3 namespaces! Is that a correct reasoning? And the reason why nesting your namespace within EA namespaces does fix that problem, without the need of a xml file, is because the game seems to instantiate all objects by default within the Sims3 namespace, and within all child namespaces, if the objects have static components, so also the object within your nested namespace - even without the xml file. Is that correct? I simply can't live without knowing, why exactly something crashes and why a fix works, like in that case. ![]() Anyway, awesome, informative tutorial. |
|
"The past tempts us, the present confuses us and the future frightens us.. and our lives slip away, moment by moment, lost in that vast, terrible in-between" |
|
|
|
|
|
|
#3 |
|
Inge Jones
|
I'd still like to know why it was only after LN that custom namespaces became a problem though. |
|
simlogical Please do not PM me with questions about modding. Please post in an appropriate forum and send me a link to the thread if you would like me to try and help. |
|
|
|
|
|
|
#4 | |||
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
Quote:
Quote:
What is actually different for a buymode object that already existed in the town when you loaded the game and an object that the game tries to create when you click on the thumbnail in buymode? Fetching the mesh, finding the assembly, and instantiating an object aren't different. That much seems certain. The BuildBuyMode stuff is mind-meltingly massive and wide-spread. Last time I browsed that code, I couldn't even find the point where the actual object gets created. In the thread you linked, twallan speculated that the game might use the script class as a lookup value for some store stuff. That might be the case. All we know for certain is that the exception gets thrown in the unmanaged code, and that the devs at that point Quote:
| |||
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||||
|
|
|
|
|
#5 |
|
silent_j
Test Subject
Join Date: Mar 2010 |
Hi, First off thanks for this tutorial. I'm wondering if during the first step, when you extract the game libraries, you should extract them from only the base game .packages or from the latest EP .packages? Much thanks. |
|
|
|
|
|
#6 | |
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
Quote:
| |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
|
|
#7 |
|
Vondure
Test Subject
Join Date: Jun 2010 |
Hi Buzzler, I just installed C# 2010 but my Reflector couldn't detect it. How do I fix it? ![]() |
|
|
|
|
|
#8 | |
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
Quote:
| |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
|
|
#9 |
|
Vondure
Test Subject
Join Date: Jun 2010 |
How do I set a project's framework version to .NET Framework 2.0? I can't seem to find that option anywhere in the New Project window. I thought having Reflector integrated with C# will solve that issue, but I can't seem to get that working either. |
|
|
|
|
|
#10 | |
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
Quote:
| |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
|
|
#11 |
|
Vondure
Test Subject
Join Date: Jun 2010 |
Thank you. ![]() I'm missing three .dll files, would it be alright to continue? My core libraries only contained three S3SA files each. I don't have TestGameplay.dll, TestObject.dll and Automation.dll. |
|
|
|
|
|
#12 | |
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
Quote:
![]() Where did you read about these three dlls anyway? I thought all tutorials were updated now... | |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
|
|
#13 |
|
Vondure
Test Subject
Join Date: Jun 2010 |
At the beginning of your tutorial, there is a link leading to another page regarding game-compatible VS projects. Step 4 of this tutorial mentioned these .dll files, along with a screenshot. I also Google'd them and ended up onto another page that again mentioned them. I have another question; I have nothing to worry about this warning, right? ![]() |
|
|
|
|
|
#14 | |
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
Thanks for the heads up regarding Sims_3:Creating_a_game_compatible_Visual_Studio_projectwiki. I'll see about changing that. Quote:
I don't know whether projects compiled against the .NET mscorlib will work in the game; you're welcome to try. | |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
|
|
#15 |
|
Vondure
Test Subject
Join Date: Jun 2010 |
Damn, it would be a bummer if I had to go back to VS 2008. But I'm not yet done with the project, because it won't produce the appropriate .dll file. Everytime I build the solution, I get these errors: ![]() As you can tell, I'm practically new with all of these; I felt all along that this is somehow not really my calling. But what the heck, it's worth a shot. How do I fix it? |
|
|
Last edited by Vondure : 19th Mar 2011 at 12:51 PM.
|
|
|
#16 | |||
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
Quote:
Code:
in your code.
Change it to
Code:
and you should be good to go.
| |||
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||||
|
|
|
|
|
#17 |
|
Vondure
Test Subject
Join Date: Jun 2010 |
I have it typed in correctly. I'm sorry, I should have known better and posted screenshots of my project instead of having you blindly guess the problem. Anyway, I found out that the cause was actually line 4 of AssemblyInfo.cs. It turns out that I simply typed in "Sims3.SimIFace;" leaving out the word 'using' before it. I guess I've gotten confused in your tutorial because the word 'using' is in a different font than "Sims3.SimIFace;". So I only copy-pasted the latter. If that makes sense. I fixed it. ![]() Now, I'm getting another error; I think it's referring to that class called 'object' down on page 18: ![]() |
|
The magic page 4 holds. I broke the rule. |
|
|
|
Last edited by Vondure : 20th Mar 2011 at 6:25 AM.
|
|
|
#18 | ||
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
Quote:
![]() Quote:
| ||
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
|||
|
|
|
|
|
#19 |
|
lenglel
|
I use vs2010 and got it to work by editing the csproj. You just need to change the path to mscorlib from the default to wherever you put the sims3 version of mscorlib. Or, if you don't have the reference to mscorlib in the .csproj file, just paste the below in the <ItemGroup> where all the other <Reference Include= lines are located and edit the <HintPath> as needed. <Reference Include="mscorlib"> <HintPath>..\..\..\..\s3mod projects\simcore\mscorlib.dll</HintPath> <Private>False</Private> </Reference> |
|
|
|
|
|
#20 | ||
|
Vondure
Test Subject
Join Date: Jun 2010 |
Quote:
I unticked the, "Do not reference mscorlib" checkbox, built the project, and it worked. I thought to myself that the default mscorlib file couldn't possibly work for TS3, otherwise there wouldn't be any point as to why we're even using the TS3 version of mscorlib. But to my surprise, the mod did work in-game. Is this normal? Or are there going to be side effects? Why are we using the TS3 version when the default mscorlib works out just fine? Quote:
Even though I solved my problem, I'd still wanna know: How do I change the reference path within the .csproj? Where is this "<ItemGroup>" and all of those other codes? Please forgive me for asking a lot of questions but I'm really new to VS and all of these C sharp talks, so I find it very difficult to keep up. I just started learning as soon as I posted in this thread(3 days ago). Any new information would go a long way. And before I forget, thank you guys for helping me with my first script mod.
| ||
|
The magic page 4 holds. I broke the rule. |
|||
|
|
|
|
|
#21 | |
|
Buzzler
Original Poster
1978 gallons of pancake batter
|
Quote:
So, yeah, it will probably work if you don't go crazy and if you ever do something the TS3 mscorlib doesn't support, the compiled library hopefully won't link and stall your game instead of causing subtle borkedness. I for one would prefer to get Visual Studio to reference the TS3 mscorlib or at least manually compile against it. | |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
|
|
#22 |
|
lenglel
|
Vondure: Just use a text editor like notepad++ to open and edit the file with the .csproj extension. It's in the first subfolder of your projects folder in the vs2010 projects directory. You'd need to change the path to point to wherever you extracted the ts3 mscorlib. |
|
|
|
|
|
#23 | ||
|
Vondure
Test Subject
Join Date: Jun 2010 |
Quote:
I will try to do that. I sure hope it doesn't crash my game. So far it's working alright for this particular mod, but I'll keep that in mind. Quote:
Is this correct? ![]() | ||
|
The magic page 4 holds. I broke the rule. |
|||
|
|
|
|
|
#24 |
|
lenglel
|
It might be correct for your setup, but mine has a lot of stuff yours doesn't. I've got my simcore stuff outside the vs2010 hierarchy, that's why all my hintpaths start with "..\..\..\..\s3modprojects\simcore\ The PropertyGroup sections get set up from within vs2010 when you select your project's properties. The first ItemGroup is the source files and the second is the references from the using statements at the top of the source file. That's where the reference to the sims 3 version of mscorlib goes. Here's what mine looks like: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{9306C19F-3AA2-40AE-B7AC-A88EA19330B5}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>LWE4</RootNamespace> <AssemblyName>LWE4</AssemblyName> <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <NoStdLib>true</NoStdLib> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <NoStdLib>true</NoStdLib> </PropertyGroup> <PropertyGroup> <RunPostBuildEvent>Always</RunPostBuildEvent> </PropertyGroup> <ItemGroup> <Compile Include="Class1.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> <Reference Include="mscorlib"> <HintPath>..\..\..\..\s3mod projects\simcore\mscorlib.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="ScriptCore"> <HintPath>..\..\..\..\s3mod projects\simcore\ScriptCore.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="SimIFace"> <HintPath>..\..\..\..\s3mod projects\simcore\SimIFace.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Sims3GameplayObjects"> <HintPath>..\..\..\..\s3mod projects\simcore\Sims3GameplayObjects.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Sims3GameplaySystems"> <HintPath>..\..\..\..\s3mod projects\simcore\Sims3GameplaySystems.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Sims3Metadata"> <HintPath>..\..\..\..\s3mod projects\simcore\Sims3Metadata.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System"> <HintPath>..\..\..\..\s3mod projects\simcore\System.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System.Xml"> <HintPath>..\..\..\..\s3mod projects\simcore\System.Xml.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="UI"> <HintPath>..\..\..\..\s3mod projects\simcore\UI.dll</HintPath> <Private>False</Private> </Reference> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <PropertyGroup> <PostBuildEvent> </PostBuildEvent> </PropertyGroup> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> |
|
|
|
|
|
#25 | |
|
Doczott
Test Subject
Join Date: Oct 2010 |
Quote:
You can use Visual C# Express. You just have to manually edit the .csproj file to make it see the right one. For me, I have extract the necessary dlls to My Documents\Visual Studio 2010\Sims3dll. After you have told it not to use mscorlib (not totally useless checkmark), you exit Visual C# 2010. Then (assuming for this your project is named MyScript) you open the My Documents\Visual Studio 2010\MyScript\MyScript\MyScript.csproj with something like Notepad or Notepad++. You will find a section looking like this. <ItemGroup> <Reference Include="ScriptCore"> <HintPath>..\..\..\Sims3dll\ScriptCore.dll</HintPath> </Reference> <Reference Include="SimIFace"> <HintPath>..\..\..\Sims3dll\SimIFace.dll</HintPath> </Reference> <Reference Include="Sims3GameplayObjects"> <HintPath>..\..\..\Sims3dll\Sims3GameplayObjects.dll</HintPath> </Reference> <Reference Include="Sims3GameplaySystems"> <HintPath>..\..\..\Sims3dll\Sims3GameplaySystems.dll</HintPath> </Reference> <Reference Include="Sims3Metadata"> <HintPath>..\..\..\Sims3dll\Sims3Metadata.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Xml" /> <Reference Include="UI"> <HintPath>..\..\..\Sims3dll\UI.dll</HintPath> </Reference> </ItemGroup> You need to change it to include a reference to mscorlib and change the reference for System, System.Xml, and UI. It should look similar to this: <ItemGroup> <Reference Include="Mscorlib"> <HintPath>..\..\..\Sims3dll\mscorlib.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="ScriptCore"> <HintPath>..\..\..\Sims3dll\ScriptCore.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="SimIFace"> <HintPath>..\..\..\Sims3dll\SimIFace.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Sims3GameplayObjects"> <HintPath>..\..\..\Sims3dll\Sims3GameplayObjects.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Sims3GameplaySystems"> <HintPath>..\..\..\Sims3dll\Sims3GameplaySystems.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Sims3Metadata"> <HintPath>..\..\..\Sims3dll\Sims3Metadata.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System"> <HintPath>..\..\..\Sims3dll\System.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System.Xml"> <HintPath>..\..\..\Sims3dll\SystemXml.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="UI"> <HintPath>..\..\..\Sims3dll\UI.dll</HintPath> <Private>False</Private> </Reference> </ItemGroup> This should fix any problems with the default mscorlib and Visual C# 2010. I realize that is what the post above was trying to say. I am just trying to make it obvious for everybody what to edit. |
|
|
|
|
![]() |

Feeling like a bit of a chat about creation or just... whatever (not necessarily sims)?










Twitter
del.icio.us
StumbleUpon
Google