Jump to content
Propfam

How to make a Lua dat?

6 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Hello,

I've seen tons of dats with Lua file. How do I properly make such thing in the first place? I didn't find any viable option on Reader. I did find an Insert File menu. But, it doesn't support Lua files. I wish I can find more tools on the internet. Unfortunately, the down of Devotion makes everything lost and no, Evermore doesn't have more modding tools at the time of this writing.

Thanks.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I'm guessing that @Cyclone Boom might know some of it, as I remember you both with Cori did some Lua mods back when she was active here.

  • Like 1

matias93's Unexpected Mod Workshop (dev thread)             Ciudad del Lago in the making (dev City Journal)

"Let us be scientists and as such, remember always that the purpose of politics
is not freedom, nor authority, nor is any principle of abstract character,
but it is to meet the social needs of man and the development of the society"

— Valentín Letelier, 1895

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    18 minutes ago, matias93 said:

    I'm guessing that @Cyclone Boom might know some of it, as I remember you both with Cori did some Lua mods back when she was active here.

    Yes, indeed. I was there with Cori in 2020 till her and my hiatus in 2022. Since then, there's noone that focuses on Lua anymore. That's why I hope she will return, one day. Fingers crossed.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Reader 1.5.4 has the best support for writing LUA files.

    Here's the process:

    In reader 1.5.4, choose Insert File and pick some text file with lua code (it can just be a placeholder file with some hello world code, for example). Select undefined as the file type. To correctly identify as a LUA subfile, you'll need to change the TGI. Tools → Editor → TGI, and give your new subfile a type of 0xca63e2a3 and group of 0x4a5e8ef6. Assign a random instance number. The entry type will not show as changed at this point, but if you close and reopen the file in reader you should be fine.

    Alternatively, you could always copy a LUA subfile from a different file into a new file.


    Looking for a prop or texture? The SC4 Prop & Texture Catalog might help! View online here.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    11 hours ago, nos.17 said:

    Reader 1.5.4 has the best support for writing LUA files.

    Here's the process:

    In reader 1.5.4, choose Insert File and pick some text file with lua code (it can just be a placeholder file with some hello world code, for example). Select undefined as the file type. To correctly identify as a LUA subfile, you'll need to change the TGI. Tools → Editor → TGI, and give your new subfile a type of 0xca63e2a3 and group of 0x4a5e8ef6. Assign a random instance number. The entry type will not show as changed at this point, but if you close and reopen the file in reader you should be fine.

    Alternatively, you could always copy a LUA subfile from a different file into a new file.

    I'm trying it. Wish me luck. However, I can't make the dir file. Is it okay? How do I properly make it? It seems like my Reader (also 1.5.4 and 0.9.3) is buggy.

    Update: It doesn't work at all. Only BSC Funding which my script based on is working. I even double checked my Ltext and Lua file and all references are mostly valid. One screenshot says it all:

    6506762bf0af6_Screenshot(3).png.9edab12333626ab0abe8de6284ae3814.png

    I haven't applied for a family range. That'd mean I may have to rework all of my mods, for consistency, including Cap Lifter, which could lead to possible aftermaths. Do scripts and Ltexts need a family range?

    Also, how do I open a query (or even, any) UI (including Census Repository) thru news message? I've a feeling that it can be done. It's just, I don't know how to do it.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    11 hours ago, elfrjz said:

    I'm trying it. Wish me luck. However, I can't make the dir file. Is it okay?

    Yes. DIR subfiles are directories of all the compressed subfiles in a dat. You have no compressed subfiles, so no DIR is created. See the wiki for more info.

    11 hours ago, elfrjz said:

    Update: It doesn't work at all. Only BSC Funding which my script based on is working. I even double checked my Ltext and Lua file and all references are mostly valid. One screenshot says it all:

    I unfortunately cannot help with your scripts, sorry. LUA is one of the things I've been meaning to dig into for awhile but have not head the opportunity to yet.

    11 hours ago, elfrjz said:

    I haven't applied for a family range. That'd mean I may have to rework all of my mods, for consistency, including Cap Lifter, which could lead to possible aftermaths. Do scripts and Ltexts need a family range?

    I'm not sure what you mean by this. Are you talking about prop/building families?

    Scripts and LTEXTS do not have "families". If you're talking about the Instance from the TGI, then it's best practice to just generate a random Instance ID. The chances of conflicts are incredibly improbable.

    11 hours ago, elfrjz said:

    Also, how do I open a query (or even, any) UI (including Census Repository) thru news message? I've a feeling that it can be done. It's just, I don't know how to do it.

    Your best bet is to find a mod that does this already, and examine how it is done.

    • Like 1

    Looking for a prop or texture? The SC4 Prop & Texture Catalog might help! View online here.

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections