Quick Reply
Search this Thread
Lab Assistant
Original Poster
#1 Old 25th May 2010 at 4:13 PM
Default Slot modification
I've made several objects with their slots modified, and I'm pretty happy with the results...however, there are few things that bothers me.

1.Basically, I have created three 'types' of slot modified objects; objects with slot's location editted, object with a slot that enlarges objects placed on it, and object with a slot that reduces objects placed on it. They were designed to be able to be placed upon each other, and it sort of works, however, there is problem with tallest slot eddited object; it won't let any of the other slot editted object to be placed upon it. Also, it won't let other ordinary decor objects to be placed upon it. I don't understand this, because they were all cloned from the pedestal cube and also share the same slot placement flag:0x20080008.

2.Is there a slot placement flag that would enable ALL objects within the game to be placed on a slot???

3.Is it possible to make an object dissappear in live mode and reappear in buy/build mode?? Like th WA objects???


Sorry for asking too many questions at once, and also for my bad English.
Screenshots
Advertisement
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#2 Old 25th May 2010 at 5:21 PM
First try putting something in the tall slot from a higher angle. If that doesn't work, the pedestal cube has some coding that overrides the rslt and how the slots work. Try changing the object class to something else. As for the placement flags, 0x20080038 (Small, Medium, Large, Decorative, FullRotation) works for most objects.

Cool objects, btw.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Me? Sarcastic? Never.
staff: administrator
#3 Old 25th May 2010 at 8:33 PM
Please don't post the same question in multiple forums and be sure to verify what forum your in before posting.

Sims_3:0x319E4F1Dwiki That lists the flags for the slots. The value cmo posted is from adding the values together.

And I am a bit confused on the first issue, what do you mean by slot edited objects? Do you have decor that you edited and it won't place? Or is it just the tallest slot that won't take any decor? Besides trying to place from a higher angle the game may be limiting you to height based on wall/level heights. It could also be the bounding box of your object, you could also try making the bounding box taller than your actual object. Or it could be a combination of the two. Or neither. LoL
Alchemist
#4 Old 25th May 2010 at 11:06 PM Last edited by orangemittens : 26th May 2010 at 1:10 AM.
I've been curious about this also because I ran into it on my glass shelves. They were clones of an endtable with the footprint ripped off of it. I made the first and used that one to make the others. The lowest 4 will take any decorative object. But the highest one is more picky. Certain things won't jump there regardless of the angle. I've been all through it to make certain I hadn't accidentally changed something but it all looks the same as the others.

I'm wondering if your idea HL is at the heart of that issue. And if it is it would seem there might be no way to easily fix it.

eta: I mean the height level boundary issue. But perhaps it is a bounding box issue...I should have thought of that and looked into it.
Lab Assistant
Original Poster
#5 Old 26th May 2010 at 2:12 PM Last edited by HugeLunatic : 26th May 2010 at 3:15 PM. Reason: please use edit button, do not triple post
Quote: Originally posted by cmomoney
First try putting something in the tall slot from a higher angle. If that doesn't work, the pedestal cube has some coding that overrides the rslt and how the slots work. Try changing the object class to something else. As for the placement flags, 0x20080038 (Small, Medium, Large, Decorative, FullRotation) works for most objects.

Cool objects, btw.


Thanks alot~! I tried putting things on the tallest object after I've read your answer, and it sort of works..but some objects still won't 'jump' on to the slot...And thanks again for the slot placement fags

Quote: Originally posted by HugeLunatic
Please don't post the same question in multiple forums and be sure to verify what forum your in before posting.

Sims_3:0x319E4F1Dwiki That lists the flags for the slots. The value cmo posted is from adding the values together.

And I am a bit confused on the first issue, what do you mean by slot edited objects? Do you have decor that you edited and it won't place? Or is it just the tallest slot that won't take any decor? Besides trying to place from a higher angle the game may be limiting you to height based on wall/level heights. It could also be the bounding box of your object, you could also try making the bounding box taller than your actual object. Or it could be a combination of the two. Or neither. LoL



Thanks for the link! It's really useful, although I'm still a bit confused on adding them...And I simply mean that the tallest slot won't take any decor.

You said something about the bounding boxes, and I have encountered the term several times in MTS, but I have no idea what they actually are...could you explain what they are and how to edit them???

[QUOTE=orangemittens]I've been curious about this also because I ran into it on my glass shelves.

