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!
Senior Moderator
staff: senior moderator
#26 Old 6th Oct 2020 at 1:45 PM
Nice to know that you can name the routing slot whatever you like and use the hash like that
With regards to the errors, it seems like you might have to functions that are called the same thing? And maybe you have defined the PracticeYoga interaction twice, or something like that.

I really wonder why it is crashing, I think it would be worth taking a step back if you haven't already, and just having it display a notification in the Run function or something to start with. If it works fine, try adding in the routing code, and see if your sim successfully routes there, then if everything is all good build up the next parts of your code. 
Having it display debugging notifications after each stage like Lyralei did will mean you can know each line is going well. But if it's crashing to desktop then you won't be able to see them, so that's why I think it would be good to just try out each bit at a time
Advertisement
Lab Assistant
Original Poster
#27 Old 19th Oct 2020 at 1:59 PM
Okay, I managed to find an older version of my code that has no errors and doesn’t crash the game. It ran perfectly fine as well. But this does put me right back where I started before adding a routing slot to my yoga mat...

Could there be an issue with the object I cloned? Maybe the game doesn’t like sims trying to route to that object? It’s the small glass atrium plant from the base game. I’ll have to double check, but I’m pretty sure I changed the flags so you can’t place the mat on a table anymore. That’s the only other thing I can think of right now.
Senior Moderator
staff: senior moderator
#28 Old 19th Oct 2020 at 3:51 PM
I'm really not sure what would make the game crash, but by adding one thing at a time, it will either work right, or you will know what it is that's causing the problem
Virtual gardener
staff: administrator
#29 Old 19th Oct 2020 at 6:37 PM
Heya! Would you be able to attach the solution to the thread maybe? That way it's easier to compile it and debug it regarding crashes

But you do want to make sure that the slot you defined in the code is a hashed version in the RIG as well as the RSLT. Although most crashes are *usually* either code related or the bones are somehow corrupted
Lab Assistant
Original Poster
#30 Old 20th Oct 2020 at 1:09 AM
Here's the most recent version. I managed to resolve the two errors I mentioned before, but it still crashes.
Attached files:
File Type: rar  Alunn_YogaMat.rar (565 Bytes, 5 downloads)
Virtual gardener
staff: administrator
#31 Old 26th Oct 2020 at 11:18 AM
Super late! But Unfortunately I couldn't open the workspace since it's missing the cs files and such. 

Now, rereading the code you've posted, I really think it's a bone or slot that isn't assigned properly. Because the game does tend to throw it's hands up (that is if it had any :p) and possibly screams internally whenever those things aren't fully done properly or return a null value.
Lab Assistant
Original Poster
#32 Old 28th Oct 2020 at 10:13 AM
Sorry about that! I've reuploaded it correctly now and I also included my latest package file.
Attached files:
File Type: rar  Alunn_YogaMat.rar (9.11 MB, 11 downloads)
Lab Assistant
Original Poster
#33 Old 30th Nov 2020 at 1:59 AM
Well, it’s been a month since my last post and this routing slot is really kicking my ass. I tried using a chair as a base and altering one of those routing slots, but the mod still crashes my game on startup. Any ideas?
Senior Moderator
staff: senior moderator
#34 Old 30th Nov 2020 at 1:55 PM Last edited by zoe22 : 30th Nov 2020 at 7:14 PM.
I had a quick look, and I think the problem is with the script. I tried loading the game with the script imported into one of my packages that I know has a working routing slot, as well as the clips and jazz file from your yoga mat package and the game still crashed, but without the script, it loads. 

I know it feels like you're going back on your progress by stripping everything right back, but you're not really because you do have the code written - it's just a matter of singling out what is causing the problem.
I really think it's best to start afresh - keep all your current files in a backup, including your final code, and clone a new object and start with a really basic script.

One thing you could do is actually start with getting the routing slot correct. So first check the object and basic script with a notification to show it's working, then add in the routing slot and in your code route to the slot and put another notification, and check in game. Then if your sim correctly routes to the spot, add in the animations and jazz and add that part of the code and test again.
Then add in the skill gain stuff.

