MTS has all free content, all the time. Find out how YOU can help to keep it running. Tell me how...

[TESTING] Custom Traits Manager

by Arsil Posted 15th Apr 2017 at 10:38 PM - Updated 13th May 2017 at 8:36 AM by Arsil : Description's Review
16 Comments / replies (Who?) - 3 Feedback Posts, 12 Thanks Posts
16th April 2017 Update: just a minor cosmetic fix to the report system

DISCLAIMER WARNING README

This mod has savegame-screwing potential, use at your own risk.
The problem is the usual one related to custom traits and skills: if you uninstall the mod
(and in this case could be the Manager itself or a third party mod using the Manager)
that adds them to the game, then you may not be able to keep playing the savegame where
the traits or skills have been "used" because it can gets corrupted (unplayable).

I RECOMMEND TRYING THIS ON A NEW, DISPOSABLE GAME, NOT ON ONE YOU CARE ABOUT.

I feel like I should specify something to clear the air from any misunderstandings:
if a savegame gets corrupted as a result of removing a custom trait (or skill), then
simply don't save it, but instead completely quit from the game, put the mod(s) back,
restart the game, reload that savegame, try to uninstall it again using the suggested
steps (see the Final Notes below), save, quit and restart again to see how did it go.

The problem is that noticing the corruption may not be that easy or immediate.
And things get more complicated if - inside that same savegame - you visited
other worlds (University, Vacations, Future and maybe also regular ones).


Mod Info
Developed and tested on game version 1.67.

Mod Description
As a concept, this is similar to NRaas Careers and CCLoader.
It will help third party creators to make custom traits for the game.

Now, I want you to focus and read this carefully: this is not a magic mod, the traits created
will have very limited functionality, i.e. act as filters for specified game interactions.
Coded interactions, not the social ones defined only by xml data. What does that mean?
As you could do with an ITUN (Interaction TUNing) mod, you can specify a trait required
to use the interaction or a trait that's banned from using it. Why not use directly an ITUN
mod then? Because the parser of the ITUN resources only "recognizes" official traits
(this is a simplified and shortened explanation, but AFAIK it's the fundamental reason).

Another thing you should know is that this is not a user friendly mod. Well, it is for final
users, I meant that it's not easy to create a custom trait, but I'll try to show how to do it.









Yawn.
I'm sorry but it's late and I'm falling asleep.
Zzzz...
[Several hours later]
CTM, the mod with a cliffhanger.
Hahaha... haha... ha...
* notices icy stares from cross armed Simmers.
Shall we get back to the tutorial?





Note to self: next time you decide to write a tutorial, think again, this is effing exhausting.





This is getting way too long, so for more information check the example trait and
read the comments on the xml (UNKN resource).
There you can learn how to make good, neutral and bad traits.
How to make traits conflict (good vs evil, neat vs slob, etc).
Don't ask me what the other tags mean, if I haven't put comments on them in that
document it means that I don't know.

But I still have to explain how to make the custom trait a little more than useless.
Sigh.



Final notes
Depending on what kind of trait you make, the trait may be assigned randomly to newly
created Sims or age transitioning Sims. Keep that in mind knowing the difficulties
with uninstalling the mod (the whole mod or a single custom trait).

I guess something like a uninstall console command might be useful in assisting
in safely uninstalling mods like this, to automatically remove traits/skills and interrupt
interactions using a custom CommodityKind.

My best advice to uninstall mods like these is written in the Uninstallation paragraph
at the bottom of the description of my Programming Skill mod.

Useful references
_XML Traits resource in GameplayData (contains the xml definition of existing traits)
All ITUN resources in GameplayData (to copy the interaction and object name to define filters)
Code: TraitManager.ParseTraitData function (the parser of the traits data)
SimsMx's Hypochondriasis mod : might not work well with 1.67 or even earlier versions (custom trait, custom motive-type CommodityKind, and much more)
My Japanese Culture Trait mod (custom trait, custom motive-type CommodityKind)
My Programming Skill mod (for custom skill-type CommodityKind)

Additional Credits
All respective authors and contributors of the tools and tutorials for modding TS3.
MTS and all modders who made the game much more enjoyable.
SimsMx for his/her inspiring code.

Type: Other

You must have the expansion, game version or stuff packs listed below installed to use this custom content. Please see the post text for any exceptions.

Sims 3
Built with Game Version: 1.67
Key: - File was updated after upload was posted
Filename - Tip: You can click the magnifying glass to see the archive contents Size Downloads Date
Arsil_CustomTraitsManager.package.zip

Size: 8.3 KB · Downloads: 4,375 · 16th Apr 2017
8.3 KB 4,375 16th Apr 2017
Don't forget to Thank the creator after downloading! Use the Thanks button located above the screenshots above.
Basic Download and Install Instructions:

See: Game Help:TS3 CC Basicswiki for a full guide!
 
16 Comments / Replies (Who?) - 2 Feedback Posts, 12 Thanks Posts
Hide Thanks Posts for this thread (Show only feedback)
Inventor
Original Poster
#2 Old 15th Apr 2017 at 10:38 PM Last edited by Arsil : 16th Apr 2017 at 4:29 PM. Reason: Added new attachment and re-uploaded the example
Here's a trait to use as reference (the xml resource is heavily commented... it's actually an UNKN resource though).

