MTS has all free content, all the time. Find out how YOU can help to keep it running. Tell me how...
Unmade Bed: auto put off/on decorative blankets, pillows, etc.
by Lamare
Posted 28th Jul 2017 at 3:24 PM
- Updated 29th Dec 2017 at 6:14 AM by Lamare : minor file update
Flag Download
38 Comments / Replies (Who?)
- 15 Feedback Posts,
22 Thanks Posts
Hide Thanks Posts for this thread (Show only feedback)
Hide Thanks Posts for this thread (Show only feedback)
#26
24th Oct 2018 at 6:43 AM
Last edited by Bubblebeam : 24th Oct 2018 at 9:26 AM.
Posts: 1456
Thanks: 2931 in 30 Posts
Wonderful! I wonder if the same sort of thing could be done for place settings on dining tables (in reverse of course)?
#27
23rd Oct 2020 at 7:37 AM
Posts: 944
Oh this is amazing! That was exactly why I never used those blankets, but with this, I can!
#28
2nd Oct 2021 at 5:26 PM
Posts: 12
I also NEVER use the amazing decor that I've downloaded for beds, because i couldn't stand the sims peaking up through, or the glitchiness. I cannot thank you enough that I just found this! I'm so excited!!!!!
#29
31st Jan 2022 at 1:13 AM
Posts: 463
Thanks: 2501 in 44 Posts
Quote: Originally posted by Lamare
You have a pillow or a blanket that doesn't hide with the mod? I'll show you how to edit it so it hides. On the contrary, you want to make some object stay put instead or hiding? I'll show how to do that as well. Do this only with purely decorative objects. Make backups of your files before you change them, in case you need to start fresh. Every object has Init function. What you're going to do is edit that function to set certain category. Note: it's not going to change where the object appears in Buy mode. Open an object in SimPE. It has to be a mesh, not a recolor. First, find out what BHAV your object uses as its Init function (it's not always obvious): 01 ^ 1. Select Object Functions file type in Resource Tree. 2. Open a file in Resource List. Usually it has [Object Functions] in place of its name. Sometimes there're a few files. Start from any one. 3. Go to Plugin View. 4. Note the Init function's number. It's hexadecimal so it may contain letters. In this case it's #1002 and named "init". If the number starts from 1000 (e.g. 1005, 10F7, 1158 or the like), read this spoiler: Function number 1NNN means it's private, i.e. inside the package. Find it: 02 ^ 1. Select Behaviour Function file type in Resource Tree. 2. Find the file with the instance number and name you noted before. Instance number is more important in this case, don't get confused by similar names. Click on it. You've opened the BHAV. Next step is finding a place to insert new line. 03 ^ 1. Make sure you're in Plugin View. 2. Make sure Special buttons box is checked. 3. Select the final line that returns true, i.e. goes "true: FFFD". It may be at the very bottom, like in this example, but not necessarily. 4. Click Ins/true button. This action will insert new line. Other examples of how the Init function might look and where to insert new line. - This one named "Function - Init". It has only one line, so it's a no-brainer: 04 - This one is a mild case of spaghetti: 05 - Watch out for unattached lines. Gray arrows point to leftover unused stuff. Don't link your code from there, choose the "real" line: 06 So, you've found the line. Select it and click Ins/true. New line will appear below, it will be linked to previous and be a copy of it. Now you have to change it. 07 ^ 1. Select new line. 2. Make sure it's OpCode is 0x0002 - Expression. If not, set it so. 3. Click the quotes button. Raw entry box popped up: 08 ^ A. If you want your object to hide on a bed, copy this numbers: 3B0030D60005031A0000000000000000 B. If you want the object to stop hiding, copy this: 3B000000000503070000000000000000 Paste them straight into that little input field. Click Okay. Here's what you should see. It's either (A) garden sculptures: [prim 0x0002] Expression (My category := Const 0x016C:0x30) ... or (B) zero category: [prim 0x0002] Expression (My category := Literal 0x0000) 09 Your line now is the last. Make sure it says "true: FFFD", i.e. returns True, as init functions should. This is all there is to it, except for last KEY step - saving changes. 10 ^ 1. Click Commit File. 2. Save the package. If your object had more than one Object Functions file, see if they all use the same init function. If not, you may have to repeat what you did for all object's inits. To test the package in game buy new object in Buy mode catalogue, because the init function runs when an object is created or bought. If the number starts from 2000 (e.g. 2000, 200A, 2014 or the like), read this spoiler: Function number 2NNN means you are "lucky" - the object links directly to semi-global function, and you'll have to create new private function in order to stick a category in there. But be not afraid. 11 ^ First, write down the number for later. In this example, it's 2000. Right-click anywhere on blank space of Resource List to bring context menu: 12 ^ Choose Create Resource. Then find and open it: 13 ^ 1. Choose User Defined type in Resource Tree. 2. Spot your new file in Resource List and click on it. Next step is to turn it into a BHAV. 14 ^ 1. Go to Resourse tab. 2. Pick Behaviour Function in a drop-down list. 3. Assign Instance number. It's got to be in range of 1NNN and be unique for the package - no repeating BHAV numbers already existing in this particular package file. In my example it's 1001. Commit and click on any other resource to refresh view. Find your new function in the list of resources: - It'll be under BHAV type. - You'll recognize it by instance number you gave it and [Behaviour Function] instead of a name. - Click on it. You'll see a blank file. The goal is to include two lines: the original Init function and set a category. 15 ^ 1. Make sure you're in Plugin View now. 2. Click Add button. 16 ^ 0. Nevermind the sleeping. 1. Look up the number of semi-global init function and put it into the OpCode field. It'll go from 0x0000 to 0x2000 or whatever the number is in your case. 2. Clear operands by clicking on X button. 3. Click Ins/true to add new line. If you don't see the button, tick Special buttons checkbox. Now the first line calls the original init function for your object. The second line is a copy of it - let's change it. 17 ^ 1. Change the Op-code to 0x0002. 2. Click the quotes button to bring up raw entry box 3. Paste these numbers in that little input field: A. If you want your object to hide on a bed, paste this: 3B0030D60005031A0000000000000000 B. If you want the object to stop hiding, paste this: 3B000000000503070000000000000000 Click Okay. 4. Name the file, if you want. 5. Click Inge's InitLinker button. It makes all lines properly linked. The result: 18 ^ Line 0 calls semi-global init and linkes to line 1. Line 1 sets new category and returns True, i.e. goes "true: FFFD". It's either (A) garden sculptures: [prim 0x0002] Expression (My category := Const 0x016C:0x30) ... or (B) zero category: [prim 0x0002] Expression (My category := Literal 0x0000) BHAV is done. Save changes (screenshot is recycled from previous spoiler): ^ 1. Click Commit File. 2. Click Save or Save as. Finally, make the object recognize new BHAV as its Init function. For that, replace instance number for Init in Object Functions file. 19 ^ 1. Open the Object Functions file you opened at the beginning. 2. Select init line. 3. Put new function's number in the Action BHAV field. In my case, I replaced 2000 to 1001. 4. Commit File and Save the package. If your object has another Object Functions file, see if it uses the same semi-global init function as the one you've just changed did. If yes, replace it to new number as you just did. If not, repeat the whole creation of new init for it: include a call to its own semi-global, set a category, give it yet another unique number and put the number in this file. To test the package in game buy new object in Buy mode catalogue, because the init function runs when an object is created or bought. This tutorial was requested by @SweetSweet |
Hi @Lamare
First of all thank you so much for this mod! Also for taking the time to write up this tutorial.
I followed it with an object whose Init function's number starts from 1000. At step 08 I pasted 3B0030D60005031A0000000000000000 from option A because I wanted the object to hide on a bed. This is what I got:
[prim 0x0002] Expression (My 0x003B (category) := Const 0x016C:0x30 ([not found]))
To see if option B also results in a "([not found])" at the end I clicked the quotes button again and pasted 3B000000000503070000000000000000 from option B instead. Then I got this:
[prim 0x0002] Expression (My 0x003B (category) := Literal 0x0000)
Do you have any idea what I could be doing wrong and why I'm getting that "([not found])" with option A?
#30
2nd Feb 2022 at 8:55 PM
Posts: 1,530
Thanks: 15785 in 76 Posts
Hi @Corax
Apparently, picture hosting butchered the screenshots in this tutorial, so kudos to you for being able to follow it. The [not found] thing means that SimPE can't find the constant value in your game files. It could be two things: a visual glitch in SimPE (in which case you should just ignore it, the object will work fine in game), or it could be that you don't have any of the latest expansion or stuff packs that value was included in (low game version, so to speak). On your profile page you listed that you own a lot of EPs, do you have them all currently installed? If you do, I'd say go ahead and try your edited object in game if you haven't already. If it doesn't hide when it should or throws an error, get back to me, and I might be able to help by looking at it. These two things were just off the top of my head.
Apparently, picture hosting butchered the screenshots in this tutorial, so kudos to you for being able to follow it. The [not found] thing means that SimPE can't find the constant value in your game files. It could be two things: a visual glitch in SimPE (in which case you should just ignore it, the object will work fine in game), or it could be that you don't have any of the latest expansion or stuff packs that value was included in (low game version, so to speak). On your profile page you listed that you own a lot of EPs, do you have them all currently installed? If you do, I'd say go ahead and try your edited object in game if you haven't already. If it doesn't hide when it should or throws an error, get back to me, and I might be able to help by looking at it. These two things were just off the top of my head.
#31
3rd Feb 2022 at 12:31 PM
Posts: 463
Thanks: 2501 in 44 Posts
Thanks a lot for getting back to me, @Lamare.
Yes, currently I have all EPs and SPs installed. I tried the object in-game and it didn't hide when it should. As a control I also threw some pillow of which I know that it hides with your mod on the same bed. The pillow did hide and the edited object didn't but it also didn't throw an error. Apparently I didn't do a very good job following your tutorial.
I attached the file I modified and I thought I would add some additional information in case any of that could be useful to you:
I originally got the file from here and have changed its location to Surfaces-Miscellaneous using the Object Relocator. My SimPE version is SimPe_0_73_44-QA.
Yes, currently I have all EPs and SPs installed. I tried the object in-game and it didn't hide when it should. As a control I also threw some pillow of which I know that it hides with your mod on the same bed. The pillow did hide and the edited object didn't but it also didn't throw an error. Apparently I didn't do a very good job following your tutorial.
I attached the file I modified and I thought I would add some additional information in case any of that could be useful to you:
I originally got the file from here and have changed its location to Surfaces-Miscellaneous using the Object Relocator. My SimPE version is SimPe_0_73_44-QA.
Attached files:
hkaw-sfvsher_simscave_500gift_blanket-slave-JonesiBB_TutorialChanges.rar (69.4 KB, 9 downloads) |
#32
4th Feb 2022 at 12:29 PM
Posts: 1,530
Thanks: 15785 in 76 Posts
You did an awesome job @Corax, it's just my tutorial didn't cover the possibility that lines could be unlinked. What happened is the function ended at line 0 and wasn't even going to the other lines, including the one you added, therefore the changes didn't take effect. I linked them together and cleaned up leftover code, so it should be working now (on newly bought blankets).
Attached files:
hkaw-sfvsher_simscave_500gift_blanket-slave-JonesiBB_EditedToHide.zip (99.0 KB, 17 downloads) |
#33
4th Feb 2022 at 7:02 PM
Posts: 463
Thanks: 2501 in 44 Posts
Thank you, that is very kind of you to say @Lamare.
It works perfectly now. I changed all the other deco objects that also wouldn't hide in my game the same way you did. Every single one I was planning to change had those unlinked lines. So it was really great to have the file you edited as an example because I have no idea what I'm doing in SimPE. Now all of the bed decor I have does hide with your mod. Thank you so much for all the help, I really appreciate it!
It works perfectly now. I changed all the other deco objects that also wouldn't hide in my game the same way you did. Every single one I was planning to change had those unlinked lines. So it was really great to have the file you edited as an example because I have no idea what I'm doing in SimPE. Now all of the bed decor I have does hide with your mod. Thank you so much for all the help, I really appreciate it!
#34
26th Aug 2022 at 5:11 PM
Posts: 463
Thanks: 2501 in 44 Posts
Hi @Lamare
I ran into a different kind of "problem" (not really a problem but I don’t know what else to call it). When I place decorations on the headboard of a bed or on a shelf that hangs on the wall behind a bed, Sims will also make the headboard decorations and the shelf decorations disappear when they take off stuff that is on the bed itself. Using your tutorial I could of course edit the objects that I want to place on shelves and headboards. The problem lies a bit with objects that I want to use for both. Caon’s Stuffed Freezerbunny for example, sometimes I like to place it on the bed itself and sometimes I like to place it on a shelf above the bed. So I would need for it to hide only in certain situations. My question now is, do you think it would be possible to make a transformer for bed deco using this object as a base? One transformer to make objects hide and one transformer to make objects stay.
This is not a request. I just saw on tumblr that you’re considering sometime in the distant future maybe revisiting this mod and I thought I would mention it in case you think it could be doable and in case it is something that interests you.
This idea has been swirling around in my head for some time but when I tried to do it myself I couldn’t get it to work and I mainly wanted to know if you think it could be doable. I’m sorry if this sounded request-y and impertinent, that wasn’t my intention.
I ran into a different kind of "problem" (not really a problem but I don’t know what else to call it). When I place decorations on the headboard of a bed or on a shelf that hangs on the wall behind a bed, Sims will also make the headboard decorations and the shelf decorations disappear when they take off stuff that is on the bed itself. Using your tutorial I could of course edit the objects that I want to place on shelves and headboards. The problem lies a bit with objects that I want to use for both. Caon’s Stuffed Freezerbunny for example, sometimes I like to place it on the bed itself and sometimes I like to place it on a shelf above the bed. So I would need for it to hide only in certain situations. My question now is, do you think it would be possible to make a transformer for bed deco using this object as a base? One transformer to make objects hide and one transformer to make objects stay.
This is not a request. I just saw on tumblr that you’re considering sometime in the distant future maybe revisiting this mod and I thought I would mention it in case you think it could be doable and in case it is something that interests you.
This idea has been swirling around in my head for some time but when I tried to do it myself I couldn’t get it to work and I mainly wanted to know if you think it could be doable. I’m sorry if this sounded request-y and impertinent, that wasn’t my intention.
#35
26th Aug 2022 at 5:38 PM
Posts: 1,530
Thanks: 15785 in 76 Posts
Hi, @Corax
This is a good idea, I like it! I'm thinking this could also work as an object with a pie menu to change a nearby object's category. I could make a few options, one of which is "sculptures" that hide and some that don't.
This is a good idea, I like it! I'm thinking this could also work as an object with a pie menu to change a nearby object's category. I could make a few options, one of which is "sculptures" that hide and some that don't.
#36
26th Aug 2022 at 7:24 PM
Posts: 463
Thanks: 2501 in 44 Posts
I'm glad you like it, @Lamare. The pie menu sounds like a great idea! It seems like that could make it easier to transform multiple deco objects at once. Additionally, with only one transformer there would be less objects cluttering up the catalogue.
#37
29th Jan 2024 at 8:52 AM
Posts: 288
Hi, Lamare. Thank you for this fantastic mod and tutorial. I was wondering if this tutorial would work on pillows that are cloned from rugs? I'm talking about the ZeeDeCo Bed Pillows by rgdyanne. I tried to follow the tutorial but it did not seem to work.
#38
1st Feb 2024 at 6:44 PM
Posts: 1,530
Thanks: 15785 in 76 Posts
Hi @toxicboy
So, I'm looking at the init #1002 in the rgdyanne_ZeeDeCo_DoublePillowsMESH.package. Two bottom lines are disconnected, they won't ever run in game. Make sure you haven't linked your new line to one of them, or it won't run either. Connect it to the line 0:
Is that it?
So, I'm looking at the init #1002 in the rgdyanne_ZeeDeCo_DoublePillowsMESH.package. Two bottom lines are disconnected, they won't ever run in game. Make sure you haven't linked your new line to one of them, or it won't run either. Connect it to the line 0:
Is that it?
#39
2nd Feb 2024 at 1:38 PM
Posts: 288
@Lamare thank you so much! It worked like a charm. I'm a very begginer level at SimPE so I was a bit confused with the lines.
Page 2 of 2
|