- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- [SOLVED] How to route sim to sim in Sims 3?
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- [SOLVED] How to route sim to sim in Sims 3?
Replies: 5 (Who?), Viewed: 1054 times.
#1
9th Oct 2014 at 9:18 AM
Last edited by ArtUrlWWW : 9th Oct 2014 at 2:47 PM.
Posts: 133
Thanks: 1494 in 13 Posts
[SOLVED] How to route sim to sim in Sims 3?
Hello.I am trying to make ImmediateInteraction to route one sim to another sim.
I have try many combinations of the code, but actor.DoRoute(route) already return False and
Code:
this.Actor.RouteTurnToFace(this.Target.Position);
showing symbol on the sim, what means "Can't go to there".
For example code:
Code:
using Sims3.Gameplay.Abstracts; using Sims3.Gameplay.Actors; using Sims3.Gameplay.Autonomy; using Sims3.Gameplay.Core; using Sims3.Gameplay.Interactions; using Sims3.Gameplay.Interfaces; using Sims3.SimIFace; using Sims3.UI; using System; using System.Collections.Generic; using System.Text; namespace YourNameSpaceHere { internal sealed class GoToSim3 : ImmediateInteraction<Sim, Sim> { public static readonly InteractionDefinition Singleton = new Definition(); protected override bool Run() { base.Actor.ShowTNSIfSelectable("RUNNED", StyledNotification.NotificationStyle.kSimTalking); base.Actor.SynchronizationLevel = Sim.SyncLevel.NotStarted; base.Target.SynchronizationLevel = Sim.SyncLevel.NotStarted; base.Target.InteractionQueue.CancelAllInteractions(); base.Actor.InteractionQueue.CancelAllInteractions(); //this.Target.kTimeSinceLastMove = SimClock.ElapsedTime(TimeUnit.Hours); Sim actor = this.Actor; GameObject target = this.Target; Route route = this.Actor.CreateRoute(); route.ExitReasonsInterrupt = 0; route.ReplanAllowed = true; route.PlanToPointRadius(target.Position, 0.2f + RandomUtil.GetFloat(0.8f), RouteOrientationPreference.NoPreference, target.LotCurrent.LotId, new int[] { target.RoomId }); if (route.PlanResult.Succeeded()) { base.Actor.ShowTNSIfSelectable(" Succeeded = TRUE", StyledNotification.NotificationStyle.kSimTalking); } else { base.Actor.ShowTNSIfSelectable(" Succeeded = FALSE", StyledNotification.NotificationStyle.kSimTalking); } if (actor.DoRoute(route)) { base.Actor.ShowTNSIfSelectable(" DoRoute = TRUE", StyledNotification.NotificationStyle.kSimTalking); } else { base.Actor.ShowTNSIfSelectable(" DoRoute = FALSE", StyledNotification.NotificationStyle.kSimTalking); } return true; } [DoesntRequireTuning] private sealed class Definition : ImmediateInteractionDefinition<Sim, Sim, GoToSim3>, IOverrideStartInteractionBehavior { protected override string GetInteractionName(Sim a, Sim target, InteractionObjectPair interaction) { return "GoToSim3_5+"; } protected override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { return true; } public void StartInteraction(Sim actor, IGameObject target) { } } } }
On interaction run I see messages "RUNNED", " Succeeded = TRUE" and " DoRoute = FALSE".
Where is my mistake? How to get going one sim to another?
Sorry my bad English.
Advertisement
#2
9th Oct 2014 at 10:36 AM
Posts: 997
Thanks: 22101 in 95 Posts
I'm not sure using an ImmediateInteraction is right, as far as I know
it's for things like turning on a light or any other action that doesn't take time.
Not a permanent solution, but just to see if it works you can try this:
I'm willing to help but I don't want to write the missing parts,
can you upload the whole package?
it's for things like turning on a light or any other action that doesn't take time.
Not a permanent solution, but just to see if it works you can try this:
Code:
Sim actor = this.Actor; GameObject target = this.Target; // maybe this requires a cast or something like that if (!actor.RouteToObjectRadialRange(target, 0, 2)) { return false; }
I'm willing to help but I don't want to write the missing parts,
can you upload the whole package?
#3
9th Oct 2014 at 11:14 AM
Quote: Originally posted by Arsil
I'm not sure using an ImmediateInteraction is right, as far as I know |
If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
#4
9th Oct 2014 at 11:48 AM
Posts: 133
Thanks: 1494 in 13 Posts
Quote: Originally posted by Arsil
I'm not sure using an ImmediateInteraction is right, as far as I know it's for things like turning on a light or any other action that doesn't take time. Not a permanent solution, but just to see if it works you can try this:
Code:
Sim actor = this.Actor; GameObject target = this.Target; // maybe this requires a cast or something like that if (!actor.RouteToObjectRadialRange(target, 0, 2)) { return false; } I'm willing to help but I don't want to write the missing parts, can you upload the whole package? |
Hi.
I tryed to use your code, it's return True and nothing happens - sims both are staying at place, not moving.
I have attached zip archive with C# project of the package lib.
Package contains only this dll (S3SA) + _XML 0x0333406C with code
Code:
<?xml version="1.0" encoding="utf-8"?> <base> <Current_Tuning> <kInstantiator value="True" /> </Current_Tuning> </base>
If ImmediateInteraction doesn't support animation, then what object I must use instead of ImmediateInteraction?
Attached files:
Experiments_n1.zip (9.23 MB, 7 downloads) - View custom content | ||
0 10-09-2014 14:34 Experiments_n1/ 0 10-06-2014 16:19 Experiments_n1/bin/ 0 10-09-2014 14:36 Experiments_n1/bin/Debug/ 12288 10-09-2014 14:36 Experiments_n1/bin/Debug/Experiments_n1.dll 38400 10-09-2014 14:36 Experiments_n1/bin/Debug/Experiments_n1.pdb 430080 10-04-2014 16:13 Experiments_n1/bin/Debug/ScriptCore.dll 618496 10-04-2014 16:13 Experiments_n1/bin/Debug/SimIFace.dll 7622656 10-04-2014 16:13 Experiments_n1/bin/Debug/Sims3GameplayObjects.dll 13873152 10-04-2014 16:13 Experiments_n1/bin/Debug/Sims3GameplaySystems.dll 143360 10-04-2014 16:14 Experiments_n1/bin/Debug/Sims3Metadata.dll 1220608 10-04-2014 16:12 Experiments_n1/bin/Debug/Sims3StoreObjects.dll 3014656 10-04-2014 16:13 Experiments_n1/bin/Debug/UI.dll 0 10-06-2014 16:19 Experiments_n1/bin/Release/ 3429 10-09-2014 14:36 Experiments_n1/Experiments_n1.csproj 2895 10-09-2014 12:34 Experiments_n1/GoToSim3.cs 2768 10-09-2014 13:14 Experiments_n1/GoToSim4.cs 1854 10-09-2014 14:36 Experiments_n1/GoToSim5.cs 1447 10-08-2014 16:11 Experiments_n1/GoToSimOne.cs 13598 10-09-2014 10:58 Experiments_n1/GoToSimTwo.cs 3890 10-09-2014 14:35 Experiments_n1/Instantiator.cs 0 10-06-2014 14:29 Experiments_n1/obj/ 0 10-09-2014 14:36 Experiments_n1/obj/Debug/ 6278 10-09-2014 14:34 Experiments_n1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache 1125 10-09-2014 14:36 Experiments_n1/obj/Debug/Experiments_n1.csproj.FileListAbsolute.txt 12288 10-09-2014 14:36 Experiments_n1/obj/Debug/Experiments_n1.dll 38400 10-09-2014 14:36 Experiments_n1/obj/Debug/Experiments_n1.pdb 0 10-06-2014 14:29 Experiments_n1/obj/Debug/TempPE/ 0 10-06-2014 14:29 Experiments_n1/Properties/ 1657 10-06-2014 18:14 Experiments_n1/Properties/AssemblyInfo.cs 1439 10-08-2014 15:50 Experiments_n1/ShowNotification .cs --------- ------- 27064764 30 files |
#5
9th Oct 2014 at 12:49 PM
Posts: 997
Thanks: 22101 in 95 Posts
Next time please upload the .package file and not 20Mbyte of debugging information,
I lost more time recreating it than writing the interaction.
Here.
There's something missing in your Instantiator, it doesn't add the interaction to all sims
(I added a new sim to my household to try the mod and he didn't have it).
Also, in "addInteractions" check if the sim already has that interaction before adding it again
and again. Check THIS for reference.
I lost more time recreating it than writing the interaction.
Here.
Code:
namespace YourNameSpaceHere { internal sealed class GoToSimOne : Interaction<Sim, Sim> { public static readonly InteractionDefinition Singleton = new Definition(); protected override bool Run() { if (!base.Actor.RouteToObjectRadialRange(base.Target, 0, 5)) { return false; } return true; } [DoesntRequireTuning] private sealed class Definition : InteractionDefinition<Sim, Sim, YourNameSpaceHere.GoToSimOne> { protected override string GetInteractionName(Sim a, Sim target, InteractionObjectPair interaction) { return "GoToSim1"; } protected override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (a == target) return false; return true; } } } }
There's something missing in your Instantiator, it doesn't add the interaction to all sims
(I added a new sim to my household to try the mod and he didn't have it).
Also, in "addInteractions" check if the sim already has that interaction before adding it again
and again. Check THIS for reference.
#6
9th Oct 2014 at 2:15 PM
Posts: 133
Thanks: 1494 in 13 Posts
Cool! It's working! Thank you very much!
OK, sorry me for that. I am newbie at this forum and I don't know all rules of the forum.
Thank you!
Quote: Originally posted by Arsil
Next time please upload the .package file and not 20Mbyte of debugging information, I lost more time recreating it than writing the interaction. |
OK, sorry me for that. I am newbie at this forum and I don't know all rules of the forum.
Quote: Originally posted by Arsil
There's something missing in your Instantiator, it doesn't add the interaction to all sims (I added a new sim to my household to try the mod and he didn't have it). Also, in "addInteractions" check if the sim already has that interaction before adding it again and again. Check THIS for reference. |
Thank you!
Who Posted
|