View Full Version : Tutorial: Sims 3 Pure Scripting Modding
Buzzler
7th Nov 2010, 11:32 PM
The Tutorial
The tutorial is located in the wiki: Sims 3 Pure Scripting Modding (http://www.simswiki.info/wiki.php?title=Tutorial:Sims_3_Pure_Scripting_Modding)
Questions?
If you have questions concerning the tutorial, this thread is the place to ask them.
gladosrev2
8th Nov 2010, 01:47 PM
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 (http://www.modthesims.info/showthread.php?t=423291) ). 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. :p
Anyway, awesome, informative tutorial.
Inge Jones
8th Nov 2010, 02:24 PM
I'd still like to know why it was only after LN that custom namespaces became a problem though.
Buzzler
8th Nov 2010, 04:41 PM
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{...}I don't think it does.
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.{...}No, the initializing of the static fields of a class is something that gets enforced by the framework. Initializing an object, aka an instance of the class, is the job of the non-static constructor(s) and thus completely unrelated. Since script classes for object mods need to be derived from GameObject, there's actually a shitload of other differences BTW.
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 probably most definitely didn't safe-guard their code against "unexpected results".
I simply can't live without knowing, why exactly something crashes and why a fix works, like in that case.Then it'd probably be best to get yourself an EAxian coder (kidnapping might help) and hook him up to a car battery until he spills the beans. ;) The unmanaged code is terra incognita for modders. The chance that we ever learn what is causing the crashing issue is less than miniscule.
silent_j
24th Dec 2010, 05:12 PM
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.
Buzzler
25th Dec 2010, 12:19 PM
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?Doesn't matter. As long as base game and EPs are on the same related patch level (you can check the code version of the S3SA resources in S3PE - current version is 0.2.0.128), the libraries are the same.
Vondure
18th Mar 2011, 04:04 AM
Hi Buzzler,
I just installed C# 2010 but my Reflector couldn't detect it. How do I fix it?
http://i.imgur.com/WOmpA.png
Buzzler
18th Mar 2011, 08:58 AM
I just installed C# 2010 but my Reflector couldn't detect it. How do I fix it?I don't know. What do you need that for anyway?
Vondure
18th Mar 2011, 03:19 PM
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.
Buzzler
18th Mar 2011, 03:53 PM
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.That's because it isn't there. ;) Change it afterwards. Project->{your project's name} properties... and then you should see it.
Vondure
19th Mar 2011, 06:24 AM
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.
Buzzler
19th Mar 2011, 07:17 AM
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.It's safe to continue without them, you don't need these. :)
Where did you read about these three dlls anyway? I thought all tutorials were updated now...
Vondure
19th Mar 2011, 11:39 AM
At the beginning of your tutorial (http://www.simswiki.info/wiki.php?title=Tutorial:Sims_3_Pure_Scripting_Modding#Getting_Started), there is a link leading to another page (http://www.simswiki.info/wiki.php?title=Sims_3:Creating_a_game_compatible_Visual_Studio_project#Step_4:_Add_references_to_the_Sims_3_assemblies) regarding game-compatible VS projects. Step 4 of this tutorial mentioned these .dll files, along with a screenshot (http://www.simswiki.info/wiki.php?title=File:Sims_3-VS_Add_References_Browse.png). I also Google'd them and ended up onto another page (http://www.modthesims.info/showthread.php?t=378578) that again mentioned them.
I have another question; I have nothing to worry about this warning, right?
http://i.imgur.com/piVmw.png
Buzzler
19th Mar 2011, 11:56 AM
Thanks for the heads up regarding Sims_3:Creating_a_game_compatible_Visual_Studio_project. I'll see about changing that.
I have another question; I have nothing to worry about this warning, right?Damn, I was kinda waiting for that one. ;) It's a known bug in Visual Studio that the "Do not reference mscorlib" thing does nothing. In VS2008 it at least worked most of the times, but in VS2010 it doesn't seem to do anything at all anymore.
I don't know whether projects compiled against the .NET mscorlib will work in the game; you're welcome to try. ;) The only other "solution" is to go back to Visual Studio 2008.
Vondure
19th Mar 2011, 12:30 PM
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:
http://i.imgur.com/EiqBC.png
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?
Buzzler
19th Mar 2011, 10:39 PM
Everytime I build the solution, I get these errors:{...}I just tried to reproduce these errors, and I think you simply wroteassembly: Tunablein your code.
Change it to [assembly: Tunable]and you should be good to go.
Vondure
20th Mar 2011, 06:10 AM
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.
http://i.imgur.com/h41Fk.png
Now, I'm getting another error; I think it's referring to that class called 'object' down on page 18:
http://i.imgur.com/QaeyO.png
Buzzler
20th Mar 2011, 11:47 AM
I guess I've gotten confused in your tutorial because the word 'using' is in a different font than "Sims3.SimIFace;".Fixed. :)
Now, I'm getting another error; I think it's referring to that class called 'object' down on page 18:{...}That means that VisualStudio actually did derefence mscorlib, or at least uses the /nostdlib compiler option. Try to add the mscorlib from TS3 once more or, if that doesn't work, untick the "Do not reference mscorlib" thing again.
lenglel
21st Mar 2011, 11:16 AM
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>
Vondure
21st Mar 2011, 04:54 PM
That means that VisualStudio actually did derefence mscorlib, or at least uses the /nostdlib compiler option. Try to add the mscorlib from TS3 once more or, if that doesn't work, untick the "Do not reference mscorlib" thing again.
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?
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>
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. :)
Buzzler
21st Mar 2011, 08:02 PM
Why are we using the TS3 version when the default mscorlib works out just fine?The mscorlib from TS3 is not the .NET mscorlib that Visual Studio uses by default; it's an altered mscorlib from the MONO portable framework. MONO implements .NET 2.0, so a library compiled against the .NET mscorlib should work ... most of the times. I honestly don't know in which ways the MONO mscorlib might differ or what it might not implement or what the EAxian devs stripped from it (apart from direct file access).
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.
lenglel
22nd Mar 2011, 11:01 AM
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.
Vondure
22nd Mar 2011, 12:02 PM
The mscorlib from TS3 is not the .NET mscorlib that Visual Studio uses by default; it's an altered mscorlib from the MONO portable framework. MONO implements .NET 2.0, so a library compiled against the .NET mscorlib should work ... most of the times. I honestly don't know in which ways the MONO mscorlib might differ or what it might not implement or what the EAxian devs stripped from it (apart from direct file access).
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.
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.
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.
Is this correct?
http://i.imgur.com/NnWYC.png
lenglel
24th Mar 2011, 01:33 AM
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>
Doczott
14th Jun 2011, 05:34 PM
Damn, I was kinda waiting for that one. ;) It's a known bug in Visual Studio that the "Do not reference mscorlib" thing does nothing. In VS2008 it at least worked most of the times, but in VS2010 it doesn't seem to do anything at all anymore.
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.
Thistleryver
11th Aug 2011, 10:52 AM
Thanks for the tutorial. It was really useful for me because I had only ever made core mods. I am just curious about one thing because I want to understand how all this stuff works:
When the XML resource is added you said that the instance number is important. Why is that number important but the one for the .dll file is not?
Buzzler
11th Aug 2011, 12:12 PM
When the XML resource is added you said that the instance number is important. Why is that number important but the one for the .dll file is not?The assemblies always get loaded, not matter what their instance is. It's just important that the instance is unique.
Now my idea of what happens during startup: The game parses all fields in all assemblies to find classes with Tunable fields. When it does, it takes the namespace of the class, hashes it and tries to load an XML which has that hash as instance. If it does, it assigns the content of the XML to the fields. That last part accesses static fields of the class and thus the static constructor will be called. The rest is in the tutorial. ;)
JT`
18th Oct 2011, 02:59 PM
http://simswiki.info/wiki.php?title=Sims_3:Creating_a_game_compatible_Visual_Studio_project makes reference of an Automation.dll which I don't see as part of the standard gameplay packages. I guess it's in FullBuild... any features that we would need from that one? The tutorial for basic scripting doesn't list it.
Buzzler
18th Oct 2011, 05:42 PM
@JT`: Automation.dll was part of earlier game versions, but hasn't been in the core packages for some time now. Just ignore it. You don't need it anyway.
Gummipalle
23rd Oct 2011, 10:09 AM
I just completed this tut... The game loads and finds the mod, i click ok, and proceed to play the game, but it never pauses... ?
Could it have something to do with the Pets EP I just installed?
I did this tut before and it worked fine....
Ragoczy
12th Mar 2012, 09:06 PM
I just completed this tut... The game loads and finds the mod, i click ok, and proceed to play the game, but it never pauses... ?
Could it have something to do with the Pets EP I just installed?
I did this tut before and it worked fine....
So I'm encountering the same problem. Project builds fine, game loads, package shows up in the list of mods, but it doesn't pause. Did you find a resolution?
I don't have Pets, but do have Generations.
Absimiliard
13th May 2012, 08:12 PM
I just completed this tut... The game loads and finds the mod, i click ok, and proceed to play the game, but it never pauses... ?
Could it have something to do with the Pets EP I just installed?
I did this tut before and it worked fine....
I have made mods that add onto MasterController and they've worked. But I cannot create a stand-alone project with this code function.
To add some info...
I wanted to make a mod that randomized sims as they were created, like awesomemod does but seperate and modular. I was making a core mod when I decided it could probably be done via scripting. I made a mod that extended twallan's Master Controller much along the lines of Master Controller Cheats. The MC mod I made didn't require any xml (instantiator calls) and were just using the framework he established to add menu items for selection and function.
Everything was looking good, the functionality was in the game and I was quite proud of myself. I decided that the functionality I was using should be called automatically (when a sim was instantiated) and should probably be removed from MC for portability so I went to move it into its own mod, but it didn't work.
First, I thought I'd just made some mistake so I followed this guide with my code in it and still got no result (showed up in installed mods screen, but provided no functionality). So then I replaced my code with the code in the tutorial, and got the same result. I thought the problem might be VS 2010 related so I downloaded VS 2008, followed the tutorial again and still got the same result. I have changed AssemblyInfo.cs to include the changes and de/rereferenced everything as the tutorial indicates and still no go. I've even added a notification to the code just to be sure that a message should pop up if the mod works.
I've heard some people mention namespace issues, I don't know if there's some other step that has to be included but something's not right here.
ETA: I've been beating my head against a wall, but I may have something... The dlls I build import into s3pe with an extra "Type:" line at the bottom of the description panel under the reference (Ref) lines (don't know what it's called, the right panel info that displays when you select a S3SA - starts with Version:...) I've looke at other working mods and none of them have a "Type:" line. It seems to me that me build settings are somehow not what they should be, but I cannot find how to remove that line.
Absimiliard
14th May 2012, 11:44 PM
I have got my mod working, but not with the pause working.
I had a problem with not giving my xml the correct hash for my class (read it like 50 times but somehow didn't do it right). That may be what's holding some people up.
I'm not sure if that implementation of pausing doesn't work or what the problem is there.
xstats
30th May 2012, 07:09 PM
I ditto the above user. I'm running TS3 BaseGame only, latest patches.
I was able to get most of it to work, however as I have no EPs, I can't test the vacation world stuff... but hopefully this gets you on the right track:
namespace TwoBTech
{
public class Pausinator
{
[Tunable]
protected static bool kInstantiator = false;
static Pausinator()
{
World.OnWorldLoadFinishedEventHandler += new EventHandler(OnWorldLoadFinished);
}
private static void OnWorldLoadFinished(object sender, EventArgs e)
{
AlarmManager.Global.AddAlarm(1f, TimeUnit.Seconds, new AlarmTimerCallback(delegate()
{
StyledNotification.Show(new StyledNotification.Format("TwoBTech.Pausinator loaded", StyledNotification.NotificationStyle.kSystemMessage));
Sims3.Gameplay.Gameflow.SetGameSpeed(Gameflow.GameSpeed.Pause, false);
}), "TwoBTech.Pausinator Alarm", AlarmType.NeverPersisted, null);
}
}
}
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.