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!
Quick Reply
Search this Thread
Field Researcher
Original Poster
#1 Old 5th Dec 2020 at 4:41 PM Last edited by lizcandor : 5th Dec 2020 at 8:58 PM.
Default [Resolved]Object script replacement causes crash
I'm trying to replace the script for an object with an altered version without changing anything else about it. I was thinking I could do that by making a default replacement for the object, deriving a new class from the object's original class, changing the methods of the new class that I want to be different, and then making the default replacement object's OBJK point to the new class instead of the normal one; I've followed Lyralei's default replacement tutorial here to try to do that, and it's definitely done something because the game now crashes when it tries to create an instance of the object, but that's not exactly the intended outcome.

Does anyone know what kind of mistake might cause this? "Game turns entirely off" isn't an error my usual debugging methods are equipped to shed much light on I at least know that whatever happens must be happening before any of the object's methods try to run, since I put debugging messages in all of them that don't appear before the crash.
Advertisement
Space Pony
#2 Old 5th Dec 2020 at 5:50 PM
Its a bit hard to tell (at least for me)

did you try to do a replacement with the original script and tested that to see if the replacement procedure worked ?
if so it has to be script related, other wise theres something off with your object cloning.

uploading the package and or source code would be helpful
Field Researcher
Original Poster
#3 Old 5th Dec 2020 at 6:04 PM Last edited by lizcandor : 13th Dec 2020 at 10:29 PM.
Hm, I've tried a minimal-changes version of the script but not a no-changes-at-all version - I'll give that a shot real quick and then upload my files!

Okay, no luck there. This is what the class looks like now, with the only changes being that it's derived from the original class and hides a bunch of the original methods with its own identical versions. The package for the object replacement is attached - I've got the script and the object in separate packages since this is just one part of a larger project, if that matters.
Space Pony
#4 Old 5th Dec 2020 at 7:24 PM
your code is not within the Object namespace you might want to change that

when dealing with direct object mods always use the Sims3.Gameplay.Objects namespace
Field Researcher
Original Poster
#5 Old 5th Dec 2020 at 7:27 PM
Quote: Originally posted by Battery
your code is not within the Object namespace you might want to change that

darn it Thank you!

In the object modding tutorial (which for some reason it didn't occur to me applied to all object modding not just creating totally new stuff) there's this warning: "In case of object mods, you'll always need to put an object's class in a namespace that begins with Sims3.Gameplay.Objects. If you don't do that, the object will cause the game to crash when you try to buy it in the catalog" hmmm yep sounds familiar
Back to top