Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Virtual gardener
staff: administrator
Original Poster
#1 Old 22nd Jun 2016 at 7:30 PM
Default How do you add custom poses and/or different facial expressions for custom Magic gnome?
Hi guys!

Yes those annoying, but somewhat funny magic gnomes! I cloned a magic gnome for reference in S3OC, even a deep clone, but it didn't show me anything like a 'clip' file or something animated related. Am I suppose to look into these FullBuild/deltabuild to find those or are they packed differently?

Also, I actually want it to be able to switch facial expressions, but i'm not so sure how i'm suppose to do that. Here is the project I want to change into a magic gnome: http://greenplumbboblover.tumblr.co...ecret-valentine
Advertisement
Virtual gardener
staff: administrator
Original Poster
#2 Old 22nd Jun 2016 at 8:37 PM
*UPDATE

So I came across these files that didn't come with the cloned version:







But from my knowledge, these are light datas and these placement viewable areas. (Footies?) So these can't be the actual file where the magic gnome would change position. Or does these gnomes work with geostates?
Inventor
#3 Old 22nd Jun 2016 at 8:44 PM
When they change pose, they swap model (VPXY).
See the xml of a specific gnome for a list of models for each pose category (e.g. divergnome in GameplayData.package)
Virtual gardener
staff: administrator
Original Poster
#4 Old 22nd Jun 2016 at 9:33 PM
VPXY files are very new to me. The one S3OC cloned is a 'standing' gnome though. So I suppose I need to extract all the other VXPY files for this new gnome. I do see what they do to the script, like the pose names so that seems to help a bit.
But now there is a next issue, can I extract these VXPY and put them in my own cloned project so I can recall them, edit the script with the names, and how do I add new meshes to the VXPY files?Is it also possible to somehow make the VXPY linked to a texture so it can switch expressions like I want to?

EDIT: Also, S3OC didn't clone the XML file with it, and I'm unable to find it in the Fullbuild/deltabuild packages.
Inventor
#5 Old 23rd Jun 2016 at 6:09 AM Last edited by Arsil : 23rd Jun 2016 at 6:41 AM.
You are going to need a custom script for your gnome, in order to use a custom xml for its tuning.
Tuning xml resources (they are in GameplayData.package) are not cloned by S3OC (because they
are not referenced by any resource, they just have an InstanceId which is generated hashing the
fullclassname of the related class).

The VPXY is the resource which contains all references to meshes, LITE, _RIG, RSLT, FTPT and sometimes
a few other resources. The VPXY itself is referenced by the OBJK and of course only one (the default pose)
can be referenced.

You can clone (with renumbering and making sure to use a different random seed every time) the same gnome
a number of times equal to the poses you need (then you have to delete all the extra OBJD and OBJK, keeping
only a couple that will reference the default pose).

You have to check what kind of hashing is used to reference the model (the usual FNV64 or another one)
and then change the InstanceID of your VPXY resources (even the default one, so you'll have to
update the OBJK too) to match the unique names you'll use in the xml (the names in the xml have to be
the hashing keys to generate the IIDs).

