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!
One horse disagreer of the Apocalypse
Original Poster
#26 Old 28th Feb 2016 at 8:51 AM
All the examples I have seen and the tdesc itself speak of things in the sim's inventory. There is no guidance for how to express that I want to use the lot's retail-fridge shared inventory. And I want to delete an object of matching type, not the object itself of course, which needs to stay where it is and just change back into a food instead of a restocking sign. Maybe EA devs found it too hard also, which is why restocking is not done from existing stock

My main thing right now is the need for a way to find out if the game is even trying to run the script I wrote via do_command! Just a "Hello world" popup would be good, or a "lastException" entry even.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Advertisement
Deceased
#27 Old 28th Feb 2016 at 9:29 AM
Quote: Originally posted by Inge Jones
All the examples I have seen and the tdesc itself speak of things in the sim's inventory. There is no guidance for how to express that I want to use the lot's retail-fridge shared inventory. And I want to delete an object of matching type, not the object itself of course, which needs to stay where it is and just change back into a food instead of a restocking sign. Maybe EA devs found it too hard also, which is why restocking is not done from existing stock

More likely they just didn't think of it, as this kind of thing would be easy enough to add to the tuning. For your purpose it's probably easier to just use a do_command script. Like I said earlier, targeting the fridge inventory would be the difficult part for a pure XML mod since the fridge isn't a participant of the interaction.

Seems like you can click an oven to start cooking and presumably this would use ingredients from the fridge? Perhaps it's worth looking at the tuning for that interaction sequence to see how they do that? Although, as you said before you'd rather avoid doing a staged interaction and stick with a one-shot. So scripting works.

Quote:
My main thing right now is the need for a way to find out if the game is even trying to run the script I wrote via do_command! Just a "Hello world" popup would be good, or a "lastException" entry even.

This is a handy function I've posted before but I don't recall where exactly, that I keep in my Script Testing/Scripts folder as "ScumLog.py" so I can include and call it to log to an output file while the game is running without having to write a logging function everytime I want to use one.

Or if you prefer an in-game pop-up like you stated, that can be done as well but takes a bit more coding and limits how much information you can dump at any one time. See my post on In Game Notifications
Deceased
#28 Old 28th Feb 2016 at 9:33 AM
Another handy thing you'll want for developing scripts is to reload the script on the fly from in the game. If you put the reload.py module into the same folder as your script development folder, you can issue a reload command in the game cheat window to reload that module you're working on after changing without having to exit the game and restart. See the thread on reload.py: http://modthesims.info/showthread.php?t=534451
One horse disagreer of the Apocalypse
Original Poster
#29 Old 28th Feb 2016 at 10:03 AM Last edited by Inge Jones : 28th Feb 2016 at 11:15 AM.
Thanks Sumbumbo, will look into all this. The reload won't help me tho in this case cos I have to keep restarting the game without saving cos I need to get back to when the restock sign is ready for restocking :D

Later: Wheee! The script actually ran, as evidenced by a log file. That's a start, now at least I just have to work on getting it to do what I want.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
One horse disagreer of the Apocalypse
Original Poster
#30 Old 28th Feb 2016 at 8:13 PM Last edited by Inge Jones : 28th Feb 2016 at 9:21 PM.
Finally got it working!!! That was a struggle and a half :rolleyes

The only slight drawback is it can't tell the difference between a 4-serving and an 8-serving platter, tho I guess I could find out where the serving number is stored and do an additional test before the deletion. Anyway I feel as if I have got somewhere today :D

Later: Ok although I found out how to get serving number from the crafting component tuning, I don't think it's going to be a good idea to use it, because the interaction inventory test does not. I can see a situation where there is a 4-serving mac'n'cheese in the freezer, and it enables you to go on restocking 8-serving mac'n'cheese completely free forever cos it doesn't match serving size so won't be removed from the freezer. Or maybe I could take the right size by preference but if there isn't one, then take a non-matching one. That I think might be a good compromise.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Page 2 of 2
Back to top