Welcome to
Mod The Sims
Online: 1445
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: 5 (Who?), Viewed: 178 times.
Search this Thread
Old 2nd Dec 2020, 6:27 PM DefaultMaking a custom interaction raise a need #1
echoweaver
Original Poster

Instructor

Join Date: Jun 2011
Posts: 507
Thanks: 406 in 13 Posts
6 Achievements


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
Old 2nd Dec 2020, 6:41 PM #2
Consort
Forum Resident

Join Date: Oct 2005
Posts: 722
Thanks: 7577 in 18 Posts
12 Achievements


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
Old 2nd Dec 2020, 7:36 PM #3
gamefreak130
Field Researcher

Join Date: Apr 2013
Posts: 269
Thanks: 2645 in 18 Posts
17 Achievements


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
Old 2nd Dec 2020, 7:38 PM #4
echoweaver
Original Poster

Instructor

Join Date: Jun 2011
Posts: 507
Thanks: 406 in 13 Posts
6 Achievements


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
Old 2nd Dec 2020, 7:44 PM #5
echoweaver
Original Poster

Instructor

Join Date: Jun 2011
Posts: 507
Thanks: 406 in 13 Posts
6 Achievements


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
Old 2nd Dec 2020, 8:59 PM #6
gamefreak130
Field Researcher

Join Date: Apr 2013
Posts: 269
Thanks: 2645 in 18 Posts
17 Achievements


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
Last edited by gamefreak130 : 2nd Dec 2020 at 10:15 PM.
Reply


Section jump:


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