http://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&feed=atom&action=historyTutorial:Sims 3 Object Modding - Revision history2024-03-28T12:06:09ZRevision history for this page on the wikiMediaWiki 1.20.2http://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=54965&oldid=prevLeesester: /* Finding The Original Object's Class */2012-02-03T19:26:16Z<p><span dir="auto"><span class="autocomment">Finding The Original Object's Class</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 19:26, 3 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 48:</td>
<td colspan="2" class="diff-lineno">Line 48:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This next step is important because it will later be used to make your script be derived from the previous object. That will ensure that the new object has all the properties of the original object.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This next step is important because it will later be used to make your script be derived from the previous object. That will ensure that the new object has all the properties of the original object.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>*Open the package in S3PE.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>*Open the package in S3PE.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>*<del class="diffchange diffchange-inline">Select </del>the OBJK resource<del class="diffchange diffchange-inline">.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>*<ins class="diffchange diffchange-inline">Right-click </ins>the OBJK resource <ins class="diffchange diffchange-inline">and on the bottom of the popup window (context menu), click </ins>on Edit OBJK</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">*Click </del>on <del class="diffchange diffchange-inline">"</del>Edit OBJK<del class="diffchange diffchange-inline">".</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>*Look at the content of the Data field in the Script row. That is the class name including the full namespace. (<tt>Sims3.Gameplay.Objects.Miscellaneous.StuffedAnimal</tt> in this case)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>*Look at the content of the Data field in the Script row. That is the class name including the full namespace. (<tt>Sims3.Gameplay.Objects.Miscellaneous.StuffedAnimal</tt> in this case)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><br clear="all"/></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><br clear="all"/></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Your Custom Script==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Your Custom Script==</div></td></tr>
</table>Leesesterhttp://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=54964&oldid=prevLeesester: /* Adding The Script To The Package */2012-02-03T19:23:28Z<p><span dir="auto"><span class="autocomment">Adding The Script To The Package</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 19:23, 3 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 356:</td>
<td colspan="2" class="diff-lineno">Line 356:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* <del class="diffchange diffchange-inline">Select </del>the S3SA resource and on the bottom of the <del class="diffchange diffchange-inline">S3PE </del>window, click on Import DLL.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* <ins class="diffchange diffchange-inline">Right-click </ins>the S3SA resource and on the bottom of the <ins class="diffchange diffchange-inline">popup </ins>window <ins class="diffchange diffchange-inline">(context menu)</ins>, click on Import DLL.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Navigate to the .dll file VS created. It will be in Documents\Visual Studio xxxx\Projects\{YourProjectName}\{YourProjectName}\bin\Release.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Navigate to the .dll file VS created. It will be in Documents\Visual Studio xxxx\Projects\{YourProjectName}\{YourProjectName}\bin\Release.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Select the file; click on the Open button and click on Yes once being prompted to Commit Changes.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Select the file; click on the Open button and click on Yes once being prompted to Commit Changes.</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 369:</td>
<td colspan="2" class="diff-lineno">Line 369:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* <del class="diffchange diffchange-inline">Select </del>the OBJK resource and on the bottom of the <del class="diffchange diffchange-inline">S3PE </del>window, click on Edit OBJK</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* <ins class="diffchange diffchange-inline">Right-click </ins>the OBJK resource and on the bottom of the <ins class="diffchange diffchange-inline">popup </ins>window <ins class="diffchange diffchange-inline">(context menu)</ins>, click on Edit OBJK</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Change the data field in the script row to your class name with full namespace. In case of this tutorial that's <tt>Sims3.Gameplay.Objects.Miscellaneous.KolipokiMod.TalkingTeddy</tt></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Change the data field in the script row to your class name with full namespace. In case of this tutorial that's <tt>Sims3.Gameplay.Objects.Miscellaneous.KolipokiMod.TalkingTeddy</tt></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Click on Save.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Click on Save.</div></td></tr>
</table>Leesesterhttp://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=54934&oldid=prevLeesester: /* Defining Your Own Interaction */2012-02-02T20:49:11Z<p><span dir="auto"><span class="autocomment">Defining Your Own Interaction</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 20:49, 2 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 188:</td>
<td colspan="2" class="diff-lineno">Line 188:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Change the target to your target class everywhere. In this tutorial that's <tt>TalkingTeddy</tt>.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Change the target to your target class everywhere. In this tutorial that's <tt>TalkingTeddy</tt>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* Change all the calls of LocalizeString to hard-coded strings. You shouldn't actually write interactions like that unless they're only for personal use or for stuff that isn't supposed to show up in regular gameplay. Localized coding is a topic for another tutorial, though.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* Change all the calls of LocalizeString to hard-coded strings. You shouldn't actually write interactions like that unless they're only for personal use or for stuff that isn't supposed to show up in regular gameplay. Localized coding is a topic for <ins class="diffchange diffchange-inline">[http://simswiki.info/wiki.php?title=Tutorial:Sims_3_Localized_Coding </ins>another tutorial<ins class="diffchange diffchange-inline">]</ins>, though.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Remove all code except the <tt>return true;</tt> part from <tt>Run()</tt>.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Remove all code except the <tt>return true;</tt> part from <tt>Run()</tt>.</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 221:</td>
<td colspan="2" class="diff-lineno">Line 223:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></pre></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></pre></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>That is the basic frame of our interaction.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>That is the basic frame of our interaction.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===Making the Interaction Do Something===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===Making the Interaction Do Something===</div></td></tr>
</table>Leesesterhttp://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=50499&oldid=prevBuzzler at 13:46, 22 May 20112011-05-22T13:46:00Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 13:46, 22 May 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==What You Need==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==What You Need==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* '''[http://www.microsoft.com/<del class="diffchange diffchange-inline">express</del>/<del class="diffchange diffchange-inline">Windows</del>/ Microsoft Visual C# Express]''' - simply called VS later in this tutorial</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* '''[http://www.microsoft.com/<ins class="diffchange diffchange-inline">visualstudio</ins>/<ins class="diffchange diffchange-inline">en-us</ins>/<ins class="diffchange diffchange-inline">products/2008-editions/express </ins>Microsoft Visual C# Express <ins class="diffchange diffchange-inline">2008</ins>]''' - simply called VS later in this tutorial</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">:(You can try using the 2010 version, but that version seems to be buggy regarding compiling against a different mscorlib.dll.)</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''[http://dino.drealm.info/den/denforum/index.php?board=19.0 Sims3 Package Editor]''' - simply called S3PE later in this tutorial</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''[http://dino.drealm.info/den/denforum/index.php?board=19.0 Sims3 Package Editor]''' - simply called S3PE later in this tutorial</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''[http://dino.drealm.info/den/denforum/index.php?board=20.0 Sims3 Object Cloner]''' - simply called S3OC later in this tutorial</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''[http://dino.drealm.info/den/denforum/index.php?board=20.0 Sims3 Object Cloner]''' - simply called S3OC later in this tutorial</div></td></tr>
</table>Buzzlerhttp://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=49744&oldid=prevBuzzler at 15:32, 12 March 20112011-03-12T15:32:24Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 15:32, 12 March 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 12:</td>
<td colspan="2" class="diff-lineno">Line 12:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''[http://dino.drealm.info/den/denforum/index.php?board=19.0 Sims3 Package Editor]''' - simply called S3PE later in this tutorial</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''[http://dino.drealm.info/den/denforum/index.php?board=19.0 Sims3 Package Editor]''' - simply called S3PE later in this tutorial</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''[http://dino.drealm.info/den/denforum/index.php?board=20.0 Sims3 Object Cloner]''' - simply called S3OC later in this tutorial</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''[http://dino.drealm.info/den/denforum/index.php?board=20.0 Sims3 Object Cloner]''' - simply called S3OC later in this tutorial</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* '''[http://www.<del class="diffchange diffchange-inline">red-gate</del>.<del class="diffchange diffchange-inline">com</del>/<del class="diffchange diffchange-inline">products/reflector/ redgate </del>.NET <del class="diffchange diffchange-inline">Reflector</del>]''' - simply called Reflector later <del class="diffchange diffchange-inline">in this tutorial</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* '''[http://www.<ins class="diffchange diffchange-inline">modthesims</ins>.<ins class="diffchange diffchange-inline">info</ins>/<ins class="diffchange diffchange-inline">showthread.php?t=436481 </ins>.NET <ins class="diffchange diffchange-inline">assembly browser/decompiler</ins>]''' - <ins class="diffchange diffchange-inline">this tutorial refers to redgate .NET Reflector, </ins>simply called Reflector later <ins class="diffchange diffchange-inline">on</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''A basic understanding of the C# syntax or at least any C-like language.'''</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''A basic understanding of the C# syntax or at least any C-like language.'''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''A game that is properly set up to support scripting mods. If you fail to accomplish that, you can’t hope to successfully write object mods.'''</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* '''A game that is properly set up to support scripting mods. If you fail to accomplish that, you can’t hope to successfully write object mods.'''</div></td></tr>
</table>Buzzlerhttp://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=49674&oldid=prevBuzzler at 23:37, 20 February 20112011-02-20T23:37:50Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 23:37, 20 February 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 385:</td>
<td colspan="2" class="diff-lineno">Line 385:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Congratulations==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Congratulations==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>You have now finished your object mod and should have gained a basic understanding of how to make object mods.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>You have now finished your object mod and should have gained a basic understanding of how to make object mods. <ins class="diffchange diffchange-inline">Go get a cookie!</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Video Version==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Video Version==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The original version of this tutorial is available on video and can be found at The Sims Supply: [http://thesimsupply.com/showthread.php?tid=231 Video Tutorial].</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The original version of this tutorial is available on video and can be found at The Sims Supply: [http://thesimsupply.com/showthread.php?tid=231 Video Tutorial].</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">==Questions==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Ask them here: [http://www.modthesims.info/showthread.php?p=3452868 Q&A thread Sims 3 Object Modding]</ins></div></td></tr>
</table>Buzzlerhttp://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=49670&oldid=prevBuzzler at 11:27, 20 February 20112011-02-20T11:27:51Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 11:27, 20 February 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 137:</td>
<td colspan="2" class="diff-lineno">Line 137:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* The interaction is declared as <tt>public sealed</tt>. Public basically means that all other code can "see" the class; sealed means that no sub classes may be derived from it.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* The interaction is declared as <tt>public sealed</tt>. Public basically means that all other code can "see" the class; sealed means that no sub classes may be derived from it.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* The class is derived from <tt>ImmediateInteraction</tt>. ImmediateInteractions are interactions that don't get added to a sim's interaction queue and run immediately no matter and not disturbing what a sim is doing. The <tt><Sim, Easel></tt> declares that the <tt>Actor</tt> of the interaction is a sim and the <tt>Target</tt> is an easel. Also a ImmediateInteraction can usually be recognized by the orange circle on the button <del class="diffchange diffchange-inline">on </del>the pie menu.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* The class is derived from <tt>ImmediateInteraction</tt>. ImmediateInteractions are interactions that don't get added to a sim's interaction queue and run immediately no matter and not disturbing what a sim is doing. The <tt><Sim, Easel></tt> declares that the <tt>Actor</tt> of the interaction is a sim and the <tt>Target</tt> is an easel. Also a ImmediateInteraction can usually be recognized by the orange circle on the button <ins class="diffchange diffchange-inline">in </ins>the pie menu.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 154:</td>
<td colspan="2" class="diff-lineno">Line 154:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* In the game, an actual interaction is something with an actual actor and an actual target, in this case one specific sim and one specific easel. The abstract idea of an interaction that might or might not run at some point in the future, including a prospective sim and a prospective easel, is referenced by an InteractionDefinition.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* In the game, an actual interaction is something with an actual actor and an actual target, in this case one specific sim and one specific easel. The abstract idea of an interaction that might or might not run at some point in the future, including a prospective sim and a prospective easel, is referenced by an InteractionDefinition.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* In this case <tt>Definition</tt> is derived from <tt>ImmediateInteractionDefinition</tt> which is appropriate for an ImmediateInteraction. <tt><Sim, Easel, Easel.ScrapPaintingInteraction></tt> <del class="diffchange diffchange-inline">doesn</del>'t <del class="diffchange diffchange-inline">look </del>much different from the declaration of the Interaction, except that the last part declares it as an InteractionDefinition for a <tt>Easel.ScrapPaintingInteraction</tt>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* In this case <tt>Definition</tt> is derived from <tt>ImmediateInteractionDefinition</tt> which is appropriate for an ImmediateInteraction. <tt><Sim, Easel, Easel.ScrapPaintingInteraction></tt> <ins class="diffchange diffchange-inline">isn</ins>'t much different from the declaration of the Interaction, except that the last part declares it as an InteractionDefinition for a <tt>Easel.ScrapPaintingInteraction</tt>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* The <tt>[DoesntRequireTuning]</tt> attribute tells the game that there's no ITUN resource containing tuning for this interaction, so it doesn't need to bother looking for one. Adding tuning to your interactions goes beyond the scope of this tutorial; just use the attribute whenever you write an interaction without tuning.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* The <tt>[DoesntRequireTuning]</tt> attribute tells the game that there's no ITUN resource containing tuning for this interaction, so it doesn't need to bother looking for one. Adding tuning to your interactions goes beyond the scope of this tutorial; just use the attribute whenever you write an interaction without tuning.</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 168:</td>
<td colspan="2" class="diff-lineno">Line 168:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><pre>protected override string GetInteractionName(Sim a, Easel target, InteractionObjectPair interaction)</pre></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><pre>protected override string GetInteractionName(Sim a, Easel target, InteractionObjectPair interaction)</pre></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* The <tt>GetInteractionName()</tt> method gets used for the string on button in the pie menu and the mouse over text on the interaction's thumbnail in a sim's interaction queue. Of course an ImmediateInteraction doesn't show up in the queue so the latter part is JFYI.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* The <tt>GetInteractionName()</tt> method gets used for the string on <ins class="diffchange diffchange-inline">the interaction </ins>button in the pie menu and the mouse over text on the interaction's thumbnail in a sim's interaction queue. Of course an ImmediateInteraction doesn't show up in the queue so the latter part is JFYI.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 181:</td>
<td colspan="2" class="diff-lineno">Line 181:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===Defining Your Own Interaction===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===Defining Your Own Interaction===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Now that we have a basic idea of how interactions work, we can <del class="diffchange diffchange-inline">go along </del>writing our own interaction. You can simply take the <tt>ScrapPaintingInteraction</tt> and change it to your liking for now.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Now that we have a basic idea of how interactions work, we can <ins class="diffchange diffchange-inline">commence </ins>writing our own interaction. You can simply take the <tt>ScrapPaintingInteraction</tt> and change it to your liking for now.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Change the interaction name to mirror its purpose. Don't forget to change it in the <tt>Definition</tt> as well, because that will define what interaction the InteractionDefinition will instantiate in the game. Seriously: If your InteractionDefinition points to the wrong interaction, your interaction will malfunction in a probably very obscure way. Yours truly spent more time than he'd care to admit being flabbergasted, because he simply forgot to change the declaration of the InteractionDefinition after he copy-pasted something.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Change the interaction name to mirror its purpose. Don't forget to change it in the <tt>Definition</tt> as well, because that will define what interaction the InteractionDefinition will instantiate in the game. Seriously: If your InteractionDefinition points to the wrong interaction, your interaction will malfunction in a probably very obscure way. Yours truly spent more time than he'd care to admit being flabbergasted, because he simply forgot to change the declaration of the InteractionDefinition after he copy-pasted something.</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 239:</td>
<td colspan="2" class="diff-lineno">Line 239:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>We now have a complete interaction. So are we finished? Yeah, well, probably not. I mean there's a new header and all and this section has hardly begun.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>We now have a complete interaction. So are we finished? Yeah, well, probably not. I mean there's a new header and all and this section has hardly begun.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>All classes derived from <tt>GameObject</tt> have a method called <tt>OnStartup()</tt> that will be called after instantiating the object for the first time and then every time <del class="diffchange diffchange-inline">after </del>a <del class="diffchange diffchange-inline">savegame </del>has been loaded. This is the place to add the interaction to your object.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>All classes derived from <tt>GameObject</tt> have a method called <tt>OnStartup()</tt> that will be called after instantiating the object for the first time and then every time a <ins class="diffchange diffchange-inline">world </ins>has been loaded. This is the place to add the interaction to your object.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>In the code of your object, but outside of the interaction code!, simply write <tt>override</tt> in VS. VS will pop up a list of members that can be overridden. Navigate to <tt>OnStartup</tt>, press Enter and VS will quite conveniently implement the whole method for you. Add <pre>base.AddInteraction({YourInteractionName}.Singleton);</pre> to it. Instead of {YourInteractionName} you write your actual interaction's class name. Your <tt>OnStartup()</tt> method should then look similar to this:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>In the code of your object, but outside of the interaction code!, simply write <tt>override</tt> in VS. VS will pop up a list of members that can be overridden. Navigate to <tt>OnStartup</tt>, press Enter and VS will quite conveniently implement the whole method for you. Add <pre>base.AddInteraction({YourInteractionName}.Singleton);</pre> to it. Instead of {YourInteractionName} you write your actual interaction's class name. Your <tt>OnStartup()</tt> method should then look similar to this:</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 312:</td>
<td colspan="2" class="diff-lineno">Line 312:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Adding The Script To The Package==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Adding The Script To The Package==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Now to add the script to the package, we'll need to add an S3SA resource to the package to contain the script. Before we do that, we'll have to create a unique instance value for the resource. Remember: <del class="diffchange diffchange-inline">Instance </del>values need to be unique.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Now to add the script to the package, we'll need to add an S3SA resource to the package to contain the script. Before we do that, we'll have to create a unique instance value for the resource. Remember: <ins class="diffchange diffchange-inline">Unless you want to deliberately override an existing instance, instance </ins>values <ins class="diffchange diffchange-inline">ALWAYS </ins>need to be unique.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Open your package in S3PE if you closed it in the meantime.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Open your package in S3PE if you closed it in the meantime.</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 351:</td>
<td colspan="2" class="diff-lineno">Line 351:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>S3PE will now show the S3SA resource and a _KEY resource. You can just ignore the latter one.  </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>S3PE will now show the S3SA resource and a _KEY resource. You can just ignore the latter one.  </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 359:</td>
<td colspan="2" class="diff-lineno">Line 357:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Navigate to the .dll file VS created. It will be in Documents\Visual Studio xxxx\Projects\{YourProjectName}\{YourProjectName}\bin\Release.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Navigate to the .dll file VS created. It will be in Documents\Visual Studio xxxx\Projects\{YourProjectName}\{YourProjectName}\bin\Release.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Select the file; click on the Open button and click on Yes once being prompted to Commit Changes.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Select the file; click on the Open button and click on Yes once being prompted to Commit Changes.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[Image:OMT_OBJK_ChangeScriptClass.jpg|right|thumb|300px]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">* Select the OBJK resource and on the bottom of the S3PE window, click on Edit OBJK</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">* Change the data field in the script row to your class name with full namespace. In case of this tutorial that's <tt>Sims3.Gameplay.Objects.Miscellaneous.KolipokiMod.TalkingTeddy</tt></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">* Click on Save.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 366:</td>
<td colspan="2" class="diff-lineno">Line 385:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Congratulations==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Congratulations==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>You have now finished your object and should have <del class="diffchange diffchange-inline">an </del>understanding of how to make <del class="diffchange diffchange-inline">an </del>object <del class="diffchange diffchange-inline">mod</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>You have now finished your object <ins class="diffchange diffchange-inline">mod </ins>and should have <ins class="diffchange diffchange-inline">gained a basic </ins>understanding of how to make object <ins class="diffchange diffchange-inline">mods</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Video Version==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Video Version==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The original version of this tutorial is available on video and can be found at The Sims Supply: [http://thesimsupply.com/showthread.php?tid=231 Video Tutorial].</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The original version of this tutorial is available on video and can be found at The Sims Supply: [http://thesimsupply.com/showthread.php?tid=231 Video Tutorial].</div></td></tr>
</table>Buzzlerhttp://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=49668&oldid=prevBuzzler: /* Starting Your Code */2011-02-19T15:45:52Z<p><span dir="auto"><span class="autocomment">Starting Your Code</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 15:45, 19 February 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 56:</td>
<td colspan="2" class="diff-lineno">Line 56:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Your Custom Script==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Your Custom Script==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===Starting Your Code===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===Starting Your Code===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>We are going to start off by changing the namespace and the class. The namespace is like the address of a class. You can have two classes having the same name as long as they're located in <del class="diffchange diffchange-inline">diffeent </del>namespaces. To make sure that your classes never clash with an EAxian class or with another modder's class, you need to make your namespace unique to you. Don't use an EAxian namespace or another modder's namespace! Ever.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>We are going to start off by changing the namespace and the class. The namespace is like the address of a class. You can have two classes having the same name as long as they're located in <ins class="diffchange diffchange-inline">different </ins>namespaces. To make sure that your classes never clash with an EAxian class or with another modder's class, you need to make your namespace unique to you. Don't use an EAxian namespace or another modder's namespace! Ever.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>In case of object mods, you'll always need to put an object's class in a namespace that begins with <tt>Sims3.Gameplay.Objects</tt>. If you don't do that, the object will cause the game to crash when you try to buy it in the catalog. The example namespace in this tutorial is:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>In case of object mods, you'll always need to put an object's class in a namespace that begins with <tt>Sims3.Gameplay.Objects</tt>. If you don't do that, the object will cause the game to crash when you try to buy it in the catalog. The example namespace in this tutorial is:</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 84:</td>
<td colspan="2" class="diff-lineno">Line 84:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>using Sims3.UI;</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>using Sims3.UI;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></pre></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></pre></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===What's An Interaction?===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===What's An Interaction?===</div></td></tr>
</table>Buzzlerhttp://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=49667&oldid=prevBuzzler at 15:40, 19 February 20112011-02-19T15:40:10Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 15:40, 19 February 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 307:</td>
<td colspan="2" class="diff-lineno">Line 307:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Save your project (again) and click on Build -> Build Solution. This will compile your code into a library IF there are no errors. If there are errors, check your code and compare it to the code shown in this tutorial. You will find the compiled library in Documents\Visual Studio xxxx\Projects\{YourProjectName}\{YourProjectName}\bin\Release. That file <del class="diffchange diffchange-inline">will </del>is the script we need to add to our package. Whenever you change the code, don't forget to click on Build -> Build Solution again to make VS compile an updated library for you.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Save your project (again) and click on Build -> Build Solution. This will compile your code into a library IF there are no errors. If there are errors, check your code and compare it to the code shown in this tutorial. You will find the compiled library in Documents\Visual Studio xxxx\Projects\{YourProjectName}\{YourProjectName}\bin\Release. That file is the script we need to add to our package. Whenever you change the code, don't forget to click on Build -> Build Solution again to make VS compile an updated library for you.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
</table>Buzzlerhttp://simswiki.info/index.php?title=Tutorial:Sims_3_Object_Modding&diff=49666&oldid=prevBuzzler at 15:37, 19 February 20112011-02-19T15:37:16Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 15:37, 19 February 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 226:</td>
<td colspan="2" class="diff-lineno">Line 226:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>With the right code, interactions could do anything. They could start a fire to a whole lot like in the ChaosMagePainting. They could lock doors such as in the Lockable door.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>With the right code, interactions could do anything. They could start a fire to a whole lot like in the ChaosMagePainting. They could lock doors such as in the Lockable door.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>In this tutorial we will simply make the game show <del class="diffchange diffchange-inline">an </del>notification saying "Hello!" with the thumbnail of the active sim. The game already has a method that will do that for us:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>In this tutorial we will simply make the game show <ins class="diffchange diffchange-inline">a </ins>notification saying "Hello!" with the thumbnail of the active sim. The game already has a method that will do that for us:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><pre>Sims3.Gameplay.Actors.Sim.ShowTNSIfSelectable(string, StyledNotification.NotificationStyle)</pre></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><pre>Sims3.Gameplay.Actors.Sim.ShowTNSIfSelectable(string, StyledNotification.NotificationStyle)</pre></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
</table>Buzzler