- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Script Modding In 2020
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Script Modding In 2020
#51
8th Nov 2020 at 10:34 PM
Posts: 201
Thanks: 159 in 1 Posts
Alright! Thank you so much Puddding. I'll come back to this thread if I need further help.
Oh c'mon. There better be a point to all this stress I'm under.
Oh c'mon. There better be a point to all this stress I'm under.
Advertisement
#52
19th Nov 2020 at 9:45 PM
Posts: 201
Thanks: 159 in 1 Posts
Okay, so at the risk of looking like the biggest idiot on planet earth, can someone please explain this code to me?
Oh c'mon. There better be a point to all this stress I'm under.
Code:
public FightPetDefinition() : base("Fight Pet", new string[0], null, initialGreet: false) { } protected override InteractionInstance CreateInstance(ref InteractionInstanceParameters parameters) { SocialInteractionA socialInteractionA = new FightPet(); socialInteractionA.Init(ref parameters); return socialInteractionA; } protected override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (isAutonomous) { return a.TraitManager.HasAnyElement(kTraitsCanFightAutonomously); } return true; } public override string[] GetPath(bool isFemale) { return new string[1] { Localization.LocalizeString(ActionData.GetParentMenuLocKey(ActionDataBase.ParentMenuType.Mean)) }; } public override float CalculateScore(InteractionObjectPair interactionObjectPair, Sims3.Gameplay.Autonomy.Autonomy autonomy) { return CalculateScoreWithInteractionTuning(interactionObjectPair, autonomy, kSocialTuningScoreWeight, kInteractionTuningScoreWeight); } }
Oh c'mon. There better be a point to all this stress I'm under.
#53
20th Nov 2020 at 10:26 PM
Posts: 562
Thanks: 3567 in 11 Posts
I can't give you a detailed explanation but I will do my best :P
So all interactions have a definition, which usually has the Test() function for determining when the interaction is available, and the GetInteractionName() or something like that which is for the actual name of the action in the pie menu. Some interactions also have other methods though, and I guess some of these ones are specific to social interactions which I don't know much about.
I'm not sure what CreateInstance() does but it is obviously a social interaction thing, perhaps related to defining the type of social interaction? ie a fight?
Test() is for when the interactions should appear on the object/sim so in this case any target for player directed, and if autonomous, only if the actor has a autonomous fighting trait.
I believe GetPath() is for the part of the pie menu the interaction should show up, so in the Mean interactions.
CalculateScore() again I'm not familiar with social interactions but my guess would be that it calculates the social outcome of the interaction, so how the relationships change after it.
So yeah, hope this helps a bit, and maybe someone who knows more about social interactions can explain them properly
So all interactions have a definition, which usually has the Test() function for determining when the interaction is available, and the GetInteractionName() or something like that which is for the actual name of the action in the pie menu. Some interactions also have other methods though, and I guess some of these ones are specific to social interactions which I don't know much about.
I'm not sure what CreateInstance() does but it is obviously a social interaction thing, perhaps related to defining the type of social interaction? ie a fight?
Test() is for when the interactions should appear on the object/sim so in this case any target for player directed, and if autonomous, only if the actor has a autonomous fighting trait.
I believe GetPath() is for the part of the pie menu the interaction should show up, so in the Mean interactions.
CalculateScore() again I'm not familiar with social interactions but my guess would be that it calculates the social outcome of the interaction, so how the relationships change after it.
So yeah, hope this helps a bit, and maybe someone who knows more about social interactions can explain them properly
Who Posted
|