I can investigate further too, but what I have just said is basically what I would try myself. And it's really the only way unless someone can spot specifically what is causing the problem. But that can also take just as long anyway if you're trying loads of different things to fix it :P

EDIT: okay so Actually I think the problem is that when you created your project, you selected .NET Standard instead of .NET Framework :P
So you will either need to start a new project and do all the visual studioey things, or use Sharp Develop again (though I can't help with setting up because I've never used it myself) and copy your code over. And hopefully it should work! 
edit again: the routing slot isn't working for some reason, but at least it doesn't crash! Now the next step is going to be working that out..
Lab Assistant
Original Poster
#35 Old 6th Dec 2020 at 8:26 AM
Alright, I've got good news and bad news. The good news is after following zoe22's advice and creating my project as .NET Framework, the code works great! No more crashing to desktop. The bad news is the routing slot is a pain in the ass. No matter what I do, my sim can't properly route to the mat.

The little speech bubble above their head indicates that the yoga mat itself is in the way, which is weird because its a rug (although I can't find the rug flag in s3pe, maybe the tsrw flag isn't sticking?). The same thing happened when I made the routing slot higher so it was above the height of the mat.

I guess the silver lining is that one time when I changed the position of the routing slot, I accidentally moved the routing slot behind the rug instead of on top of it and my sim routed to that spot and the animations started just fine. So the problem seems to be with getting the sims to stand on top of the mat without complaining. Though I have no idea how to do that *sighs*
Senior Moderator
staff: senior moderator
#36 Old 6th Dec 2020 at 4:19 PM
Yeah, I think it is a problem with the routing slot intersecting with the footprint(s). However, when I edited it so it should allow for sims to intersect with the footprints it still didn't work :/
So I'm not sure what else to try
Forum Resident
#37 Old 8th Dec 2020 at 5:30 AM
@Alunn I hope this doesn't sound incredibly tacky, especially since it probably feels like you're at your wit's end with that routing slot issue (Hopefully a solution will present itself soon ), but do you plan to release your yoga mod once everything gets sorted out? Yoga is one of my favorite activities for Sims to do. Kat's is nice and all, but yours sounds great!

You have been chosen. They will come soon.
Lab Assistant
Original Poster
#38 Old 8th Dec 2020 at 2:31 PM
@Jathom95 Not tacky at all Yes, my ultimate plan is to release my mod. Though I'm thinking that I may release it as an alpha version with a companion thread once I get the routing issue ironed out to have others test it and provide feedback.

I still haven't decided how best to structure the mat's interactions. Do I make interactions for different levels of skill like Kat (basic, intermediate, and expert)? Do I just have the one 'Practice Yoga' interaction where sims unlock new poses as they increase their athletic skill or is that too boring? Do I make different yoga routines each with their own interaction? What the hell am I gonna do about moodlets?? Idk yet. I'd love to get some opinions on it, but as Lyralei said, I should probably get it working first before getting too ahead of myself. It appears I'm back to the drawing board on that
Forum Resident
#39 Old 8th Dec 2020 at 2:58 PM
Well, the TS4 mat from what I've seen online has a "Practice Yoga" interaction, which cycles through poses randomly for a set amount of time. There's also a "Pose..." where you can specifically select one pose for them to do. The only one that probably wouldn't make much difference is the "Do a Yoga Routine" one, since it involves TS4's emotions system. Things like Energy Centering, Mind Concentrating, etc. I dunno, it might could translate to TS3 somehow. And, you unlock more poses as you level up the skill along with Sims making fewer mistakes with the poses.

Could be a starting point. It's really just however you want to tackle it. Personally, even though I've used Kat's for years, I do like the sound of having a little more control over what they choose to do, like what I've listed above.

You have been chosen. They will come soon.
Lab Assistant
Original Poster
#40 Old 8th Dec 2020 at 5:12 PM
Yeah my current 'Practice Yoga' interaction is pretty much the same as the TS4 one, I also managed to loop the poses randomly to keep things fresh. I guess my hesitation with a 'Pose...' interaction is that it would require a nested interaction and separate interactions for each pose (which I think is about 10 or so). Considering this is my first stab at modding, I feel like I might mess something up. I think I'd do better focusing on making the progression of practicing yoga more interesting, like having them fail poses at lower levels and slowly improving over time.

