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!
Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 12th Nov 2014 at 6:17 PM
Default Trying to get an instant interaction rolling.
I am trying to get an interaction that runs instantly at a certain time.
I can make the entire interaction work, timing and all, but I also have to have an XML that checks for motives etc. i.e. "400" Fun etc
What I want is to be able to have the interaction fire on a certain sim clock time...
What it does is select a random sim, max all it's motives, and have that sim go to a location. <-- all that is solved, I just don't want it to check for motivations because those are all going to be maxed right after the interaction rolls.
I just am needing it to roll instantly... but am unfamiliar with ways to get around the XMLs. Any suggestions?
Thanks.
Advertisement
1978 gallons of pancake batter
#2 Old 12th Nov 2014 at 6:42 PM
Would be good if you showed what you have so far. I for one have a little trouble understanding the problem. Do you mean an ITUN with a certain mood threshold or something? Because if so, just remove it. Also you don't need an ITUN at all if you start the interaction programmatically and don't need posture preconditions or tradeoffs.

You should watch out for something, though. If the sim in question is idling off-screen and thus not running in high res simulation, a regular interaction may simply fail to run. In that case you may want to try a MetaAutonomyInteraction.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Test Subject
Original Poster
#3 Old 12th Nov 2014 at 7:00 PM
Quote: Originally posted by Buzzler
Would be good if you showed what you have so far. I for one have a little trouble understanding the problem. Do you mean an ITUN with a certain mood threshold or something? Because if so, just remove it. Also you don't need an ITUN at all if you start the interaction programmatically and don't need posture preconditions or tradeoffs.

You should watch out for something, though. If the sim in question is idling off-screen and thus not running in high res simulation, a regular interaction may simply fail to run. In that case you may want to try a MetaAutonomyInteraction.


Ok, this interaction works great. I have another just like it that checks the time and sets motives to max... Also, have it to where it selects a random sim to perform the interaction... all that works fine. But it has to have the sim check for motivations. So if the sims motives are too high i.e. the fun meter is way up, it won't run the interaction... I guess since it has to check the ITUN.
Instead of checking the ITUN and running autonomously based on the sims needs, I just want it to run instantly at a certain time. I am not sure what I need to do to get that done.
Not sure how to hide code for spoilers etc... so will just paste in the open here.

using Sims3.Gameplay.Actors;
using Sims3.Gameplay.ActorSystems;
using Sims3.Gameplay.Autonomy;
using Sims3.Gameplay.Core;
using Sims3.Gameplay.Interactions;
using Sims3.Gameplay.Interfaces;
using Sims3.SimIFace;
using Sims3.Gameplay.Utilities;
using System;
using System.Collections.Generic;
public class RandomBolt : Interaction<Sim, Sim>, IRouteFromInventoryOrSelfWithoutCarrying
{
public class Definition : SoloSimInteractionDefinition<RandomBolt>
{
public override string GetInteractionName(Sim a, Sim target, InteractionObjectPair interaction)
{
return "Random Bolt!";
}
public override string[] GetPath(bool isFemale)
{
return new string[]
{
"Random"
};
}
public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
if (!a.SimDescription.IsHuman)
{
return false;
}
bool result = false;
foreach (IMetaObject current in Autonomy.PublicMetaObjects)
{
Lot lot = current as Lot;
if (lot != null && lot.IsPark)
{
result = true;
break;
}
}
return result;
}
}
public static RandomBolt sRandomBolt;
[Tunable, TunableComment("Range: float Description: How long sims will loop in minutes.")]
public static float[] kLoopRange = new float[]
{
1f,
2f
};
public float mTotalTime;
public static readonly InteractionDefinition Singleton = new RandomBolt.Definition();
public static RandomBolt Instance
{
get
{
return RandomBolt.sRandomBolt;
}
}
public override bool Run()
{
List<Lot> list = new List<Lot>();
foreach (Lot lot in LotManager.AllLots)
{
if (lot.LotType != LotType.Tutorial && Actor.LotHome != lot)
{
list.Add (lot);
}
}
Lot randomObjectFromList = RandomUtil.GetRandomObjectFromList<Lot>(list);
if (randomObjectFromList != null)
{
InteractionInstance inst = this.Actor.InteractionQueue.PushAsContinuation(GoToCommunityLot.Singleton, randomObjectFromList, false);
return this.Actor.InteractionQueue.HasInteraction(inst);
}
return false;
}
}
Inventor
#4 Old 12th Nov 2014 at 7:24 PM
Forget about the ITUN. You need an XML, but you need it only if you want
the conditions to run the interaction to be tunable in the XML itself.

To run the interaction at a certain time you need an AlarmHandle,
if you need an example search for my mod "Floor Mark Summoner",
you'll find it in the second or third page of this subforum (but that mod is
tied to an object, I guess you need a pure scripting mod, hence an XML
to use as instantiator).
Test Subject
Original Poster
#5 Old 12th Nov 2014 at 8:24 PM
Quote: Originally posted by Arsil
Forget about the ITUN. You need an XML, but you need it only if you want
the conditions to run the interaction to be tunable in the XML itself.

To run the interaction at a certain time you need an AlarmHandle,
if you need an example search for my mod "Floor Mark Summoner",
you'll find it in the second or third page of this subforum (but that mod is
tied to an object, I guess you need a pure scripting mod, hence an XML
to use as instantiator).


I really don't have a solid understanding of how alarm handles work. Not sure what the basic components are.
Would definitely love to know more about them if you or anyone else would care to explain.
What are the primary components of the alarms? I can see a lot of the stuff in ILSPY when I break down the burglar alarm, as a for instance.
I am just not sure what the primary functions for an absolute bare-bones alarm handle and a reaction call to that alarm would be.
Thanks
Inventor
#6 Old 12th Nov 2014 at 8:36 PM
That's why I suggested you to look at my mod, HERE.
I think it's easy to understand how an AlarmHandle works from it,
just ignore all the other features and focus on that.
Test Subject
Original Poster
#7 Old 12th Nov 2014 at 9:30 PM
Quote: Originally posted by Arsil
That's why I suggested you to look at my mod, HERE.
I think it's easy to understand how an AlarmHandle works from it,
just ignore all the other features and focus on that.


Ok... I will give it a go and see if I can reverse engineer it! Thanks, Arsil.
Test Subject
Original Poster
#8 Old 13th Nov 2014 at 9:32 PM
Quote: Originally posted by Buzzler
Would be good if you showed what you have so far. I for one have a little trouble understanding the problem. Do you mean an ITUN with a certain mood threshold or something? Because if so, just remove it. Also you don't need an ITUN at all if you start the interaction programmatically and don't need posture preconditions or tradeoffs.

You should watch out for something, though. If the sim in question is idling off-screen and thus not running in high res simulation, a regular interaction may simply fail to run. In that case you may want to try a MetaAutonomyInteraction.


Buzzler, if I mess with the MetaAutonomy (since odds are it's going to pick a sim far enough away) should I crank up the MetaAutonomy level or turn it down or off in order to make the intereaction more likely to run reliably? I think I am supposed to crank it to max, but then I might be exactly backwards.
Back to top