I knew I wasn't the only one suffering from the problem XD
Me? Sarcastic? Never.
staff: administrator
#6 Old 26th May 2010 at 3:22 PM
Please don't double or triple post, use the edit button.

I touched on bounding boxes in my tutorial on Changing an Objects Footprint. The bounding box is a set of values the game reads that tells it how big the object is. Typically affects where you can grab your object from, although in TS3 this doesn't always seem to hold true. No idea if this would fix it, but I would certainly try it first just to see, especially since the other slots work.
1978 gallons of pancake batter
#7 Old 26th May 2010 at 4:41 PM
Quote: Originally posted by sims_reality
3.Is it possible to make an object dissappear in live mode and reappear in buy/build mode?? Like th WA objects???

I think this could be done easily with a little bit of scripting. Derive a class from your original object's class and override the OnEnterBuymode() and OnExitBuymode() methods. In there call the FadeIn() and FadeOut() methods. If you tell me the class you cloned the object from (look in the OBJK entries in your package if you're unsure), I can write the code for you.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Lab Assistant
Original Poster
#8 Old 28th May 2010 at 5:01 PM
Quote: Originally posted by Buzzler
I think this could be done easily with a little bit of scripting. Derive a class from your original object's class and override the OnEnterBuymode() and OnExitBuymode() methods. In there call the FadeIn() and FadeOut() methods. If you tell me the class you cloned the object from (look in the OBJK entries in your package if you're unsure), I can write the code for you.



Thanks so much for the offer! I didin't really understand what you mean by 'class' (I'm quite new to package editing...)so I'm posting the whole package XD....After you have written the codes, could you tell me how to apply it??? So I could apply it to rest of the packages??? And again, Thanks so much
Attached files:
File Type: zip  OPH-counters.zip (18.6 KB, 8 downloads) - View custom content
Lab Assistant
#9 Old 29th May 2010 at 3:50 AM
All right! Some OMSPs! I knew they'd come along eventually. I'm gonna check these out. Did you use my RIG making tool in making them?

I'm going to use them to try to answer the question of whether or not the slot's transform shrinks both the mesh and the rig, or just the mesh.

Basically, I wanna know if it's possible to properly shrink objects with rigs in them, as I want to experiment with the notion of making a chair that would shrink or enlarge a sim that sits in it. XD
1978 gallons of pancake batter
#10 Old 29th May 2010 at 8:15 AM
Quote: Originally posted by sims_reality
I didin't really understand what you mean by 'class'

The internal "code name" of the object. In this case it's UberBoxPedestal.

But something is fishy here. As soon as I change the scriptClass entry in the OBJK ressource to make the object use the altered code, the damned thing won't show up in the buymode catalog anymore. I've checked the spelling for typos and re-hashed the S3SA's instance countless times. Did you build your package on an ancient burial ground by any chance?

Is there an object-modder around who had such a problem before? And solved it?

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Lab Assistant
Original Poster
#11 Old 29th May 2010 at 9:04 AM
Quote: Originally posted by Buzzler
The internal "code name" of the object. In this case it's UberBoxPedestal.

But something is fishy here. As soon as I change the scriptClass entry in the OBJK ressource to make the object use the altered code, the damned thing won't show up in the buymode catalog anymore. I've checked the spelling for typos and re-hashed the S3SA's instance countless times. Did you build your package on an ancient burial ground by any chance?

Is there an object-modder around who had such a problem before? And solved it?




Oh dear,,,I forgot...I'm so sorry... this was built using TSRW, and HugeLunatic told me that objects built with TSRW won't show up ingame if they were modified in sim3PE... So so so so sorry for my stupid mistake... I guess I'll revert to the original plan; making an invisible recolour, so player can turn the object invisible manually in the buy/build mode....
One horse disagreer of the Apocalypse
#12 Old 29th May 2010 at 11:35 AM
There is a way round this. In TSRW, go into project contents and export as package. In S3PE delete *everything* apart from the one resource you need to edit. Edit that then go back into TSRW, Project Contents again. Delete the relevant resource from there, then import your package at the same screen. The project won't know the difference and will continue to behave well as a sims3pack.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
1978 gallons of pancake batter
#13 Old 29th May 2010 at 12:35 PM
Quote: Originally posted by sims_reality
this was built using TSRW, and HugeLunatic told me that objects built with TSRW won't show up ingame if they were modified in sim3PE...

