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
#1 Old 20th Oct 2018 at 5:23 PM Last edited by whiteman-Dara : 16th Feb 2020 at 2:03 PM. Reason: Resolved
Default [Resolved] Action a "Ask to Leave Home" , autonomous and available playable sim
Hello, how to make action a "Ask to Leave Home" , autonomous and available playable sim? This action is performed by NoPlayableSim after 3:00 am, to kick you out of the house.
Advertisement
Trainee Moderator
staff: trainee moderator
#2 Old 20th Oct 2018 at 10:56 PM
Quote: Originally posted by whiteman-Dara
Hello, how to make action a "Ask to Leave Home" , autonomous and available playable sim? This action is performed by NoPlayableSim after 3:00 am, to kick you out of the house.


You can look for that interaction in the gameplaydata.package file in the game files, though before doing anything copy that package to your desktop or somewhere. Then, when you find it you can change the autonomy of it, as well as set it so that the player has that option. You can also do the same thing through NRaas Returner as well. Anyway, sims leave your lot automatically after 3:00 AM.

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Lab Assistant
Original Poster
#3 Old 21st Oct 2018 at 10:29 AM
TheSweetToddler, I can not look for that interaction in the gameplaydata.package file. That's all I found
Code:
using Sims3.Gameplay.Actors;
using Sims3.Gameplay.ActorSystems;
using Sims3.Gameplay.Autonomy;
using Sims3.Gameplay.Interactions;
using Sims3.Gameplay.Situations;
using Sims3.SimIFace;
using System;

public class TurnToFaceAndAskToLeave : Interaction<Sim, Sim>
{
	[DoesntRequireTuning]
	public sealed class Definition : InteractionDefinition<Sim, Sim, Sim.TurnToFaceAndAskToLeave>
	{
		public enum GoWhere
		{
			LeaveRoom,
			LeaveHouse,
			GoHome,
			Nowhere
		}

		public string AnimationName = "a_neutral_shoo_x";

		public Sim.TurnToFaceAndAskToLeave.Definition.GoWhere GoingWhere;

		public VisitSituation.GuestLeaveReason Reason;

		public bool CancelTargetsInteraction;

		public VisitSituation.LocalizedStringCallback TnsText;

		protected override string GetInteractionName(Sim a, Sim target, InteractionObjectPair interaction)
		{
			if (this.GoingWhere == Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveRoom)
			{
				return Sim.LocalizeString("TurnToFaceAndAskToLeaveToNextRoom", new object[0]);
			}
			return Sim.LocalizeString("TurnToFaceAndAskToLeaveHome", new object[0]);
		}

		protected override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
		{
			return true;
		}
	}

	public static readonly Sim.TurnToFaceAndAskToLeave.Definition Singleton = new Sim.TurnToFaceAndAskToLeave.Definition();

	protected override bool Run()
	{
		if (this.Actor.LotCurrent != this.Target.LotCurrent)
		{
			return true;
		}
		Sim.TurnToFaceAndAskToLeave.Definition definition = base.InteractionDefinition as Sim.TurnToFaceAndAskToLeave.Definition;
		if (definition.GoingWhere == Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveRoom && this.Actor.RoomId != this.Target.RoomId)
		{
			return true;
		}
		if (this.Actor.RouteTurnToFace(this.Target.Position))
		{
			if (definition.TnsText != null)
			{
				VisitSituation visitSituation = VisitSituation.FindVisitSituationInvolvingGuest(this.Target);
				if (visitSituation != null)
				{
					visitSituation.ShowInappropriateWarningTNS(this.Target, this.Actor, definition.TnsText, true);
				}
			}
			if (definition.AnimationName == "embarrassed")
			{
				this.Actor.PlayReaction(ReactionTypes.Embarrassed, ReactionSpeed.NowOrLater);
			}
			else
			{
				this.Actor.PlaySoloAnimation(definition.AnimationName, true);
			}
		}
		if (definition.CancelTargetsInteraction)
		{
			this.Target.InteractionQueue.CancelAllInteractions();
		}
		switch (definition.GoingWhere)
		{
		case Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveRoom:
			PrivacySituation.MakeSimGoToAdjacentRoom(this.Actor, this.Target);
			break;
		case Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveHouse:
			VisitSituation.MakeGuestHouseholdExitToYard(this.Actor.LotCurrent, this.Actor, this.Target, definition.Reason, true);
			break;
		case Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.GoHome:
			Sim.MakeSimGoHome(this.Target, false);
			break;
		}
		return true;
	}
}
Trainee Moderator
staff: trainee moderator
#4 Old 21st Oct 2018 at 1:01 PM
Quote: Originally posted by whiteman-Dara
TheSweetToddler, I can not look for that interaction in the gameplaydata.package file. That's all I found
Code:
using Sims3.Gameplay.Actors;
using Sims3.Gameplay.ActorSystems;
using Sims3.Gameplay.Autonomy;
using Sims3.Gameplay.Interactions;
using Sims3.Gameplay.Situations;
using Sims3.SimIFace;
using System;

