Checking for time and stack object stuff
#11 04-03-2016 
Okay Smile But like I said, I specifically want to test stack object, because I know stack object holds the specific object that I need to test, in the correct setting. Testing it for the entire lot doesn't work because there may be more than one object present, and it may not apply to this Sim in this situation.

Anything that can be tested on stack object could work, as long as it's unique to this object. That's why I said guid, because I know that'll be unique. But if there's something else that can be made unique to the object, a flag of some sort, that would work too. The key is that it has to be a check that uses stack object.

0
#12 04-03-2016 
@gummilutt, what about attributes? You can set an attribute for stack object and then check for it, just like you do with flags. You can either use a semi global attribute, or a local one that you make up yourself (I'd suggest the last one). In the latter case you need to define the attribute in a text list first (can't for the life of me remember the required instance number right now and don't have a way to check, but I can dig it up tomorrow - I lurve attributes, I use them in my objects all the time), but that's the only additional thing you need to do.

1
#13 04-03-2016 
That might work Nix Smile It depends, where are we setting the attribute?

I should probably explain myself more clearly. Sorry, I'm bad at that Tongue This is the scenario; it has been determined that the Sim owns a car. This is done by a BHAV I made, and I know the stack object in this BHAV is the specific car that this Sim has been found to own. What I want to do is check if the car the Sim owns (= the car currently held in stack objects), is one of my tiny cars. I need to be able to look for something specific to the tiny type of cars. Because of this, we can't set the attribute in the BHAV that's holding stack object, because the car could be a regular big car as well. I want to be able to distinguish between a regular big car, and my custom created tiny cars. Therefore it needs to check for something that's set in the tiny car package, like guid, or some kind of flag that a maxis made big car would not normally have.

For example, my tiny cars have placement flags that allow them to sit on all kinds of surfaces. If there's a way to test stack object for such a flag, that would be one way to tell my tiny cars from big regular cars, because big regular cars do not have that flag. In fact, that'd be even better than guid, since it would then check for all three tiny cars in one line Smile

Edit: I noticed that Stack Object's definition has a lot of things like placement flags, and also stuff found in OBJD (price for example). I feel like something in that should be usable, if only I knew what and how to set it up properly.

0
#14 04-03-2016 
Obviously, the point is escaping you, @gummilutt. The thing is that there is no method to test one item and find its GUID. You *must* test the lot to see if an item of your specific GUID exists. Forget that the object is in Stack Object. If you're going to work inside the house, does it matter what the weather outside is like? In this case, just don't bother with the item in Stack Object, because you have no way to test its GUID.

And what's that about multiple objects? You're planning to have multiple cars on the driveway?

How about testing for the GUID of a car, and if one is found, checking its attributes to see to whom it belongs? If the car is not your sim's, you search for the next object of the apprpriate GUID (another car) and see if *that* is the right one?

1
#15 04-03-2016 
@gummilutt I'll have to come back to this tomorrow, I feel I'm a little too tired for this right now. (I probably shouldn't have replied right before going to bed. Tongue) I can say that it would be much easier for me to try to figure things out if I could look at the package, though, but I understand completely if you don't want it spread around.

TTYL.

1
#16 04-03-2016 
You have a point Nix. I've put one of the tiny cars, and the bhav I'm talking about in a zip. Download it here: http://simfil.es/58968/
When the BHAV sends true, it's saying the Sim owns a car. When it sends false, it's saying the Sim does not own a car. I would like to make it more specific, so that it only sends true if the car is one of the tiny car.

Okay BO Smile Thank you, now I know I can't check for guid. That's one thing off the list of potential solutions. I believe there are other ways that might work, it's just a matter of finding it.

No, I am not planning to have multiple cars on the driveway. But my tiny ownable cars come in three different meshes, to give people some variety. I wouldn't want to stare at the same miniature Smoogo Minima in every other household. There are more reasons for it, but suffice to say there are three cars and I want to check all of them Smile

Testing for guid first and then checking to see who owns that car is a possible approach, sure. Do you know how to check who owns a car? I do not, but if you do then great, I'd be happy to try that approach. You're welcome to download the package if you want, and see if you can figure out how to adapt the BHAV to first check lot for the tiny car guid, and then who owns that lot. But for me, it's easier to try and figure out one check to add to my existing working BHAV, than try to write a new one that I have no idea where to even begin with Smile

0
#17 04-03-2016 
I apologize for double posting, but the wonderful MSD helped me figure it out in chat Smile It's now set up to check Stack Object's height allowed flag for tables. That flag is set for my cars, but not for regular cars, so now I can tell them apart. Thanks a ton MSD <3

And by some kind of weird force in the air today, I also managed to figure out a solution to the inventory approach, so now I have that working as well. Holy rabies! I need to put it all together in one package, and fix a few details, but this project is pretty much done! Yaaaaay!

3
#18 04-03-2016 
Great! Well done, @gummilutt. You're combining resources and finding more creative solutions. You're well on your way to becoming a modder of note! Big Grin

Anyway, what I meant to say, was that cars in any sim's inventory, are NOT on the lot. So if three sims each own a tiny car, *and* there is a normal car on the driveway, there are obviously four distinct inventories that each contains exactly *one* car.
Also, if your tiny cars are proper cloned instances of any of the maxis cars, they are also clones of the concept car that all maxis cars are instances of. So if you figure out the GUID of that specific mother-of-all-cars, there *is* a way to test for *any* car with a single GUID, just in case you want to see if any car is present, but don't care which car you find.

1
#19 04-03-2016 
Thank you BO Smile I'm starting to feel like a real modder. It's a great feeling, writing your own code from scratch, and having it work just like you intended it to. I still need to ask you guys questions here and there, there's far more I don't know than I do know, but I feel less like a total noob Big Grin

1
#20 04-03-2016 
@gummilutt congrats! That's a clever solution. Smile And you're definitely no noob! At this rate, it won't be long before you can run rings around all of us. Big Grin

1


Sorry, that is a members only option