How evil. Well, I could make a standalone script package, and then you could change the OBJK resource the way Inge pointed out to make the objects use the script. This plan has a flaw: I don't even know yet, if the code is going to make the objects behave the way I think it will. And I won't test it myself, since I don't want TSRW on my computer.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Me? Sarcastic? Never.
staff: administrator
#14 Old 29th May 2010 at 1:20 PM
Definitely evil. I wish they would fix it. You could just clone the pedestal cube in S3OC and test it, since all you want to know is if it will fade in/out.

This script class, is this another resource that needs to be added to the package then? Since you modified the cube one? Well if your new clone works you could just create a package of those two iresources. Then sims-reality can delete the objk and import your resources.
1978 gallons of pancake batter
#15 Old 29th May 2010 at 3:03 PM Last edited by Buzzler : 8th Nov 2010 at 11:18 PM. Reason: Going through old posts, removing outdated/borked scripts.
Quote: Originally posted by HugeLunatic
You could just clone the pedestal cube in S3OC and test it, since all you want to know is if it will fade in/out.

Excellent idea, I'm glad I had it. It works and the separate script package works, too. Kinda nice when things turn out to be as simple as I thought they'd be, for once. This is all the script that's needed:
Code:
using Sims3.Gameplay.Interfaces;
using Sims3.Gameplay.Abstracts;
using Sims3.Gameplay.Objects.Decorations;
using Sims3.SimIFace;

namespace OPH
{
    public class Pedestal : UberBoxPedestal, IBuildBuyListener
    {
        public void OnEnterBuildBuyMode()
        {
            World.ObjectSetOpacity(this.ObjectId, 1f, GameObject.kGlobalObjectFadeTime);
        }
        public void OnExitBuildBuyMode()
        {
            World.ObjectSetOpacity(this.ObjectId, 0f, GameObject.kGlobalObjectFadeTime);
        }
    }
}


Quote:
This script class, is this another resource that needs to be added to the package then?

scriptClass is a key in the OBJK resource which determines the script the object is supposed to use. If I want it to use a custom script, I have to provide this script in a S3SA resource.

Quote:
Then sims-reality can delete the objk and import your resources.
Is that how it works? I'm not a mesher or anything; I just do scripts. I don't know if anything in the OBJK resource might be unique for every object.

Edit: Adding the S3SA resource once in every package might not be the best idea. This would make the Pedestal class and the methods ambiguous. Usually, such a thing should better be avoided.

@sims_reality: Do you want the invisibility stuff to be adjustable by the player? Whether or not he wants the object to turn invisible in live mode? If so I'll add an interaction to the code to make it configurable.

I've attached the script package for now. To use it, you'll need to change the scriptClass key in the OBJK resource to "OPH.Pedestal". You can either add the S3SA resource from the OPH_Script.package or just throw it into your mods folder the way it is.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
One horse disagreer of the Apocalypse
#16 Old 29th May 2010 at 3:48 PM
No you can't just delete and replace the OBJK with one from another object. This has to be done by editing the scriptclass name field manually. But it's only a string to overwrite, no biggie. And remember the object will then need its own copy of the tuning xml, with an appropriate IID as is indicated on one of the tutorials for doing these things.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
1978 gallons of pancake batter
#17 Old 29th May 2010 at 4:29 PM
Quote: Originally posted by Inge Jones
And remember the object will then need its own copy of the tuning xml, with an appropriate IID as is indicated on one of the tutorials for doing these things.

This is only necessary to get TS3 to instantiate an object-less scripting mod. Object mods work perfectly fine without it.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
One horse disagreer of the Apocalypse
#18 Old 29th May 2010 at 4:51 PM
They may do, but wouldn't the OP be expecting to have tuning applied to her object?

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
1978 gallons of pancake batter
#19 Old 29th May 2010 at 5:16 PM
Quote: Originally posted by Inge Jones
They may do, but wouldn't the OP be expecting to have tuning applied to her object?

There aren't any variables in the Pedestal class, so there's nothing that could actually be made tunable. Actually there's only one variable being used at all, and that's kGlobalObjectFadeTime. That's a tunable float, but it "belongs" to the abstract GameObject class and it's really not the place of such a mod to modify it. And everything tunable that might affect the base class, will already affect the derived class as it is.

