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!
Scholar
Original Poster
#1 Old 1st Aug 2018 at 1:12 PM
Default How to find out a Sims's traits?
How do I find in the script which traits a particular Sim has? I know howto check for if a Sim has a certain trait. But now I need to know all the traits of a Sim. Any ideas?
Advertisement
Space Pony
#2 Old 1st Aug 2018 at 5:10 PM Last edited by Battery : 1st Aug 2018 at 5:21 PM.
ICollection<Trait> traits = Sim.ActiveActor.TraitManager.List;

Sim.ActiveActor can ofc be replaced with the desired actor

you didnt ask but to make this post a bit bigge here is how to get traitnames as a string ^^

ICollection<Trait> traits = Sim.ActiveActor.TraitManager.List;
string abc ="";
foreach (Trait t in traits)
{
abc += t.TraitName(Sim.ActiveActor.IsFemale) + "\n";
}

and now abc contains your traitnames
Scholar
Original Poster
#3 Old 1st Aug 2018 at 6:31 PM
Thank you
I'll try it out for my wand update in my Enhanced Witches mod.
Back to top