At one point I considered doing a straight conversion of the 'Do a Yoga Routine' interaction, but when I tried them out in TS4, every routine did the same thing as the 'Practice Yoga' interaction but gave my sim a different emotional state, which wouldn't really make much sense in TS3. I guess I could give each routine a different set of poses, possibly based off of real yoga routines? I've also thought about a routine specifically for pregnant sims so they're not trying to do handstands in their third trimester lol
Forum Resident
#41 Old 8th Dec 2020 at 6:24 PM
@Alunn This could be a little tricky to get just right, but I just had a great idea for how "Do a Yoga Routine" could still be useful. Tie it to motives instead of emotions. Some could even be different from the TS4 versions. Something like this:

Do a Yoga Routine>
- Energy Centering (Same as TS4, but slightly builds energy motive instead of giving an energized emotion.)
- Stress Relieving (Fun)
- Mind Balancing (Social. Couldn't think of a good name for that one, tentative. But the idea is that you'd be getting in touch with yourself through the routine, thereby making you feel more at peace about your life and interactions with others around you.)

Could possibly even have it where a certain routine gets rid of negative moodlets more quickly. i.e. Stress Relieving for "Stressed"

I'd say hunger as one, but that'd really make more sense if it could be slowed down vs gaining hunger from yoga for a set period. I don't suppose that sort of thing could be influenced?

Motives might be a difficult thing to implement on top of everything else, but I think this is a great way to separate this version from TS4's and make it more unique.

You have been chosen. They will come soon.
Lab Assistant
Original Poster
#42 Old 9th Dec 2020 at 11:28 AM
Those are great ideas @Jathom95! If I can get the coding right I'm definitely using them.

I also finally figured out what was up with the routing slot. The game didn't like the fact that the object footprint and the routing slot overlapped, so I just shifted the object and the routing slot over a bit. The footprint looks off when you place the object down, but it rotates fine and the sim no longer route fails.

In testing I noticed that there's a point in the animation cycle were the sim steps out of position, only to snap back in a moment later, so my next step is fixing that up. After that I need to make the sims change into their athletic wear before using the mat and possibly take their shoes off like they do before they fire walk. I also need to read up on adding buffs after sims do yoga and look into the motive increasing Jathom suggested. There's a lot left to do but I'm making progress.
Forum Resident
#43 Old 9th Dec 2020 at 8:29 PM
Quote: Originally posted by Alunn
I also finally figured out what was up with the routing slot. The game didn't like the fact that the object footprint and the routing slot overlapped, so I just shifted the object and the routing slot over a bit. The footprint looks off when you place the object down, but it rotates fine and the sim no longer route fails.


That's great! I knew you could do it.

On a different subject, did I read correctly that you converted the actual animations from TS4 as well? So excited to see where you go with this.

You have been chosen. They will come soon.
Lab Assistant
Original Poster
#44 Old 10th Dec 2020 at 9:14 AM Last edited by Alunn : 10th Dec 2020 at 10:33 AM.
Yes, the animations are from TS4. Here's the link in case anyone who runs across this thread wants to use it.

Got the sims to change into athletic wear before starting yoga, but no success yet on the removing shoes part. I found the line I need, though I'm not sure where in the code to put it or if it'll work considering I already have sims changing into athletic wear.

Code:
public static string kSpecialOutfitName = "FirewalkBarefoot";


There's also this line which may be useful. Again, not sure where to put it.

Code:
SetupOutfitSwapIfNeeded();


Edit: Now this is just a thought but... how hard would it be to make yoga a hidden skill? I was thinking about how sometimes you may want to have a sim that does yoga, but doesn't like jogging or getting absolutely yoked at the gym. But if I tied yoga progression to the athletic skill, you'd kinda be forced into gaining points in it if you want more poses. Then again, I am the equivalent of a newborn when it comes to modding, so this could very well be me trying to bite off more than I can chew. Any thoughts on this?
Forum Resident
#45 Old 10th Dec 2020 at 5:06 PM
Quote: Originally posted by Alunn
Edit: Now this is just a thought but... how hard would it be to make yoga a hidden skill? I was thinking about how sometimes you may want to have a sim that does yoga, but doesn't like jogging or getting absolutely yoked at the gym. But if I tied yoga progression to the athletic skill, you'd kinda be forced into gaining points in it if you want more poses. Then again, I am the equivalent of a newborn when it comes to modding, so this could very well be me trying to bite off more than I can chew. Any thoughts on this?