It has no gameplay value, it's just an example (and "requires" my Napping Mat mod, otherwise you'll get a warning,
actually it will make the mat unusable by Sims who don't have the trait, so it's just bad)

DON'T SCREW YOUR SAVEGAMES ! Read the description of the mod.

EDIT: I've added empty thumbnail icons to use as bases. (Re-uploaded with light blue background for the big icon)
Re-uploaded the example trait (I had forgot to include the STBL resources for most languages)

EDIT: Uploaded a "skeleton" package to use as starting point. It should shorten a bit the steps needed.
Remember to rename (and re-hash using the new names) all resources using unique names.
Download - please read all instructions before downloading any files!
File Type: zip Arsil_CustomTraitExample.package.zip (9.5 KB, 138 downloads)
File Type: zip VanillaThumbnails.zip (5.3 KB, 98 downloads)
File Type: zip CTM_SkeletonToUseAsStartingPoint.package.zip (6.4 KB, 114 downloads)
Test Subject
THANKS POST
#3 Old 16th Apr 2017 at 4:12 AM
You are a real genius!!! Now sims have personality!
Would you like to create some custom moodlets like unrequited love, jealous , missing someone etc or even a custom moodlet manager like this? In Sim3 sims always have the equal relationship which is often isn't in real life. Adding these moodlets may be helpful.
I do not know any programming at all... anyway, I will try my best to study your tutorial. Thank you for all your masterpieces!
Field Researcher
#4 Old 16th Apr 2017 at 4:38 AM Last edited by csg5vbe3argf : 16th Apr 2017 at 4:57 AM.
Great mod!

So, about how to create custom trait.

Is that all I got to do to make working trait?

How do I make custom trait so that it shows up in the "regular Create a Household trait" just like your Japanese Culture Traits?

Cause I see it shows up without this mod.

I just want to create custom trait by myself.
Instructor
THANKS POST
#5 Old 16th Apr 2017 at 8:04 AM
Amazing!
I'm not going to touch this - it scars me! But, AMAZING!
Alchemist
THANKS POST
#6 Old 16th Apr 2017 at 8:29 AM
This is so great, I can't wait to use it! *eagerly awaits next parts of the tutorial*
Site Helper
THANKS POST
#7 Old 16th Apr 2017 at 1:26 PM
You've been busy! <3
Test Subject
THANKS POST
#8 Old 16th Apr 2017 at 8:14 PM
Thanks for creating this! Good job!
Test Subject
THANKS POST
#9 Old 17th Apr 2017 at 5:35 AM
Thank you so much! It's great that Sims 3 is still getting support, you're one of the best when it comes to making new stuff for this game. I am honestly surprised that it took so long to make custom traits for the game. I mean, we had the one Hypochondria trait, but that was it.

Anyway, thanks for all your work, and thanks for keeping the Sims 3 alive with your additions!
Lab Assistant
THANKS POST
#10 Old 20th Apr 2017 at 2:45 AM
Thank you for making this, but it's to complex for me LOL It is a miracle that i manage to walk and chew gum at the same time 8D Keep making mods ;)
Test Subject
THANKS POST
#11 Old 9th May 2017 at 8:34 PM
Thank you for the time and effort of making this tutorial! Off to try to make a "drow-trait"
Test Subject
THANKS POST
#12 Old 5th Aug 2017 at 4:20 AM
Thanks
Test Subject
THANKS POST
#13 Old 8th Nov 2017 at 8:26 PM
So i managed to make an alcoholic trait. It shows up in game but it doesn`t actually _do_ anything. Could anyone give me a hint of how to make it "push" the sim to drink if having this trait?
Test Subject
THANKS POST
#14 Old 25th Dec 2017 at 2:27 AM
I think I'll use your great work to support the Traits part of a mod I'm making. Genius !
Test Subject
DELETED POST
26th Dec 2017 at 3:58 PM
This message has been deleted by Armise. Reason: no answer + bad explainations, replaced
Test Subject
THANKS POST
#15 Old 3rd Feb 2018 at 6:10 PM
Tyvm for working on this! :)
Test Subject
#16 Old 17th Mar 2018 at 6:59 PM
When I look in your code with Reflector, I see that it's supposed to add traits to an enum, which I guess is TraitNames, but when I use it in-game, the traits are indeed loaded and I can select the not-hidden ones when editing a sim's traits, but they still aren't in the TraitNames Enum.
Therefore, the other methods in the game can't acknowledge its existence. For example :
Code:
Enum.IsDefined(typeof(TraitNames), "ArtisticAlgorithmsChip").ToString()
returns true, but
Code:
Enum.IsDefined(typeof(TraitNames), "Armise_AngelTrait").ToString()
returns false.
Do you have a way to use the trait in new methods ? For example, to tset if a specified sim has it or not ?