- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- add of buffs and thought balloons to motive
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- add of buffs and thought balloons to motive
Replies: 12 (Who?), Viewed: 986 times.
#1
6th Dec 2020 at 1:34 PM
Posts: 156
add of buffs and thought balloons to motive
Hello, need advice please, I figured out how to do it, but there is a problem, why are toddlers crying, when have buff hungry, but they thought to very hungry, please help where is that written? thanks in advance
Advertisement
#2
6th Dec 2020 at 5:14 PM
Posts: 978
Thanks: 1925 in 13 Posts
I can't help with your question, but I'd love to know how to do this -- add buffs and thought balloons to motive.
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
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
#3
8th Dec 2020 at 4:28 PM
Posts: 156
Quote: Originally posted by echoweaver
I can't help with your question, but I'd love to know how to do this -- add buffs and thought balloons to motive. |
it is difficult, a lot of work
By thread: I think it's because of the class ScoringFunctionsForBabiesAndToddlers.
#4
10th Dec 2020 at 6:59 PM
Posts: 156
Quote: Originally posted by echoweaver
I can't help with your question, but I'd love to know how to do this -- add buffs and thought balloons to motive. |
I will definitely help you, only after we make the Toddlers not exaggerate
#5
10th Dec 2020 at 11:12 PM
Posts: 978
Thanks: 1925 in 13 Posts
Quote: Originally posted by whiteman-Dara
I will definitely help you, only after we make the Toddlers not exaggerate |
Actually, my mods involve cats right now. I'm perfectly happy working only with adult and elder pets.
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
12th Dec 2020 at 9:55 AM
Posts: 156
Judging by the code written
and in balloons.xml
but for some unclear reason, he reads the code from:
a also red thought balloon.
Code:
public static void ThoughtBalloonBabyCrying(Sim sim, BuffNames buffName) { ThoughtBalloonManager.BalloonData balloonData = null; if (buffName <= BuffNames.Lonely) { if (buffName <= BuffNames.Exhausted) { if (buffName != BuffNames.ReallyHasToPee) { if (buffName != BuffNames.Desolate) { if (buffName == BuffNames.Exhausted) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffExhausted", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffDesolate", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffReallyHasToPee", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else if (buffName <= BuffNames.HasToPee) { if (buffName != BuffNames.Grungy) { if (buffName == BuffNames.HasToPee) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffHasToPee", sim); } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffSmelly", sim); } } else if (buffName != BuffNames.Hungry) { if (buffName == BuffNames.Lonely) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffLonely", sim); } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffHungry", sim); } } else if (buffName <= BuffNames.Starving) { if (buffName != BuffNames.Sleepy) { if (buffName != BuffNames.Smelly) { if (buffName == BuffNames.Starving) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffStarving", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffSmelly", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffSleepy", sim); } } else if (buffName <= BuffNames.VeryHungry) { if (buffName != BuffNames.Tired) { if (buffName == BuffNames.VeryHungry) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffVeryHungry", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffTired", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else if (buffName != BuffNames.Scared) { if (buffName == BuffNames.CryingBaby) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffCryingBaby", sim); } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffScared", sim); } if (balloonData != null) { balloonData.mPriority = ThoughtBalloonPriority.High; balloonData.Duration = ThoughtBalloonDuration.Medium; sim.ThoughtBalloonManager.ShowBalloon(balloonData); } }
and in balloons.xml
Quote:
<Idle> <IdleKey>BuffHungry</IdleKey> <BalloonName>balloon_moodlet_hungry</BalloonName> </Idle> |
but for some unclear reason, he reads the code from:
Quote:
<Idle> <IdleKey>BuffVeryHungry</IdleKey> <BalloonName>balloon_moodlet_veryHungry</BalloonName> </Idle> |
a also red thought balloon.
#7
15th Dec 2020 at 6:57 PM
Posts: 156
thought balloon "hunger" don't work. When I edit a snippet of code
on
I get change of thought balloon in buffs hunger and very hunger, @Lyralei what do you think about that?
Code:
if (buffName == BuffNames.VeryHungry) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffVeryHungry", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; }
on
Code:
if (buffName == BuffNames.VeryHungry) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffHungry", sim); }
I get change of thought balloon in buffs hunger and very hunger, @Lyralei what do you think about that?
#8
16th Dec 2020 at 12:11 PM
Last edited by Lyralei : 16th Dec 2020 at 12:17 PM.
Reason: forgot to close the bracket.. woops!
Posts: 3,860
Thanks: 8537 in 67 Posts
@whiteman-Dara ,
In your post where you're posting the entire function, it all seems like it should work. But only IF you parse in the correct buffname
How are you calling this function? Like so?
Hope this helps!
In your post where you're posting the entire function, it all seems like it should work. But only IF you parse in the correct buffname
How are you calling this function? Like so?
Code:
Also, note that you've noted the 'hungry' one wrong ThoughtBalloonBabyCrying(base.Actor, BuffNames.VeryHungry);
Code:
You initially had the BuffNames as 'VeryHungry'. So the code would never have reached the 'hungry' code at all due to it.if (buffName == BuffNames.Hungry) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffHungry", sim); }
Hope this helps!
#9
16th Dec 2020 at 2:00 PM
Posts: 156
Lyralei, No, Like so!
This snippet does not work for at me no matter what I write. Thought balloon It remains the same.
Is it possible learn more about this.
Code:
public override void ThoughtBalloon(Sim sim, bool isDistress)
{
ToddlerBuffIdleAnimationData.ThoughtBalloonBabyCrying(sim, this.mBuffInstance.Guid);
}
Quote:
Also, note that you've noted the 'hungry' one wrong |
Quote:
Code:
if (buffName == BuffNames.Hungry) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffHungry", sim); } |
Quote:
You initially had the BuffNames as 'VeryHungry'. So the code would never have reached the 'hungry' code at all due to it. |
Is it possible learn more about this.
#10
17th Dec 2020 at 1:59 PM
Last edited by Lyralei : 17th Dec 2020 at 2:05 PM.
Reason: Forgot to add the ShowBalloon, which fires the balloon stuff to begin with
Posts: 3,860
Thanks: 8537 in 67 Posts
I will be honest, I'm a bit confused about how this is all linked together (Like, which variables are being parsed in by your code and that it's a problem there, etc). Would you be able to share the .cs file of your code?
I also will be honest (Because the original ThoughtBalloonBabyCrying()) is weirdly set up by EA to begin with :p If I were you, I'd actually go as far as doing the following yourself:
I also will be honest (Because the original ThoughtBalloonBabyCrying()) is weirdly set up by EA to begin with :p If I were you, I'd actually go as far as doing the following yourself:
Code:
And, from there just expand the code That's what I usually do, the core goal is "Baby needs to have balloon thought bubble thing" You first start there. Test it in-game, then continue 'grow' the code for 'If the commodity type is hungry, then we use our own function', etc, etc, etc Because if you start doing ALL the things at once, it won't really help the progress (When I started doing scripting, I did this very badly and it never really worked out)
public static void ThoughtBalloonForCryingBabies(Sim sim, BuffNames buff) { if (buff == BuffNames.Hungry) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffHungry", sim); sim.ThoughtBalloonManager.ShowBalloon(balloonData); } if (buff == BuffNames.VeryHungry) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffHungry", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; sim.ThoughtBalloonManager.ShowBalloon(balloonData); } } // No idea how you're doing this, but say, you apply this within your Run() function: public bool Run() { ThoughtBalloonForCryingBabies(base.Actor, BuffNames.Hungry) }
#11
19th Dec 2020 at 6:50 AM
Posts: 156
I went to research, and corrected the method to look like this.
To make new motives working, i fix the next method.
But a the motives: hungry, very hungry, starving, tired, sleepy. They do not have thought balloons.
Code:
ThoughtBalloonManager.BalloonData balloonData = null; if (buffName <= BuffNames.Lonely) { if (buffName <= BuffNames.Exhausted) { if (buffName != BuffNames.ReallyHasToPee) { if (buffName != BuffNames.Desolate) { if (buffName == BuffNames.Exhausted) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffExhausted", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffDesolate", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffReallyHasToPee", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else if (buffName <= BuffNames.HasToPee) { if (buffName != BuffNames.Grungy) { if (buffName == BuffNames.HasToPee) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffHasToPee", sim); } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffSmelly", sim); } } else if (buffName != BuffNames.HungryToddler) { if (buffName == BuffNames.Lonely) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffLonely", sim); } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffHungry", sim); } } else if (buffName <= BuffNames.StarvingToddler) { if (buffName != BuffNames.Sleepy) { if (buffName != BuffNames.Smelly) { if (buffName == BuffNames.StarvingToddler) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffStarving", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffSmelly", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffSleepy", sim); } } else if (buffName <= BuffNames.VeryHungryToddler) { if (buffName != BuffNames.Tired) { if (buffName == BuffNames.VeryHungryToddler) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffVeryHungry", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffTired", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } else if (buffName != BuffNames.Scared) { if (buffName == BuffNames.CryingBaby) { balloonData = ThoughtBalloonManager.GetBalloonData("BuffCryingBaby", sim); } } else { balloonData = ThoughtBalloonManager.GetBalloonData("BuffScared", sim); } if (balloonData != null) { balloonData.mPriority = ThoughtBalloonPriority.High; balloonData.Duration = ThoughtBalloonDuration.Medium; sim.ThoughtBalloonManager.ShowBalloon(balloonData); } }
To make new motives working, i fix the next method.
Code:
public bool IsHungry() { Motive motive = null; if (this.mMotives.TryGetValue(17774807, out motive)) { foreach (MotiveTuning.MotiveBuffTrigger current in motive.Tuning.BuffTriggers) { if (motive.Value <= Math.Max(current.mTriggerValueEnd, current.mTriggerValueStart) && motive.Value >= Math.Min(current.mTriggerValueEnd, current.mTriggerValueStart)) { bool result; if (this.mSim.Toddler) { result = (current.mAddBuff == BuffNames.HungryToddler || current.mAddBuff == BuffNames.VeryHungryToddler || current.mAddBuff == BuffNames.StarvingToddler); return result; if (this.mSim.IsPet) { result = (current.mAddBuff == BuffNames.HungryPet || current.mAddBuff == BuffNames.VeryHungryPet || current.mAddBuff == BuffNames.StarvingPet); return result; } result = (current.mAddBuff == BuffNames.Hungry || current.mAddBuff == BuffNames.VeryHungry || current.mAddBuff == BuffNames.Starving); return result; } } return false; } return false;
But a the motives: hungry, very hungry, starving, tired, sleepy. They do not have thought balloons.
#12
21st Dec 2020 at 9:55 PM
Posts: 3,860
Thanks: 8537 in 67 Posts
I'd in your case just use print statements on every line. See which if statement they pass. Sometimes that can even be surprising :p Because I can't seem to see a reason why it wouldn't work (But again, that's partially since only snippets are being shared here rather than the project itself or even not really knowing what you're trying to code here, thus it's a bit difficult to figure out how things are called and when the interactions are fired)
So, as an example:
In case you're wondering how to make a simple print function, here you go:
If you do want to share your project (Which I highly recommend), here's a tutorial on how to do this: https://www.youtube.com/watch?v=kFZGq5etfMw
If you don't want to share it with others, I completely understand! Feel free to PM me if that's the case Else you can attach it to the thread here!
So, as an example:
Code:
Etc. Etc..if (buffName <= BuffNames.Exhausted) { print("Is Less or equal to exhausted"); if (buffName != BuffNames.ReallyHasToPee) { print("Is NOT ReallyHasToPee"); if (buffName != BuffNames.Desolate) { print("Is NOT Desolate"); if (buffName == BuffNames.Exhausted) { print("IS Exhausted"); balloonData = ThoughtBalloonManager.GetBalloonData("BuffExhausted", sim); balloonData.BalloonType = ThoughtBalloonTypes.kScreamBalloon; } } }
In case you're wondering how to make a simple print function, here you go:
Code:
In theory it should use the XML file that EA provided. But again, I have no idea what the general project looks like, that I also don't know how to help you on how to fix this. And I hope that with print statements you might get somewhere on understanding your code. public static void print(string text) { StyledNotification.Show(new StyledNotification.Format(text, StyledNotification.NotificationStyle.kDebugAlert)); }
If you do want to share your project (Which I highly recommend), here's a tutorial on how to do this: https://www.youtube.com/watch?v=kFZGq5etfMw
If you don't want to share it with others, I completely understand! Feel free to PM me if that's the case Else you can attach it to the thread here!
#13
24th Dec 2020 at 7:12 PM
Posts: 156
Unfortunately it didn't work, there two buffs left, and the problem is not here this method.
Who Posted
|