- Site Map >
- Modding and Creation >
- Sims 2 Creation >
- Object Creation >
- Object Creation - Modding >
- Container slot help(SOLVED!!!) :)
- Site Map >
- Modding and Creation >
- Sims 2 Creation >
- Object Creation >
- Object Creation - Modding >
- Container slot help(SOLVED!!!) :)
Posts: 7,361
Thanks: 2930 in 27 Posts
I know the opposite of 180 would be 0, but then the z was negative, and according to the twin bed, both e and w routine slot have the same +/-. Both are positive
trying with z - and angle 0, my game crashed. lol.
So OK! I'll try that new routine slot value you gave me.
Thank you.
Posts: 7,361
Thanks: 2930 in 27 Posts
Though, he still enters by the other side. So now, the container slot...
Oh, and he can't get out. lol
Posts: 1,524
Thanks: 15604 in 74 Posts
As for getting out, he probably tries to use #0 slot to get out, and if it's blocked, he can't. You'd have to add a line to try slot #1 into the BHAV. Also, animations might need flipping to correspond with the side the sim gets in and out from. This time it's harder for me to say without seeing it in game.
By the way. Doesn't the bed's roof poke through the wall?
Posts: 7,361
Thanks: 2930 in 27 Posts
By entering from the other side, I mean, toddler will flip/warp to the other side of the bed to enter. Because the container slot points toward that side, so i guess the anim is also towards that point.
So i am now trying different values, for the new container slot.
This is funny, my second try(just now) the toddler zapped to the roof side, and entered by there. he ended up sleeping sideways, with his head sticking out. lol
Oops, wrong rotation...
I'll go try something else.
Posts: 7,361
Thanks: 2930 in 27 Posts
Posts: 1,524
Thanks: 15604 in 74 Posts
First container slot's rotation is 90 degrees with Z=-1, so I would think you have to make the new one with 270 degrees with Z=-1 (turn around 180 degrees). As for translation, I'd say X -0,139281, Y -0,518605, Z 0,191036.
Posts: 7,361
Thanks: 2930 in 27 Posts
I wonder now, if he will sleep with his head left, or right, but my game crashed so...I'll let you know in a minute
Minute passed..
So he sleeps in a mirrored position, just like when you turn the ped bed the other way. I am not surprised. trans need editing a bit, because his head is sticking out of the bed.
If I could mirror the sleep anim, it would be great...but how can I mirror just that instance? I do not want it mirrored when he uses the other side...
Otherwise, I'll just leave it as is. Sleep that way if it pleases you.
Posts: 1,524
Thanks: 15604 in 74 Posts
Now the X is -0,005402. I'd try -0,205402, maybe.
Posts: 7,361
Thanks: 2930 in 27 Posts
Posts: 1,524
Thanks: 15604 in 74 Posts
Posts: 7,361
Thanks: 2930 in 27 Posts
... How I'd do it: depending on the slot used by sim to enter the bed, I'd store a number in a new local variable, so that the interaction remembers it from the beginning to the end; then every time it comes to animations, I'd check this variable to choose normal or flipped animation. |
That second bit with the variable, I don't get..unless you mean by that, Option 2 - flip in temp 3?
Sorry! My bad. Copying what you said in here, changed the comma into a period, or the other way around anyway. SimPE only accept one of them..so it kept changing to another value.
ugh...I'll go back.
Okay, so changing the value of the routine slot helps but not. Because the container slot still has the same, so container values needs to change as well. I'll have to find the perfect alignment, finally.
Posts: 7,361
Thanks: 2930 in 27 Posts
The Routine is almost centered, the container is almost centered, though both needs to be squished towards eachother..
And the sleep is fine. Will be even better when flipped.
Pic 1 for the routine,
pic 2 for the container,
pic 3 for the comparaison. To be perfect, the toddler should be in the same position..
and pic 4 is sleeping.
Pictures have been edited because it was night time and we can't see good.
I'm getting there thanks to youz.
Time for a break, I'm hungry.
Posts: 7,361
Thanks: 2930 in 27 Posts
If I wanted a bed enter-able by one side and getout-able by the other I am done. No weird clippings or animations, looks natural.
On to the next step now, adding a get out by the new getIn side...
Posts: 1,524
Thanks: 15604 in 74 Posts
About the variable. The idea is to record what slot was used by the sim to get in and use that information to control further events, i.e. which animation to choose. You can use Local 1 for it, as Local 0 is already used for something else. It can go like this:
If sim's attempt to use slot 0 was successful, write "Local 1 := 0". If not, sim tries slot 1, and if that is successful, write "Local 1 := 1". Now the BHAV stores this info in Local 1 and you can check it and use it. There are a few ways how you can go about flipping animation. The shortest in this situation would be, I think, this:
After the line 4 and before playing getting in animation, insert a line "Temp 3 := Local 1". Then tick on Flip Flag in Temp 3 for this animation. Now the flipping will depend on Temp 3, which depends on Local 1, which depends on what slot is used. Perfect.
A) Sim used original slot -> Local 1 equals 0 -> Temp 3 equals 0 -> Flip flag is 0 -> Animation is not flipped
B) Sim used new slot -> Local 1 equals 1 -> Temp 3 equals 1 -> Flip flag is 1 -> Animation is flipped
Assuming that flip flag 0 is not flipped and flip flag 1 is flipped (I think it is), the logic works out nicely.
Next up. I don't think sleeping animations need flipping, so don't tick Flip Flag in Temp 3 for those. I don't know about sitting and waking up animations.
Getting out probably needs flipping. But before that we have snapping into slot on line 16, and we need to rewrite Local 1 according to what slot the sim will use this time to get out (because he might not use the same one as he used to get in). Same as before: if sim's attempt to use slot 0 was successful, write "Local 1 := 0"; if not, sim tries slot 1, and if that is successful, write "Local 1 := 1". After that and before the getting out animation, insert a line "Temp 3 := Local 1" again and tick Flip Flag in Temp 3.
Before saving, don't forget to change Local Var Count to 0x02 at the head of the BHAV.
For this plan to work, rotation angle of the new container slot should be the same as the original. If you leave the new slot rotated 180 degrees compared to original (as it looks on your latest pick), animation flipping is not needed. Because rotation is what makes a sim turn head to toes, not the flipping. But the flipping is needed when a sim approaches container slot from a different side. From the right side he turns right, so he has to turn left from the left side to lay down in the same direction. I think, it'll work.
I hope I don't make it all sound harder than it is.
Posts: 7,361
Thanks: 2930 in 27 Posts
Turns out, my new container slot's x trans needed to have the same value, but negative. (same as original container slot)
For my new Routine slot, it was the y trans that needed to be the same, but negative.(same as y of the original routine slot)
As it is now, the anims are perfect regardless of which side my toddler gets in, and I am so happy about this...wanna try? lol
The rotation of my new container as -z, while the original has a positive value. So plan won't work. But all seems normal, I would leave it be.
you said :
If sim's attempt to use slot 0 was successful, write "Local 1 := 0". If not, sim tries slot 1, and if that is successful, write "Local 1 := 1"
I write this where? Do I need to add a new line between stuff to fit a..[prim 0x0002] Expression (Local 0x0000 := Literal 0x0001) instead of pointing it to a true?
Also :
After the line 4 and before playing getting in animation, insert a line "Temp 3 := Local 1". Then tick on Flip Flag in Temp 3 for this animation. Now the flipping will depend on Temp 3, which depends on Local 1, which depends on what slot is used. Perfect.
A) Sim used original slot -> Local 1 equals 0 -> Temp 3 equals 0 -> Flip flag is 0 -> Animation is not flipped
B) Sim used new slot -> Local 1 equals 1 -> Temp 3 equals 1 -> Flip flag is 1 -> Animation is flipped
Assuming that flip flag 0 is not flipped and flip flag 1 is flipped (I think it is), the logic works out nicely.
I can follow this, but instead of after line 4, since get in works well as it is now, I could use this trick before the get out?
Posts: 7,361
Thanks: 2930 in 27 Posts
The way i set the behav, is that if the first Go To routine is true, all goes normally. if it is false, then it goes to the other Go to routine Line I added, that then points to my new routine slot. Which then goes to my snap into line I added, which points to my container slot. And then all goes back up, to line 4, where the sleeping happens as normal.
So i really wonder where to place a Temp, and then what to do afterwards.
I will post my new edited one that works for getting in by the other side. maybe you can look at it and tell me where to add stuff...
This version is before i attempted the Temp, variable, local..because when i did, I'm sure I messed up.
Oh!! and of course, if ever you need to try in game, you'll need my Twin bed for the toddler bed to show up, so i am posting it too...
Posts: 1,524
Thanks: 15604 in 74 Posts
then forget about what I said in post #39. You shouldn't have to flip the animations, if the slot is rotated the way it is now.
Posts: 7,361
Thanks: 2930 in 27 Posts
All my tries were in vain. Everything is fine until the wakeup animation is done. Then he stand up in his bed, idle...and I must move him out using moveobjects on. (if the original side is still blocked, otherwise, he uses it no trouble)
He refuses to follow my edits of the behave.
Between the wakeup anim and the get out one, there are 2 lines. snap(slot number) and snap away(flip sim around). The wake up true and false target both points to snap(slot number)
So, I made the false point to a new snap(slot number, mine) and then go to get out.
problem is, it is not like there is something stopping the toddler to snap here or there, so my new line never gets chosen.
Well, I assume this is what is happening.
So yeah, the variable temp thing would be nice here, but i am afraid i do not understand or know enough to make it work.
But I will work on this more, I am almost there...
Posts: 1,524
Thanks: 15604 in 74 Posts
[prim 0x002E] Snap (slot number 0x0000, from slot in temp 1: False, ask person to move: False, TEST ONLY: False)
And change it to "TEST ONLY: True". This way, this line would be a check if the slot is available. I have never dealt with this primitive, so I'm not sure how it works. There seems to be no wiki article on the Snap, so trial and error it is! Ok, I played with operands*, and found out - if you set operand 4 to 10, it would change it to test:
[prim 0x002E] Snap (slot number 0x0000, from slot in temp 1: False, ask person to move: False, TEST ONLY: True)
So, that's that. Line 16 is now a test to see if slot 0 is Ok for snapping. If it is, it returns true and you have to lead it to the actual snapping (with TEST ONLY: False). If it returns false, lead it to test for the slot #1, and again - if the test returns true, go to snapping to slot #1. What if both tests fail? Maybe someone stands in front of the bed and blocks the path, but will go away in a few minutes. It's not the best idea to just remove "in use" flag and finish the interaction the way it's done now. I mean the sim is stuck. I would insert "Idle" function, so that the sim waits for 30 ticks and tries to get out again.
*This is how you count operands:
Posts: 7,361
Thanks: 2930 in 27 Posts
Ahahahah( <--------my computer is suggesting Yamaha instead..)!!
Well now, he gets out alright, but in the wrong direction, so he is still in bed and stuck...I video-ed it, it's funny.
https://youtu.be/RSSF-QjFkm4
Posts: 1,524
Thanks: 15604 in 74 Posts
Posts: 7,361
Thanks: 2930 in 27 Posts
Posts: 1,524
Thanks: 15604 in 74 Posts
(Looking at BHAV 0x2091 - Routing - Get Out - from Bed globals)
So, I made the false point to a new snap(slot number, mine) and then go to get out. |
Would you show me how you did this part? The file I have doesn't have it yet.
Also, on the line 1, there's a bug:
[prim 0x002D] Go To Routing Slot (Param 0x0000)
It should be Literal slot 0:
[prim 0x002D] Go To Routing Slot (0x0000)
(I even know how it got messed up. Every time you use the wizard for the Go To Routing Slot primitive, it changes items in the little drop-down list. Sneaky wizard )
Posts: 7,361
Thanks: 2930 in 27 Posts
The package you have is the template I use. I keep a copy, cause it works for the get in. Then, I paste a copy in my DL, and run tests on it. When it fails, I delete and start again with the template.
Ok, I changed it from temp to Literal. (line 1)
What will this change though? because the toddler seemed to have no trouble..and this is the original line, not the one I added.
Posts: 1,524
Thanks: 15604 in 74 Posts
Let's try this again: "So, I made the false point to a new snap(slot number, mine) and then go to get out."
Who Posted
|