Welcome to
Mod The Sims
Online: 1272
News:
Have an account? Sign in:
pass:
If you don't have an account, why not sign up now? It's free!
Other sites: SimsWiki
Reply  Replies: 52 (Who?), Viewed: 2719 times.
Search this Thread
Old 8th Nov 2020, 11:34 PM #51
LittleCheshire
Original Poster

Lab Assistant

Join Date: Aug 2018
Posts: 188
Thanks: 105 in 1 Posts
3 Achievements


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.
Old 19th Nov 2020, 10:45 PM #52
LittleCheshire
Original Poster

Lab Assistant

Join Date: Aug 2018
Posts: 188
Thanks: 105 in 1 Posts
3 Achievements


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.
Old 20th Nov 2020, 11:26 PM #53
zoe22
Trainee Moderator

Join Date: Aug 2014
Posts: 325
Thanks: 993 in 8 Posts
12 Achievements


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
Reply


Section jump:


Powered by MariaDB Some icons by http://dryicons.com.