- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Making a custom interaction raise a need
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Making a custom interaction raise a need
Replies: 5 (Who?), Viewed: 399 times.
#1
2nd Dec 2020 at 5:27 PM
Posts: 978
Thanks: 1928 in 13 Posts
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
#2
2nd Dec 2020 at 5:41 PM
Posts: 768
Thanks: 8158 in 12 Posts
Something along those lines:
The range goes from -100f to 100f
Code:
createdSim.Motives.SetValue(CommodityKind.Fun, -100f);
The range goes from -100f to 100f
#3
2nd Dec 2020 at 6:36 PM
Posts: 437
Thanks: 5336 in 22 Posts
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:
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.
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
If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
#4
2nd Dec 2020 at 6:38 PM
Posts: 978
Thanks: 1928 in 13 Posts
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
#5
2nd Dec 2020 at 6:44 PM
Posts: 978
Thanks: 1928 in 13 Posts
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
#6
2nd Dec 2020 at 7:59 PM
Last edited by gamefreak130 : 2nd Dec 2020 at 9:15 PM.
Posts: 437
Thanks: 5336 in 22 Posts
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
If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Who Posted
|