PDA

View Full Version : Mini-tutorial: Adding a custom queue icon to your self-interactions.


maybesomethingdunno
3rd Jun 2011, 7:37 AM
:here: Note 1: This mini-tutorial is somewhat a work-in-progress. I wanted to get this tidbit of information out here before I forget anything. (I haven't seen anything on this site about this.) I intend to make a proper self-interaction tutorial when I can. No promises on when though.

:here: Note 2: This mini-tutorial is not a beginner's tutorial. It assumes some familiarity with SimPE and is intended to show how to update an existing self-interaction. It does not show how to create your own self-interactions. If you are looking to start working with BHAVs, I strongly suggest you start with Echo's Tutorial: Making Your First Custom BHAV (http://www.modthesims.info/showthread.php?t=142907).

:here: Note 3: Is there a better or different way than this? Perhaps. I'm just showing how I did it.

Background: A self-interaction is an interaction that is invoked by clicking on the Active Sim, such as "Do Yoga." You will notice that the icon for the action is the Sim's portrait. However, by no means are we necessarily confined to this.

Now, you may be wondering why would I want to change that? Naturally, the answer is going to vary. You might want something more illustrative of your action, such as the microphone graphic for Free-styling. In my case, I wanted to change it because of what may be a bug or simply the downside to some well-meaning EA code. In particular, a goof associated with self-interactions that offer skilling. The problem is when Sims 100% the skill and get a memory of it. When you click on the memory to show its full text, you will see a blank icon for the object with which they have used to achieve this milestone. If it was a treadmill, you'd see a treadmill. But since the self-interaction is an off-world object with no mesh, it doesn't really have an object thumbnail. I have seen this with custom skilling self-interactions and even with Free Time's jogging interaction.

Now, you might be able to go through the process of creating a mesh or a custom thumbnail like you would for normal object. I haven't tried this, but I honestly think creating your own thumbnail/icon to be a much easier and quicker way. Besides, actions such as jogging are perhaps a bit too abstract and better illustrated with an icon. (No need to mesh a foot or athletic shoe to render a thumbnail for jogging when an icon could work just as well as at conveying "jogging." ;) ) This custom icon will show up in the Sim's queue when the action is performed and will automatically show up as the object thumbnail in the expanded 100% Skill complete memory when the Sim maximizes a skill using the self-interaction.



Creating the Icon:
From what I've seen, the icons are 40 pixels by 40 pixels. So let's create a .png of that size. What your icon looks like is up to you and transparency is acceptable.

Importing the Icon:

Open the self-interaction.
Right click in the Resource List and select "Add."
In the file browsing dialogue select "All Files (*.*)" for the type of files you're looking for. Find your icon and select "Open."
At the top of your Resource Tree, you will now see an item called "--- User Defined --- (---) (1)" . Select that and you will see a similarly named item in the Resource List. Select the "--- User Defined ---" item in the Resource List.
Select the "Resource" view.
We need to tell SimPE what we've added. In the drop-down box next to the Type, select "jpg/tga/png". SimPE will update the Resource Tree to reflect this change. In the Group text box, change "0x00000000" to "0xFFFFFFFF" and click "commit".
Take note of the value in the Instance text box. We're about to use it. If you have multiple graphics/icons here, make sure that each Instance number is unique.
If you select the "Plugin View" tab, you should be able to see your icon in the Picture Viewer in the Plugin View.



Applying the Icon:
Self-interactions push the interaction onto the Sim's queue. The key is in this pushing. (So, yes, this technique could work anytime the 0x000D primitive is used...but for now, we're focusing on self-interactions.)


Find the node(s) in the CT - Object Menu Command BHAV or whichever BHAV invokes the 0x000D primitive. (In my case, I used a Push Interaction node I had placed elsewhere in my interaction.)
Unfortunately, there is no wizard for the 0x000D primitive. But you can play with the operand values or refer to the entry from the wiki (http://www.modthesims.info/wiki.php?title=0x000D) for more information. The Target should be your Sim (Stack Object). The Object should be a Local variable with the object ID of the self-interaction. The Interaction should be whatever Param is passed to the CT - Object Menu Command BHAV or whatever literal value corresponds to the number of the intended interaction as found in the Pie Menu Functions. The Icon Object will be the Local representing the self-interaction again. (Research Question: What about storing another object's object ID in another Local and pointing the self-interaction to its icon?) The Icon index will be the literal value which corresponds to the instance number of your imported icon (e.g. Literal 0x0001 for an Instance number of 0x00000001).
Commit your BHAV change and save the package file.


That's it. When the Push Interaction node pushes the interaction, it should use your icon as the action's icon. Below is my icon and a picture of my surfing self-interaction with the custom icon in the Active Sim's queue. It also shows up as the object in the expanded text for the 100% skill completion memory.
http://img339.imageshack.us/img339/4721/wavee.png
http://img827.imageshack.us/img827/5686/finishedicon.jpg