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!
Inventor
Original Poster
#1 Old 2nd Dec 2020 at 5:27 PM
Default Making a custom interaction raise a need
I have created a custom interaction. Actually, a skill and several interactions! It's going well.

However, one of these interactions needs to be fun. I haven't figured out how to make an interaction raise a need.

Is that a Commodity? I've found some info on commodities, but I've missed tutorials about them.

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Advertisement
Forum Resident
#2 Old 2nd Dec 2020 at 5:41 PM
Something along those lines:

Code:
createdSim.Motives.SetValue(CommodityKind.Fun, -100f);


The range goes from -100f to 100f

Find my Mods: Here at MTS, over at Simlogical
Space Pony
#3 Old 2nd Dec 2020 at 6:36 PM
Alternatively, if you want the motive to be gradually raised over the course of the interaction, it's probably better to put it into the ITUN:

Code:
<?xml version="1.0"?>
<base>
	<!--Unimportant Things-->
	<Current_Tuning>
		<!--More Unimportant Things-->
		<Tradeoff name="MyInteraction">
			<!--Yet More Unimportant Things-->
			<Output>
 				<Change type="Fun" advertised="30" locked="True" actual="25" updateType="ContinuousFlow" timeDependsOn="False" updateEvenOnFailure="False" updateAboveAndBelowZero="Either" />
			</Output>
		</Tradeoff>
	</Current_Tuning>
</base>


The "type" attribute can take any CommodityKind value. The "advertised" attribute is used for autonomy calculations, while "actual" is the true amount (positive or negative) that is added to the commodity's current value per hour spent performing the interaction. Changing "ContinuousFlow" to "ImmediateDelta" will add the "actual" value to the commodity's value as soon as the interaction is finished (assuming it succeeds).

EDIT: To start this continuous flow, call "base.BeginCommodityUpdates()" after the Sim has successfully entered the interaction. To stop continuous flow and/or activate immediate deltas, call "base.EndCommodityUpdates(flag)", where flag is a bool representing whether or not the interaction succeeded and the immediate deltas should be granted.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Inventor
Original Poster
#4 Old 2nd Dec 2020 at 6:38 PM
Quote: Originally posted by Consort
Something along those lines:

Code:
createdSim.Motives.SetValue(CommodityKind.Fun, -100f);


The range goes from -100f to 100f


Thank you!

Is there a way to set a steady gain during a longer interaction, the way you can do with skill gain?

ETA: LOL. And my question is ninja'd by gamefreak. I'll go try that. Thanks!

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Inventor
Original Poster
#5 Old 2nd Dec 2020 at 6:44 PM
Quote: Originally posted by gamefreak130
Alternatively, if you want the motive to be gradually raised over the course of the interaction, it's probably better to put it into the ITUN:


OK, my custom interactions don't currently have ITUNs. Should they? Can I just slap one in to do this one thing? What's the instance ID?

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Space Pony
#6 Old 2nd Dec 2020 at 7:59 PM Last edited by gamefreak130 : 2nd Dec 2020 at 9:15 PM.
Quote: Originally posted by echoweaver
OK, my custom interactions don't currently have ITUNs. Should they? Can I just slap one in to do this one thing? What's the instance ID?


I suppose it's not explicitly necessary, but I always consider it good practice when I'm adding a new interaction. For replacing existing interactions, I just copy the original interaction's tuning in the script.

There's documentation on the format here and here.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Back to top