To change facial expression with a texture, the first solution that comes to my mind is to use an overlay
texture. The problem is that textures are usually referenced by a complate (a preset, if you prefer),
so it would affect all the poses (because the presets are defined in the OBJD, unless they can also
be defined in the TXTC resources but I don't know mych about them). Usually a mesh who directly
references its texture(s) is the mesh of a non complatable (CASTable, if you prefer) object.

If you only want to change the facial expression of the custom gnome and you are not interested
in changing its pose, you could use material states. Instead of swapping the model, you only swap
the texture used. At that point, maybe you don't even need to use the gnomish code, but you'll still
need a script to take care of the swapping.
Virtual gardener
staff: administrator
Original Poster
#6 Old 23rd Jun 2016 at 3:01 PM
Thanks for the explanation! I came across this second window where you can add whatever file you want in the package file inside the VXPY. The resource window in S3PE. Now I do know a bit about the TXTC files since I mesh a lot of clothing, and if not, converting other clothing. So these files won't be much of a problem to use. But seems like I need to go much deeper than a simple mesh edit. I'll tell you how it turns out. ^-^
Virtual gardener
staff: administrator
Original Poster
#7 Old 23rd Jun 2016 at 4:19 PM Last edited by Greenplumbbob : 23rd Jun 2016 at 4:33 PM.
Small question when it comes to script editing (as I want to make the gnome a bit more cat-alike) As I was following this tutorial: http://www.simlogical.com/ContentUp..._Tuning_Mod.pdf
I was wondering if the value of 1.4 is actually the highest setting. Like say I want to chance the value to like 90% likely to happen, am I suppose to use like 1.3 or something? Or do these values go to 10.0 as in 100% chance? Like say the script says that the value is '0.6' does this mean it's a 60% chance? I understand the scripts I just never edited one. >-<
Inventor
#8 Old 23rd Jun 2016 at 6:21 PM Last edited by Arsil : 23rd Jun 2016 at 6:40 PM.
I did the script and the xml resource for you. I've used the MagicGnomeCat from Pets as base,
but I've removed the autospawning stuff and everything else related to cats.

Sims3.Gameplay.Objects.Environment.PusheenTheCat is the script name you have to put in the OBJK

The names you see in the xml for the poses (a comma separated list for each pose category)
are the hashing keys for the InstanceId of the VPXY resource.
Note: it doesn't use the classic FNV64 hashing but the FNV24 hashing, so to translate the string
that represent the name of the pose to an InstanceId you have to use, for example, douglasveiga's
tool (see http://modthesims.info/showthread.p...20#post4599020).

Example: MagicGnome --> 0x0000000000AAD39C
Note: I made your custom gnome BG compatible, but just for information, if you have to translate
a key to an InstanceId related to an EP, you have to use the EP related hex code as part of the IID
Example: MagicGnomePetCatSitting --> 0x0000000048CFF20E (48 being the Pets EP code)

EDIT
So, what you have to do is to modify the names of the poses in the xml, make them unique, something
like PusheenTheCatSitting, PusheenTheCatHappy, PusheenTheCatSad, etc
You can leave some of the categories empty ("") if you don't want to make too many poses.

Once you have decided, use these names has FNV24 hashing keys to generate the IID for the VPXY
resource of the related "pose". If you don't know how to correctly modify it, check the tutorial about the
custom plants/ingredients to see how to change both the "external" and the "internal" IID
(in VPXY resources it is in the ChunkEntry[0]). I don't thing it is necessary to also change the IID
of the meshes (MODL and MLOD(s) in this case, just the VPXY should be fine.
Attached files:
File Type: zip  PusheenTheCatMagicGnome.package.zip (2.7 KB, 4 downloads) - View custom content
Virtual gardener
staff: administrator
Original Poster
#9 Old 23rd Jun 2016 at 7:12 PM
Thank you so much! Fun fact, I was using that same script as reference but it seems I accidentally deleted one part that I shouldn't have as I looked at your script. (which were the part of the scripts you deleted, which I wanted to get rid of too! So thanks for that ^-^). I'll be adding some additional desires that some gnomes have too.

Also, one question. I saw some gnomes share more 'using' parts which this one only has the 'using Sims3.SimIFace;' one but other gnomes seem to use more of these. So say I would take some of the tunable comment from 'magicgnomefrance' do I also need to copy some of the usings? For example, say I want to copy the tunable comment. For example this one:

[Tunable, TunableComment("OBJECT DESIREABILITY: score multiplier for Fridge objects.")]
private static float kDesireForFridge = 1.5f;

(I know I need to adjust it with the XML file too just a script question) Do I need to add the using:

using Sims3.Gameplay.Objects.Appliances;
using Sims3.Gameplay.Objects.CookingObjects;

To the custom script? or can I just leave it as it is? (just before I make other people's game crash)
Inventor
#10 Old 23rd Jun 2016 at 7:43 PM
Those "using" statements serve the purpose of creating shortcuts so you don't have
to write the full name of a class every time.

I don't know how to say this, but you can't just add random things hoping it will work.
That kDesireForFridge is probably related to some code that makes the gnome more likely
to be placed near a fridge. Just focus on the already hard multi meshing part and see if it
works, then you can try to add more stuff.
Virtual gardener
staff: administrator
Original Poster
#11 Old 23rd Jun 2016 at 7:56 PM
Allright! I will test it with the script you used. But to make things clear, so what I'm suppose to do is:

Generate the names with that tool (Must say i'm impressed how helpful this tool is! Thanks for showing it to me ^-^)
Making the models (MLODs and MODLs for each pose?) And add those to the VXPY files,
Edit the KEY file.

And with the custom food creating tutorial, I guess you meant this one?: http://modthesims.info/showthread.php?t=474083
Or the same page of where the tool can be downloaded? (http://modthesims.info/showthread.p...020#post4599020)
Inventor
#12 Old 23rd Jun 2016 at 9:09 PM Last edited by Arsil : 23rd Jun 2016 at 9:24 PM.
Forget the tutorial. Here's what I'd do:

- clone twice an existing BG gnome creating 2 new packages, let's call them PusheenHappy.package and PusheenSad.package
- choose 2 names to put in the tuning xml of the gnome (e.g. PusheenTheCatHappy in one pose category and PusheenTheCatSad in another one, leave all the other categories empty: "")
- generate the 2 related IIDs using FNV24 hashing (douglasveiga's tool)
- change the IID of the VPXY resource in PusheenHappy.package using the IID generated with the key PusheenTheCatHappy
- double click on the VPXY resource and set the new Instance ID
- (not sure if strictly needed) use Grid to change the "internal" IID of the resource (ChunkEntry[0])
- update the OBJK to point to the new IID of the VPXY (and make sure it is using Sims3.Gameplay.Objects.Environment.PusheenTheCat as script name)
- right click on the OBJK and select "Edit OBJK"
- click on the button "TGI Blocks" on the bottom left
- put the new Instance ID in the "Instance" field
- change the IID of the VPXY resource in PusheenSad.package using the IID generated with the key PusheenTheCatSad
- update the OBJK to point to the new IID of the VPXY (well, this is not really needed, because when the work is done this will be deleted along with the OBJD in this package)
- test in game (you can use a debug interaction to force the gnome to change pose)
- once you verified that it works with 2 "poses", you can add new ones or start remeshing them
Inventor
#13 Old 23rd Jun 2016 at 9:29 PM
Ok, I'm an idiot. If the meshes are identical you won't see any difference when the gnome change the pose,
so, I don't know, do something to be able to notice the difference.
Virtual gardener
staff: administrator
Original Poster
#14 Old 23rd Jun 2016 at 9:54 PM
Quick question, am I suppose to add these both packages in game or can I simply merge them? If so, can I also try adding different diffuses to it? Else I will update my MLOD/MODL resources and link a overlay texture to it.
Virtual gardener
staff: administrator
Original Poster
#15 Old 23rd Jun 2016 at 10:04 PM
Quote: Originally posted by Arsil
Ok, I'm an idiot. If the meshes are identical you won't see any difference when the gnome change the pose,
so, I don't know, do something to be able to notice the difference.


Oh no that's allright! I was thinking of changing the mesh so like a happy Pusheen you would have Pusheen's head tilt a but up, and it's tail up. (which is down in a default pose) So it would work. I'm going a bit deeper into the overlay trick since this same trick is used on the Vampire gnome (the colour of the eyes changes with an additive texture, but with the same trick, the overlay one should work the same) So I'll try applying that with the 'happy' pose.

I had some trouble changing the VXPY because it refused me, changing the MLOD Instance but I got that figured out.
Virtual gardener
staff: administrator
Original Poster
#16 Old 24th Jun 2016 at 12:15 AM
Allright! I tested it in game, but they appear in 2. I guess that's because they don't replace themselves. Was I suppose to give them the same names in the OBJD tag? Also, one seem to be invisble and the other one does shows up.

But! We're close! After I used NRaas's 'Change pose' option, the textures switched. But now the next problem, the game doesn't read the sunshadows and the High LOD anymore. I changed the Instance inside the MLODs and the MODLs. Could that be the case?
Anyways, The script is working perfectly and here have a peek:





So it is possible to have an identical mesh with a different texture with your explanation. You just have to assign the texture to the mesh ^-^
Inventor
#17 Old 24th Jun 2016 at 7:48 AM Last edited by Arsil : 24th Jun 2016 at 8:08 AM.
First of all, good job ^^

For the texture, maybe you can also use a stencil, I guess it is very similar to an overlay texture,
but I admit I don't know much about these things, I'm sure you know better than me.
Are gnomes not CASTables? If so, then they probably already have the "link" to the texture resource
in their mesh, so it will be very easy to change the facial expression since every mesh
use a different texture and not a common one like objects with presets.
But it seems you already solved this, so why I keep talking about it?

You didn't have to change the IIDs of the meshes. That complicated things.
If you did, now you have to update the references to the MODL and MLOD in the VPXY.
And also the reference to the MLOD(s) in the MODL.
So, if I'm guessing correctly, the shadows and the HighDef mesh don't work because the MODL
references the old IID(s) of the MLOD(s).
To fix it, you have to Grid the MODL and edit the TGI (TypeGroupInstance) in the ChunkEntry[1]
(always check the preview of the resource for confirmation before doing anything to make sure
that you are editing the right thing).
You also have to use Grid again on the MODL, select the "Resources" row and click on the "..."
on the right. You can update the references of the MLODs from there.

As for having 2 objects in the catalog, that's normal.
At the end you will delete the extra OBJDs and OBJKs related to the not default pose
or simply hide them in the catalog:
- select the OBJD and use Grid
- click on the plus (+) sign in "Common Block"
- click on the plus (+) sign in "BuildBuyProductStatusFlags" and put false to ShowInCatalog

I suggest you to not delete them, because you may want to edit/clone them in the future.
So you better update the reference to the VPXY(s) also in the extra OBJK(s).
Until you are done, I suggest you to keep the different "poses" in different packages so
they are easier to manage and edit, only at the end you can put everything in one package
(but even then, keep the original separate packages as backup). GL.
Virtual gardener
staff: administrator
Original Poster
#18 Old 24th Jun 2016 at 1:06 PM
Quote: Originally posted by Arsil
You didn't have to change the IIDs of the meshes. That complicated things.
If you did, now you have to update the references to the MODL and MLOD in the VPXY.
And also the reference to the MLOD(s) in the MODL.
So, if I'm guessing correctly, the shadows and the HighDef mesh don't work because the MODL
references the old IID(s) of the MLOD(s).
To fix it, you have to Grid the MODL and edit the TGI (TypeGroupInstance) in the ChunkEntry[1]
(always check the preview of the resource for confirmation before doing anything to make sure
that you are editing the right thing).
You also have to use Grid again on the MODL, select the "Resources" row and click on the "..."
on the right. You can update the references of the MLODs from there.


Thats the weird thing here, I updated the Instances with that little tool, edited the recourses in all MLOD and MODL but it just only show the MLOD and not the sunshadows. I updated all the instances and they're all the same. Can that be the case? I also updated them with the VXPY Or... wait. The VXPY only asks for the MODL, should I add the highLOD to it too? In the VXPY I mean?
Inventor
#19 Old 24th Jun 2016 at 1:28 PM
The VXPY only asks for the MODL, should I add the highLOD to it too? In the VXPY I mean?

No, if it isn't already there, there's no reason to add it (unless the original object was bugged, but I doubt so).
Virtual gardener
staff: administrator
Original Poster
#20 Old 25th Jun 2016 at 11:52 AM
Seems that I was too focused on editing the Images instances in the MLOD/MODL files, I didn't change the Actual file instances for the MLODs within the MODL files, which is probably why it only loaded the MODL since that's the Low detail of Level. So'll edit that and see if it works out, which I think it will.
Virtual gardener
staff: administrator
Original Poster
#21 Old 26th Jun 2016 at 1:10 PM
I was wondering about one thing. The original pusheen the cat was made with TSRW, but TSRW's way of packing the package isn't the same as regular ones. (which are way more organised in my opinion, I mean the way regular packages are packed) But I was wondering if I somehow could try using TSRW and then replace certain needed things of course. Since right now, if I would add a texture to it, or a mask, the mesh turns all grey. Unless there is a specific order I need to set it to make the mask, the actual texture, the overlay not to grey out all the time in the recourse part of the MLod/modl. (the instances within the MLOD/MODLs are the same but I guess it might be the fact that the textures might not be in the same order).

Unless I should add the orginal TXTC file and change it's instance, add it to the VXPY (Since some packages do add them to the VXPY but some not) Unless they are suppose to be linked with the MLODS/MODL.
Back to top