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!
Lab Assistant
Original Poster
#51 Old 8th Nov 2020 at 10:34 PM
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.
Advertisement
Lab Assistant
Original Poster
#52 Old 19th Nov 2020 at 9:45 PM
Okay, so at the risk of looking like the biggest idiot on planet earth, can someone please explain this code to me?
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.
Senior Moderator
staff: senior moderator
#53 Old 20th Nov 2020 at 10:26 PM
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
Page 3 of 3
Back to top