public class TurnToFaceAndAskToLeave : Interaction<Sim, Sim>
{
	[DoesntRequireTuning]
	public sealed class Definition : InteractionDefinition<Sim, Sim, Sim.TurnToFaceAndAskToLeave>
	{
		public enum GoWhere
		{
			LeaveRoom,
			LeaveHouse,
			GoHome,
			Nowhere
		}

		public string AnimationName = "a_neutral_shoo_x";

		public Sim.TurnToFaceAndAskToLeave.Definition.GoWhere GoingWhere;

		public VisitSituation.GuestLeaveReason Reason;

		public bool CancelTargetsInteraction;

		public VisitSituation.LocalizedStringCallback TnsText;

		protected override string GetInteractionName(Sim a, Sim target, InteractionObjectPair interaction)
		{
			if (this.GoingWhere == Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveRoom)
			{
				return Sim.LocalizeString("TurnToFaceAndAskToLeaveToNextRoom", new object[0]);
			}
			return Sim.LocalizeString("TurnToFaceAndAskToLeaveHome", new object[0]);
		}

		protected override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
		{
			return true;
		}
	}

	public static readonly Sim.TurnToFaceAndAskToLeave.Definition Singleton = new Sim.TurnToFaceAndAskToLeave.Definition();

	protected override bool Run()
	{
		if (this.Actor.LotCurrent != this.Target.LotCurrent)
		{
			return true;
		}
		Sim.TurnToFaceAndAskToLeave.Definition definition = base.InteractionDefinition as Sim.TurnToFaceAndAskToLeave.Definition;
		if (definition.GoingWhere == Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveRoom && this.Actor.RoomId != this.Target.RoomId)
		{
			return true;
		}
		if (this.Actor.RouteTurnToFace(this.Target.Position))
		{
			if (definition.TnsText != null)
			{
				VisitSituation visitSituation = VisitSituation.FindVisitSituationInvolvingGuest(this.Target);
				if (visitSituation != null)
				{
					visitSituation.ShowInappropriateWarningTNS(this.Target, this.Actor, definition.TnsText, true);
				}
			}
			if (definition.AnimationName == "embarrassed")
			{
				this.Actor.PlayReaction(ReactionTypes.Embarrassed, ReactionSpeed.NowOrLater);
			}
			else
			{
				this.Actor.PlaySoloAnimation(definition.AnimationName, true);
			}
		}
		if (definition.CancelTargetsInteraction)
		{
			this.Target.InteractionQueue.CancelAllInteractions();
		}
		switch (definition.GoingWhere)
		{
		case Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveRoom:
			PrivacySituation.MakeSimGoToAdjacentRoom(this.Actor, this.Target);
			break;
		case Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveHouse:
			VisitSituation.MakeGuestHouseholdExitToYard(this.Actor.LotCurrent, this.Actor, this.Target, definition.Reason, true);
			break;
		case Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.GoHome:
			Sim.MakeSimGoHome(this.Target, false);
			break;
		}
		return true;
	}
}


No no, that's like a script, what you need is the ITUN file to change the autonomy, or actually, isn't the "ask to leave" interaction already user-directed?

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Lab Assistant
Original Poster
#5 Old 15th Nov 2018 at 5:17 PM
TheSweetToddler, I suspect this interaction is none at all in the GameplayData.package. What is the interaction called?
Trainee Moderator
staff: trainee moderator
#6 Old 15th Nov 2018 at 7:37 PM
As far as I know, sims already will be kicked out autonomously after 3:00 or 3:30 AM, and if not then you can make your sims tell the visitors to leave, but I mostly think the interaction can't be done autonomously by sims face to face, since some interactions are made to be non-autonomous, so you can't change that in the ITUN files, but I may be wrong. I think the interaction was called "Say Goodbye", I don't think it's called "ask to leave" unless it the sim is an acquaintance or they are being rude. Then again, I don't know everything perfectly about the game, so I can be wrong.

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Lab Assistant
Original Poster
#7 Old 16th Nov 2018 at 1:46 PM
There is no such interaction either. what another variants?
Trainee Moderator
staff: trainee moderator
#8 Old 16th Nov 2018 at 5:19 PM
Quote: Originally posted by whiteman-Dara
There is no such interaction either. what another variants?