Hmm, Lyralei added a custom sewing skill with her Sewing mod, so she might have a pretty good idea. Hers is a full-fledged skill, though I imagine making it hidden wouldn't be much more difficult, but I really have no idea.

You have been chosen. They will come soon.
Virtual gardener
staff: administrator
#46 Old 11th Dec 2020 at 7:21 PM
Quote: Originally posted by Jathom95
Hmm, Lyralei added a custom sewing skill with her Sewing mod, so she might have a pretty good idea. Hers is a full-fledged skill, though I imagine making it hidden wouldn't be much more difficult, but I really have no idea.
Making it hidden is super easy actually! All you need to do is change the <hidden=false> to true (this can be found inside your skill's xml file

Feel free to check out the github page and the package though to see how I did it  I did, however, had to modify EA's importing code for the skill's importing system though: https://github.com/Lyralei1/SewingT...sSewingTable.cs

(See OnPreload())

Anything else, you can find here: https://github.com/Lyralei1/SewingT.../SewingSkill.cs
And an easy tutorial: http://www.simlogical.com/ContentUp...e/uploads/1915/
Forum Resident
#47 Old 12th Dec 2020 at 5:55 AM
Quote: Originally posted by Lyralei
Making it hidden is super easy actually! All you need to do is change the <hidden=false> to true (this can be found inside your skill's xml file


Good to hear. Thanks for confirming.

Honestly, with how well this mod is developing, it makes wish meditation worked the same as TS4 as well, and we already have that with WA.

I hate how in TS3 you have to level up Martial Arts to use it. I know what they were going for, but mindfulness can be practiced by anyone. I'd love to have my Sims in TS3 who aren't MA inclined to be able to meditate alongside yoga before work or something like that. Ah well.

You have been chosen. They will come soon.
Lab Assistant
Original Poster
#48 Old 12th Dec 2020 at 10:04 AM
I've actually been using this mod so all of my sims can meditate. If I can get a hidden skill working, I could try tuning the mod so sims gain points meditating as well. Also, thanks for the links @Lyralei. I knew I had seen a tutorial for hidden skills somewhere but I could never get back to it.

The skill wouldn't be anything too crazy; most likely 3-5 levels with two or three poses unlocking each level, sort of like the roller/ice skating skill. But first I want to try implementing some of the motive gaining interactions. I dug around in the .dll files trying to find some code I could *ahem* borrow and I think I'm on the right track. I have no idea where to put it or how to trigger the motive gain yet.

Code:
From Grotto HotTub

public override float HotTubHygieneGainPerHour => kHotTubHygieneGainPerHour;

public override float HotTubDestressAmount => kHotTubDestressAmount;

[Tunable]
[TunableComment("Range: Positive floats.  Description: How much hygiene Sims gain per sim hour when in the HotTub posture.")]
public new static float kHotTubHygieneGainPerHour = 40f;

[TunableComment("Range: Positive floats.  Description: Normal Amount Sims gain fun (de-stress) per sim hour when in the hot tub.")]
[Tunable]
public new static float kHotTubDestressAmount = 65f;


General
public float EnergyGainRate = float.MinValue;
Forum Resident
#49 Old 28th Dec 2020 at 5:19 PM
Just checking in. Any progress with the motive gains?

You have been chosen. They will come soon.
Lab Assistant
Original Poster
#50 Old 2nd Jan 2021 at 4:11 AM
Quote: Originally posted by Jathom95
Just checking in. Any progress with the motive gains?

Nothing much on the coding front yet, but I’m still working on it. I’ve mostly been writing out how I want to structure the skill and the different animations per level in the jazz script. Hopefully I can get back in VS soon and actually test some of this stuff out.
Page 2 of 5
Back to top