BTW: Isn't the OP a "he"?

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
One horse disagreer of the Apocalypse
#20 Old 29th May 2010 at 6:28 PM
I thought it was the person of the same name from N99? Maybe not then.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Alchemist
#21 Old 3rd Jun 2010 at 1:01 AM
I apologize for the bump. I can't tell, after multiple readings of this thread, if issue #3 on SR's list was resolved, and if it was, if it was resolved for the specific object he has or for all objects.
1978 gallons of pancake batter
#22 Old 3rd Jun 2010 at 5:05 PM
Quote: Originally posted by orangemittens
I can't tell, after multiple readings of this thread, if issue #3 on SR's list was resolved, and if it was, if it was resolved for the specific object he has or for all objects.

Well, I don't know if SR has solved his specific issues, but I think in principle the issue is resolved.

This simple method will work for every kind of object that doesn't implement the IBuildBuyListener interface already. It's basically the same code all the time; only the "UberBoxPedestal" has to be changed to match the class an object was originally using. For objects which already use the interface it will be more difficult.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Alchemist
#23 Old 4th Jun 2010 at 12:21 AM
Thank you for the answer. So, to make this change go to the OBJK in S3PE and from there to the Component Data, then CDT String, then Key and change the word scriptclass there?...is that the right place to be looking?

Also, how can you figure out whether the object already uses the IBuildBuyListener interface or not?

If they don't, am I correct in thinking that when you say, "only the "UberBoxPedestal" has to be changed to match the class an object was originally using..." that this is a change in the code you posted...that is, change the name UberBoxPedestal to whatever is the name of the object the change is currently being attempted on?

Thanks for any help on this.
1978 gallons of pancake batter
#24 Old 4th Jun 2010 at 6:36 PM
Quote: Originally posted by orangemittens
Thank you for the answer. So, to make this change go to the OBJK in S3PE and from there to the Component Data, then CDT String, then Key and change the word scriptclass there?

Almost. Leave the key and thus the word scriptClass untouched. What you're looking for is right below it in the Data field. Initially it will say something like "Sims3.Gameplay.Objects.Decorations.UberBoxPedestal". That is the original scriptClass with the complete namespace "hierarchy". If you take a look at the code I posted, you'll see that I wrote "using Sims3.Gameplay.Objects.Decorations;" at the beginning, so I could simply write "UberBoxPedestal" omitting the namespaces.

For the given example that field would need to be changed to "OPH.Pedestal" for that's namespace plus class name in the code.

The UberBoxPedestal after the colon in the code, will give an object that uses this code all the properties an object has that uses the UberBoxPedestal class directly. (That's the magic of object-oriented programming and its main features inheritance and polymorphism.)

Quote:
Also, how can you figure out whether the object already uses the IBuildBuyListener interface or not?

That's where extracting the game scripts with S3PE and analyzing them with Reflector comes into play. As far as I can tell it's a lot of WA objects (lights and tomb objects in general), all modular objects, the sprinkler and the trampoline ... wait a second! There's a trampoline?

Quote:
If they don't, am I correct in thinking that when you say, "only the "UberBoxPedestal" has to be changed to match the class an object was originally using..." that this is a change in the code you posted...that is, change the name UberBoxPedestal to whatever is the name of the object the change is currently being attempted on?

Yes. Since this will only take a few seconds, I could compile and upload fitting DLLs as required (with a more generic one-fits-all name than OPH.Pedestal). No need for people who don't do script modding to get the hand of Visual C#. And I could still add an interaction to make the invisibility thing configurable. This wouldn't be localized or localizable, though, because I just find that tedious.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Alchemist
#25 Old 4th Jun 2010 at 10:29 PM
Thank you again for your reply

Questions, where did you get the OPH that you put in after the namespace in your code? I looked at the object this was made for in S3PE and can't find it. It sounds like from what you've said that someone could take the code, make a change in the package OBJK, make another change in the code itself, and then this would work...is that correct? And just those two changes?

And then you would also have to, "...add the S3SA resource from the OPH_Script.package or just throw it into your mods folder the way it is..." Right?

When you say configurable do you mean choose-able by the person who downloaded it? If so, this would be a great feature. I'm not sure what localized or localizable mean in the context with which you're using them and also, not sure what you mean by fitting DLL unless by that you mean code that is more targeted to something different (or more general) than SR's specific object.

WA has a trampoline...really?...who knew? And since you've brought up WA I've got one more question...lol. I apologize that this is only marginally on-topic but do you think it's possible to get the WA Tiki lamp flame onto user-made objects (at least for people who have WA installed) using this kind of coding method? If the answer to that is yes, would coding also be of use in scaling it how they have it scaled from one object to another?
Page 1 of 2
Back to top