Oh, sorry I forgot to say the interaction's probably in the BG's social.data file inside the gameplaydata.

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Lab Assistant
Original Poster
#9 Old 25th Nov 2018 at 5:38 PM
TheSweetToddler, I found it, but how about this, if the interaction still remains unavailable to me? I don't see him in interactions with sim.
Trainee Moderator
staff: trainee moderator
#10 Old 26th Nov 2018 at 9:31 PM
If you still don't see it, it's most probably been hard coded to be like that, or it just can't be visible by the player.

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Scholar
#11 Old 10th May 2019 at 12:28 AM
You can create your own ask to leave interaction and use an ITUN file to make it autonomous. BTW don't active sims have an ask to leave or goodbye interaction? I have used it especially on the welcome wagon that visits in a new game.
Can you tell me how you want it to be autonomous? The itun files make interactions autonomous based on needs or motives. If you want it to be used based on a particular time of day you will have to add a listener event most likely.

If you like my mods. Consider supporting me on Patreon
Check out my website for updates on my mods and other work PuddingFace.wixsite.com
Check out my Youtube channel for tutorials(modding tutorials) and other content Youtube

Follow me on Twitter Instagram Pinterest Tumblr
Lab Assistant
Original Poster
#12 Old 16th Feb 2020 at 2:16 PM
I edited the code and everything turned out the way I wanted.
Source code:
Code:
// Sims3.Gameplay.Situations.VisitSituation.TimeForGuestToLeave
public override void Init(VisitSituation parent)
{
	this.mRemindThemToLeave = base.AlarmManager.AddAlarmRepeating(15f, TimeUnit.Minutes, new AlarmTimerCallback(this.RemindGuestsToLeave), 15f, TimeUnit.Minutes, "Remind guests to leave", AlarmType.AlwaysPersisted, parent.mGuest);
	if (!this.AllGuestsHouseholdMembersOutside())
	{
		using (List<Sim>.Enumerator enumerator = parent.mHosts.GetEnumerator())
		{
			if (enumerator.MoveNext())
			{
				Sim current = enumerator.Current;
				if (!current.IsSelectable && parent.Reason != VisitSituation.GuestLeaveReason.GuestInMotiveDistress)
				{
					InteractionPriority priority = new InteractionPriority(InteractionPriorityLevel.High, 1f);
					this.mInteraction = (base.ForceSituationSpecificInteraction(parent.mGuest, current, Sim.TurnToFaceAndAskToLeave.Singleton, null, new Callback(this.Succeeded), new Callback(this.Failed), priority) as Sim.TurnToFaceAndAskToLeave);
					Sim.TurnToFaceAndAskToLeave.Definition definition = this.mInteraction.InteractionObjectPair.InteractionDefinition as Sim.TurnToFaceAndAskToLeave.Definition;
					definition.Reason = parent.Reason;
					definition.AnimationName = "a_neutral_shoo_x";
					definition.GoingWhere = Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveHouse;
					definition.TnsText = this.mTnsText;
				}
				else
				{
					VisitSituation.MakeGuestHouseholdExitToYard(parent.Lot, parent.mPreviousHost, parent.mGuest, parent.Reason, true);
				}
			}
		}
	}
}

Here is a modified code with which everything is in order:
Code:
// Sims3.Gameplay.Situations.VisitSituation.TimeForGuestToLeave
public override void Init(VisitSituation parent)
{
	this.mRemindThemToLeave = base.AlarmManager.AddAlarmRepeating(15f, TimeUnit.Minutes, new AlarmTimerCallback(this.RemindGuestsToLeave), 15f, TimeUnit.Minutes, "Remind guests to leave", AlarmType.AlwaysPersisted, parent.mGuest);
	if (!this.AllGuestsHouseholdMembersOutside())
	{
		using (List<Sim>.Enumerator enumerator = parent.mHosts.GetEnumerator())
		{
			if (enumerator.MoveNext())
			{
				Sim current = enumerator.Current;
				if (current.IsHuman && parent.Reason != VisitSituation.GuestLeaveReason.GuestInMotiveDistress)
				{
					InteractionPriority priority = new InteractionPriority(InteractionPriorityLevel.High, 1f);
					this.mInteraction = (base.ForceSituationSpecificInteraction(parent.mGuest, current, Sim.TurnToFaceAndAskToLeave.Singleton, null, new Callback(this.Succeeded), new Callback(this.Failed), priority) as Sim.TurnToFaceAndAskToLeave);
					Sim.TurnToFaceAndAskToLeave.Definition definition = this.mInteraction.InteractionObjectPair.InteractionDefinition as Sim.TurnToFaceAndAskToLeave.Definition;
					definition.Reason = parent.Reason;
					definition.AnimationName = "a_neutral_shoo_x";
					definition.GoingWhere = Sim.TurnToFaceAndAskToLeave.Definition.GoWhere.LeaveHouse;
					definition.TnsText = this.mTnsText;
				}
				else
				{
					VisitSituation.MakeGuestHouseholdExitToYard(parent.Lot, parent.mPreviousHost, parent.mGuest, parent.Reason, true);
				}
			}
		}
	}
}
Back to top