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 25th Oct 2014 at 6:07 PM Last edited by Arsil : 10th Nov 2014 at 7:59 PM.
Default Japanese Style Low Dinner Table - Mod Design
Hello again.

I'd like to create a mod that allows to dine in a low table without sitting on chairs but kneeling on the ground.
I think it's called Kotatsu in japanese and there was something like this in Sims 2 (never played that game).

Not necessarily this low table must allow to eat any food like a normal table (I guess that would be very hard
to achieve), it's ok even if it allows to eat only some given food (and having tea would be great too).

I'd like advice on how to design the mod: where to start, what to do first, how to proceed, etc.
Design and software engineering are not my strong points (I'm not implying that coding is),
I usually start coding and then think about what I'm doing, but this time I could use some planning.

I can think of several different approaches:
- start from scratch assigning a custom class to a low table (coffee table?) and creating interactions and animations
- clone a picnic blanket and start working from there (the low dinner table could work like that and use it as reference)
- try to make [certain] low tables equivalent to normal dinner tables (this should allow to eat any kind of food there, but
honestly I don't think I can do this and if there's no way to re-use existing eating animations maybe it's not worth it).

I'm not sure about using only a table or also flat pillows (cloned rugs) as "chairs" that can be handy for routing also.

I already made a kneeling animation. It still sucks and doesn't look natural, I mostly focused on keeping the feet
on ground-level in all frames, that is very hard to do, maybe I'm missing some trick or option with MilkShape.

I think I'll start with an existing table without caring about creating a new mesh (I'm not good at that anyway).
There is one very nice HERE, converted from TS2 if I'm right

but I doubt the author will give permission to use and modify it (anyone speaks russian here?).
Besides, the object has some flaws (it can be placed inside walls for example, but that should be easily fixable)
and the futon (or whatever is called) will cause a lot of clipping with sims' legs.
The pillows are separate objects.

I'd also like to create at least one custom food (white rice). I was really close to do it (cloning the rice from
the teppanyaki grill): it was added to food registers and FutureFoodSynthetizers but not to fridges, and
it was stubbornly using a plate instead of a bowl. Someday I'll try again starting from scratch with a
cloned basegame food (I know it can't be cloned directly but you know that I mean).

OT: since I like Japanese culture, I'd also like to create a floor-level bed cloning the sleeping bag from Generations
(I already verified it can be used in basegame without the EP installed) and replacing the mesh of the "rolled"
bed (the bag) with an open one with just the sheet/cover rolled so the existing animation will still make sense
(well, of course I can't redistribute an animation taken from an EP, so I'll have to make a custom one).
Too bad this kind of bed wont allow any other interaction than sleeping.

Sorry, usually I write a bit better that this, but when I get excited I tend to translate directly from my first
language without thinking about the different rules of english grammar.
Advertisement
Inventor
Original Poster
#2 Old 26th Oct 2014 at 9:45 PM Last edited by Arsil : 10th Nov 2014 at 7:58 PM.
This might seem OT but it's not.




The pillow/chair can be found HERE.

How is possible that the sim sits correctly in the pillow/chair?
The sitting animation plays flawlessly and adapts to the custom height.
Is the sim's butt linked to the specific chair's slot or rig or both?
Even the arms and hands adapt to that "new" pose, how do they do that? Is that magic?
EDIT: forget it, it messes some animations so I'm not interested in that anymore.

Can this work with a bed too in order to have a floor-level bed
(without feet sinking in the ground)?

Can something like this work to create a low dinner table?
Well, I still want sims to knee and not sit, so the animation has to be a custom one anyway
and since animation overlays are still a "misteryous mistery" there's no way to re-use the
existing eating animations (I think they are all the same, be the sim standing or sitting...
EDIT: nope, there are at least 3 versions: standing, sitting and sitting in a bar stool).

I feel like I'm asking noob questions here, did I miss a meeting or something? ^^
But if these are well known things, I wonder why no-one has ever taken full
advantage of these potentialities, at least for beds or tables.
Of course I may be wrong. Hell, usually I'm wrong.
Inventor
Original Poster
#3 Old 27th Oct 2014 at 10:50 AM Last edited by Arsil : 27th Oct 2014 at 11:06 AM.
Quote:
- try to make [certain] low tables equivalent to normal dinner tables (this should allow to eat any kind of food there, but
honestly I don't think I can do this and if there's no way to re-use existing eating animations maybe it's not worth it).


If what I said (well, more like asked) on the previous post can be applied to tables too, then perhaps
using the opposite approach is better: take a normal dinner table and make it lower/shorter by
remeshing it and changing its slots accordingly.

If that works, the first step for this mod would be to try to make a chair that is like a normal chair in
all aspects except that it shouldn't be tucked/un-tucked under the table and uses custom animations
for sitting (kneeling) and standing. I think I'll use a 1x1 tiles rug to make the chair/pillow.

If that is possible then "the mod will be really easy to do"
(Arsil, 27th Oct 2014, 09:40 am, those were his last words, we never heard about him again).

EDIT

Nay, nay, nay, there's no way that can work because anyway I can't use the existing eating
animations if the sim is kneeling instead of sitting. I have to create a whole separate system,
like the one used by the picnic blanket, there are no shortcuts.

But somehow I'll do this mod or I'll die trying... or more likely I'll give up after 10 minutes.

By the way, someone already tried to make a ground-level bed? Not yet? Not at all?
(I know there are beds that you can "lower" like wall pictures, but I don't want sinking feet).
Inventor
Original Poster
#4 Old 27th Oct 2014 at 7:21 PM Last edited by Arsil : 29th Oct 2014 at 2:07 PM.
If moderators forgive my multi-posting, I'll keep replying to myself.

There's something wrong with the animation I had done in hours of work: it looks fine
in MilkShape but in game the sim just moves his arms like an idiot without kneeling.
Did that discourage me? Hell yeah! Did that stop me? Not today, modderf*er.
After cursing in ancient languages for half an hour, I did a quick temporary animation.

I cloned TableCoffeeColonial (a basegame - 2x1 tiles - low table), like a dinner
table it should contain a max of 6 sims, but I'm not sure, looking at the screenshots
seems too small. I created a simple class for this cloned object, I called it
JapLowDinnerTable, and after a bit of back and forth here's the result:



The sim is too far from the table, but that's a detail in this early phase.
The routing to the table is done using the object position, but to make it usable
by more sims at the same time I need routing slots and I don't know how to do them
I'll think about that later.

I haven't looked at how the game chooses a spot for a sim to sit/eat, I was thinking
about trying the closest spot first and then using a coin-flip to choose if rotate
clockwise or anti-clockwise to search next spots.

Next step? Mmmm... I have to think about it.

I promise I'll use more fitting sims when I have something more presentable,
this is a random generated one I use for testing. By the way, thanks to armiel
for her Builder's Island, that really reduces loading times.
Inventor
Original Poster
#5 Old 28th Oct 2014 at 5:14 PM Last edited by Arsil : 31st Oct 2014 at 8:56 PM.
It's coming along nicely, I'm very happy.

I created a quick and unrefined standing animation and an idle animation
which is 1 frame only, basically a pose, but for now that will suffice.
I'll refine all animations only toward the end of the project.

I managed to make the table usable by more sims simultaneously even
without routing slots (they route fail a lot though). I used a crappy algorithm
to chose the spot that checks spots always in the same order. I'll try to refine
that later - with or without using routing slots - checking the closest (to the sim)
spot first and then the others to find a free one.

I added a custom posture. I wasn't sure if that was needed but that revealed
as a surprisingly winning move because it allows sims to chat with each other
while they are kneeled at the table and also prevents other unwanted interactions
(those that require a standing sim). Talking animations play very well, just the
arms jerk when transitioning from the talking/listening animation to my idle
animation/pose, fixing the arms' position in the latter should solve that.

Now the bad news.

I'm having troubles with my jazz script, so right now I'm using PlaySoloAnimation
instead for kneeling and standing, but I absolutely have to use a jazz script.
The GroupTalk interaction is not working either (and I don't understand why
its name isn't localized), that was just copy/pasted from PicnicBasket with
very little adjustment needed. Probably that's a jazz script issue too because
it uses the same state machine (at least so it seems to me). EDIT: yes, this
interaction is not working because it requires states not defined in the jazz
script... and also because the jazz script itself is not working in the first place.

Do you see something wrong here? (all that crap like "Unknown value..." etc
is added when you save the script, for reading sake I'm posting the clean version)
[I'm using QUOTE because I don't appreciate the extra line added by the
CODE tag, the indentation is lost but it's still readable]
Quote:
State Machine "JapLowDinnerTable"
{
Properties Default
Priority Normal
Actor "x"
Assign Actor "a_JapLowDinnerTable_kneel.ma"."" as "x"
Assign Actor "a_JapLowDinnerTable_stand.ma"."" as "x"
Assign Actor "a_JapLowDinnerTable_loop.ma"."" as "x"

State "Enter"
{
Properties Public, Entry, Explicit
Transitions to "Idle"
Transitions to "Exit"
Play "a_JapLowDinnerTable_kneel" for "x"
{
Flags AtEnd
Blend in 0.2
}
}

State "Idle"
{
Properties Public, Explicit
Transitions to "Exit"
Play "a_JapLowDinnerTable_loop" for "x"
{
Flags AtEnd, LoopAsNeeded
Blend in 0.2
}
}

State "Exit"
{
Properties Public, Exit, Explicit
Play "a_JapLowDinnerTable_stand" for "x"
{
Flags AtEnd
Blend in 0.2
}
}
}

This is how I initialize and call it
Quote:
this.AcquireStateMachine("JapLowDinnerTable");
this.SetActor("x", this.Actor);
this.AnimateSim("Enter");

When this.AnimateSim("Enter") is executed the interaction ends abruptly (with no errors).
EDIT: Solved using this.EnterState instead.

Once I fix this, I'll face the eating part of the mod.
That can be the easiest as well as the hardest one.

EDIT
Got it. It was a stupid mistake on my part.

At first I used the suffix "_x" for animations' names (example: a_JapLowDinnerTable_kneel_x)
but I was getting a weird error that I thought was related to that (it definitely wasn't), so I
removed it (example: a_JapLowDinnerTable_kneel) and I removed the "x" also from the
jazz script, here:
Code:
Assign Actor "a_JapLowDinnerTable_kneel.ma"."" as "x"

because I thought that that was part of the animation's name too (idea reinforced by the fact that it
was followed by as "x" and I thought it was redundant to declare 2 times who the actor was).
So the correct form is:
Code:
Assign Actor "a_JapLowDinnerTable_kneel.ma"."x" as "x"


About AnimateSim and states' properties maybe if I had read the
jazz's tutorials more carefully I wouldn't have lost all this time.
Inventor
Original Poster
#6 Old 1st Nov 2014 at 12:10 PM
If it's all right, I'll keep writing this kind of modding journal.
Even if no one answers, this is helping me to stay focused and motivated.

I got two problems with the custom posture:
- I don't think I can reference it from an ITUN (not sure if I need to use it as a posture precondition, but it bothers me)
- Once a sim assumes that posture he can only use its associated social interactions
(chat, gossip, etc) and ImmediateInteractions, any other interaction seems to "break" the
posture, even those I made that are directly associated with the table itself (the ones I'm interested in).
It seems like even the interaction to stand up is ignored when called selecting it from the table menu
and it's called directly by the posture's code with GetStandingTransition (which calls the standing interaction
defined in my code).

This is probably happening because I don't fully understand how postures works and/or
I can't use the posture as posture precondition in the ITUN of the interactions.

I tried using an InteractionProxy but I think that has nothing to do with it.
I tried adding my interactions inside the posture's code itself, but nothing.

I'm also wondering what the Satisfaction method in the posture's code is used for.
I put some debug messages inside it to try to understand who's calling it and with what arguments,
it seems it's being called a lot of times to evaluate commodities of every type
(even those associated with objects/interactions not instantiated in my small testing world).

My posture, copy/pasted from PicnicPosture with little adjustments, still keeps the
CommodityKind.Picnicing condition, I wonder if and how I should change that.
I'm afraid that even if I create a custom commodity I cannot reference it from an ITUN.

To circle the problem I could dumb down my project, remove the posture and make every single
interaction do every single step (route to the table, kneel, do its thing, stand) but I really don't
want to do that and I'll only play it as my last card or at least as a temporary solution in order to
go ahead and start implementing other features (gosh, doing eating animations looks a pain).
Inventor
Original Poster
#7 Old 2nd Nov 2014 at 1:51 PM Last edited by Arsil : 3rd Nov 2014 at 10:42 AM.
I'll write it here instead of opening a new thread, since it has to do whit this mod too.

I've searched the forum and read hundreds of posts looking for an answer,
but of course I could have missed it.

In Milkshape, when I bend legs then I have to move the "b__ROOT__" joint
in order to put the feet back on ground-level (or the sim will look raised from
it like he is floating or jumping). See images.

First of all, is that the right thing to do?

This works fine with [Young] Adults and Elders, but if a Teen sim plays the
animation he will sink into the ground. Maybe because he is shorter or has
different joints or proportions, I don't know.
EDIT: I tried using "b__ROOT_bind__" instead of "b_ROOT__" and it's the
same thing (not that I have any idea about the difference between those two).

Since there's no teen rigfile usable in MilkShape, how can you fix that?

I'm so sick of animations... they are not my thing.
Inventor
Original Poster
#8 Old 13th Jun 2016 at 11:32 AM
It's necromancing time!

Quote: Originally posted by Arsil, 27th Oct 2014
But somehow I'll do this mod or I'll die trying... or more likely I'll give up after 10 minutes.


Not exactly what I had in mind back then, but close. I'm aware the animations suck, but I don't care.

I think doing the animations properly, with a prop that needs its own animation perfectly matching the one
of the Sim, is too hard, at least for me, so I'm using a special outfits that simply adds chopsticks as
CAS accessory to the current outfit (and removing it when the interaction is done).

The "flying chopsticks" is because I'm using an adult CAS accessory on a child.

Now I have to fix the damn jazz script (I'm using a series of PlaySoloAnimation right now) and
think about how to integrate it with regular foods (at least those that use the fork as utensil).
Should I keep the interaction on the table? Put one directly on dishes or maybe even on the fridge?
I don't know yet, I want to find a way that allows to eat in this way autonomously.
Should I modify the already existing slots of the coffee table to allow Large items (plates and whatnot)
or keep just the center slot (but that way Sims will all eat from the same plate and that can't be right for every kind of dish)?

@icarus_allsorts and @douglasveiga
I'm sorry to bother you, do you have any suggestion?
Screenshots
Inventor
#9 Old 13th Jun 2016 at 12:14 PM Last edited by douglasveiga : 13th Jun 2016 at 12:25 PM.
Not sure about that, but I think some recipes from World adventures have chopsticks maybe you could clone their animations (probably upperbody) and jazz (from the eat interaction).

Quote:
Should I keep the interaction on the table? Put one directly on dishes or maybe even on the fridge?


I think makes more sense to put on dishes with a new eat interaction. Maybe, right after a serving container is instantiated, you swap the eat food interaction with a custom one. BTW, probably this approach won't work every time because many piece of script will try to push the default eat interaction.

Quote:
Should I modify the already existing slots of the coffee table to allow Large items (plates and whatnot)
or keep just the center slot (but that way Sims will all eat from the same plate and that can't be right for every kind of dish)?


project decision

Quote:
Since there's no teen rigfile usable in MilkShape, how can you fix that?


I use the adult rig instead, this means animations is always screwed for teens.

I know it may sound unrealistic, but you could route sims to the routing slot, fade out, teleport to the correct seat slot, and fade in with your eat with chopstick animation. This way you don't need to worry about all the animations transitions.
Inventor
Original Poster
#10 Old 13th Jun 2016 at 2:06 PM
Hey, thanks! No need to read the whole thread, just my last post ^^

Like I said, doing the animations in the regular way (with a prop for the utensil with its own animation),
seems like a lot of work even using some copy/pasting from existing ones.
Even if my animations are crappy and should be considered as no more than placeholders,
they are done (even for teens), so I'm good with that.
Inventor
Original Poster
#11 Old 13th Jun 2016 at 4:35 PM
I wasted a lot of time trying to fix the jazz script, then I discovered that the "export to package"
feature wasn't overriding the existing resource. It wasn't working because it was the old version
without the new states. Sigh!

Taking a nap on the table (I still have to adapt the teen animation).
Screenshots
Field Researcher
#12 Old 14th Jun 2016 at 5:08 AM
Oh dear, jazz files and animations are way out of my scope of knowledge, but I've seen how the game tells sims to use chopstick animations instead of fork ones in the EatHeldFood interaction just as douglasveiga has pointed out.

To get sims to eat food at the table autonomously, the way the game does it is to give the object the IEatingSurface interface and adding the SitHereForEating interaction to the object. The posture preconditions set in the EatHeldFood interaction will cause sims to search for an interaction advertising the Sitting motive like SitHereForEating and running it before EatHeldFood is actually performed (EatHeldFood only handles the sim eating the food after they've already been seated or have decided to stand instead).

Not sure how easy/difficult it is to implement IEatingSurface on your object, though I could see it being implemented similarly to the PicnicTable that is both an eating surface and has sitting components as opposed to other surfaces that require a chair/stool attached to them. Alternatively just adding a custom interaction similar to SitHereForEating to the object that advertises Sitting heavily could also work.

Still you will probably need to replace the EatHeldFood interaction to use custom eating animations if autonomy is your aim. As douglasveiga has also said the game often pushes EatHeldFood.Singleton onto sims especially directly in various situations especially immediately after food is cooked, so replacing the singleton is probably the best way to go. You could as suggested above, add a custom SitHereForEating like interaction to your object to advertise Sitting and have the interaction handle the actual sitting animations, then create a custom version of EatHeldFood that runs the eating animations if the sim is using your table but runs the original Run method otherwise.
Inventor
Original Poster
#13 Old 14th Jun 2016 at 6:50 AM Last edited by Arsil : 14th Jun 2016 at 7:14 AM.
Thanks. Yeah, this seems really complicated, I'm a bit discouraged but I'll try to figure something out,
maybe simplifying a little the system.

ATM I just need Sims to autonomously put a serving container (single or group) in the central slot
of the table, the interaction to eat it from there (even autonomously) is already done, but due to
the fact that Sims don't really "sit" I had to make it very peculiar so I don't think it can be integrated
with the existing system (EatHeldFood) or at last not so easily.

Any Sim can use that interaction, but those with my Japanese Culture trait are encouraged by the
custom trait related CommodityKind. By the way, working on this I found out that posture pre conditions
are also CommodityKind(s) whose enum value has to be in a certain range to be identified as such,
just like trait related CK and motive related CK must have an enum value on a certain range.
[UnrelatedRant] Waaah, Posture(s) are a pain! I'm not using one here because I can't really handle it [/UnrelatedRant]

Right now up to 4 Sims all eat from the same plate, be it a single or group servingcontainer. I know
it is not the best solution but it is much easier to handle and I can always try to improve it over time.

I used this solution of all Sims eating from the dish placed on the central slot of the table also because
I had the "great but not so great" idea to add a nap interaction to the table and checking if the containerSlot
on the same side of the routingSlot is already occupied by a plate or another object is a pain, especially
because it makes the routing checks and the Test method of the napping and eating interactions complicated
and too much time consuming for my tastes (I'm always worried and cautious about performances).

I've also experimented with Slot.Disable(...) to try to disable the containerSlot on the same side of the table
where a Sim is napping to avoid placing (with DragAndDrop or other means) an item there during the nap
interaction but that didn't seem to work. And that was another reason to use the central slot.

Another problem is that Sims can't pick up plates (or whatever) placed on my table, so I have to
make a special interaction for that or add a generic cleaning interaction directly on the table.

Anyway, sorry for bothering you and thanks for taking the time to answer ^^
Inventor
Original Poster
#14 Old 14th Jun 2016 at 9:25 PM
So, icarus_allsorts suggestions were on point. With the method described, in theory you can create
a new way for Sims to eat (even to sit) that perfectly integrates with the system already in use.
Studying the PicnicTable was useful, but also the TableDining can be used as reference (for my table
I could have used rug/pillows as "chairs" and use a custom animation to sit/kneel).

Of course it is not a bed of roses. You need proper animations, override the eat jazz script (maybe also
the one for sitting, if there is one) and probably also custom postures. This matter definitely deserves
more research, but I was weak and I gave up at the first difficulties (I got lost with all that SittableComponents,
SlotPairs and stuff), so I've decided to use a much simplified solution.

I have a first prototype, it's a bit embarrassing (for the animations, some are just poses, and for the code)
but seems to work. The chilldren animations are problematic because the table is too tall for them so
their arm moves almost horizontally (and I'm still using a CAS accessory made for adults, so the
chopsticks don't stick to the hand) and it could use some shifting to get them nearer to the table to
reach the food (but I find amusing the napping pose, even if the arms are in a unnatural position that
defy gravity).

So, when a food is cooked an event listener is triggered to add a new interaction to the ServingContainer
(only cooking a ServingContainerGroup seems to send the mCookedMeal signal unfortunately, because
my mod would support also the ServingContainerSingle).

This interaction is used to take the food to my table (I've left only the central slot to avoid all the problems
with the napping interaction). Once there, Sims will eat it with an interaction attached to the table itself and
also clean/recycle it when it's over (this is handled by existing interactions, it wasn't working earlier because
the table lacked the implementation of the ISurface interface).

The fact that only foods whose recipes specify the fork as utensil can be served and eaten on the table
can be a bit confusing (that limitation is xml tunable, but eating a soup or a hot dog with chopsticks is
ridiculous) and I'd like to have some Japanese themed household with only this kind of table for eating.
I could make animations for eating with a spoon (as CAS accessory) and with hands but the idea of
making more animations makes me sick (and I'm still traumatized by my utter defeat with the pedaling
one of the exercise bike).
Field Researcher
#15 Old 15th Jun 2016 at 11:19 AM
I commend you for even toying around with animations since they are so beyond me. Perhaps a suggestion on how to get your interaction onto serving containers without a listener, why not replacing the ServingContainer.PicnicBasketInteractionProxy.Singleton, since the only purpose of the PicnicBasketInteractionProxy is to add the picnic blanket interactions to the pie menu when clicking on containers placed on a picnic blanket. You could replace it with your interaction and just copy over what is in the AddInteractions method of PicnicBasketInteractionProxy.Definition into the AddInteractions method of your interactiondefinition to get the same effect, while having your interaction naturally added to all serving containers by the game. There are many ways besides cooking that serving containers are created in the game (ordering pizza, summoned by genies, brought to the lot during parties etc) and I'm not sure if they all send events in the first place.
Inventor
Original Poster
#16 Old 15th Jun 2016 at 12:10 PM Last edited by Arsil : 15th Jun 2016 at 3:33 PM.
That's interesting. I'll experiment with it. Thanks ^^
EDIT: yep, it seems to work fine. I had to override the Singleton using a delegate of
OnWorldLoadFinished because it didn't work (on the first world loaded) using the
usual OnPreload (something to do with it being a proxy I guess).

Quote:
since the only purpose of the PicnicBasketInteractionProxy is to add the picnic blanket interactions to the pie menu when clicking on containers placed on a picnic blanket


You can't place anything on a picnic blanket nor in a picnic table with a... blanket?
So I don't understand when those interactions are added to a ServingContainer.
EDIT: maybe it is when Sims autonomously place food on a picnic table with a
blanket while searching for a suitable place to eat?
Back to top