Replies: 2 (Who?), Viewed: 357 times.
Field Researcher
Original Poster
#1 Old 10th Apr 2020 at 4:54 AM
Default Overriding an objLua in the ObjectScripts.package ?
I'd like to redo/override one of the objLua objects found in the ObjectScripts package but there doesn't seem to be much information about doing that sort of thing in TS2 that I have been able to find.

1) Can it be done? If so, do I code my own Lua program and then what? I don't want to touch/change the original ObjectScripts.package file even if I could. Plus I haven't yet figured out how to make a Lua program into a package file, assuming that a package file could somehow override that one objLua in the ObjectScripts.package.

2) Is there a way to see exactly what the Maxis Lua script does? When viewing it in SimPE, the resource I want to override (Attraction) doesn't show its code. It shows Constants, Functions and Instructions, but not in a familiar way. If it is possible to override the Lua script, I want to ensure that I handle everything the original script does so I'd really need to see the actual code.

3) I've found a de-assembled "lst" file of the Attraction script but haven't found a viewer for that file which makes sense yet. (Any suggestions?) In another thread here, it was determined that the Attraction objLua resource could not be de-compiled, only de-assembled.

4) Is modding one (or more) of the BHAVs which call the Lua script where I need to be focusing instead? Letting the Lua script return its value(s) and then writing a whole lot of BHAV code to change values as I want them?

Has anyone actually over-ridden anything in the ObjectScripts.package before? Or is doing that just wishful thinking on my part?

All of my Conversions, Creations and Stories may be found here:
HobbesED's Conversions and Creations
Advertisement
Field Researcher
#2 Old 10th Apr 2020 at 9:48 AM
In the BHAV tutorials by AdidasSG6 there is a chapter about Lua here
Field Researcher
Original Poster
#3 Old 10th Apr 2020 at 1:57 PM
Thank you. I've been through that already. Unfortunately much of that is creating, compiling and assigning a new Lua script to an object and what I need to do is look at an existing already compiled script (where I haven't been able to find Maxis' Lua source code) and which isn't assigned to an object and over-ride it.

Plus AdidasSG6 admitted he didn't know how to run external objLua files without placing them in the ObjectScripts.package file which is why I asked here. Creating a mod which requires users to replace their ObjectScripts.package file is not a good option in my opinion since that package's contents and location changes based upon what EPs the user has installed.

All of my Conversions, Creations and Stories may be found here:
HobbesED's Conversions and Creations
Back to top