Jump to content

Recommended Posts

I wanted to make a character mod that featured a sentient item like Lucy The Axe. I haven't actually started, I am just trying to get my knowledge in order before I make an attempt. I went through the game files to try and search for Lucy's speech files, but all I could find was a reference to strings from a database. I looked through lavaarena_lucy.lua, lucy.lua, lucy_classified.lua, and sentientaxe.lua and could only find speech related things in lucy_classified.lua. Is there any way to locally view the speech file, so that I can compare and try and use it as a framework for my mod, so I can learn how to do it effectively? I'm fairly new with Lua, but I understand most of it while sucking at writing it, so I want to try and get a general idea of how to do things first, and who is a better modder than the developers themselves?

Link to comment
https://forums.kleientertainment.com/forums/topic/84151-modding-help/
Share on other sites

When you open lucy.lua and look at the custom onhaunt function, you see this line:

inst.components.sentientaxe:Say(STRINGS.LUCY.on_haunt)

meaning the things she says are stored in "STRINGS" which is defined in strings.lua, which has a section for lucy, which looks like this:

STRINGS.LUCY =
{
    equipped =
    {
        "Let's chop some trees!",
        "Nice day for a walk!",
        "We make a good team!",
        "There must be some trees around here somewhere.",
        "This is perfect chopping weather.",
        "A perfect day for some chopping.",
        "You've got chops, buddy.",
        "Hey! Chop some trees!",
        "All work and no play makes me want to chop some trees.",
        "Chop chop chop. Heh.",
        "Chop, c-c-chop!",
        "So, stone trees... what's up with that?",
        "Let's find a small grove and just go nuts!",
    },

    on_ground =
    {
        "Come back! Take we with you!",
        "Where did you go?",
        "Take me with you!",
        "It's cold!",
        "I'm getting dirty!",
        "There's monsters around you know!",
        "I resent that!",
        "You're abandoning me?!",
        "But... but we're inseparable!",
        "Hey! Get back over here!",
        "I can't chop trees by myself!",
        "So... lonely...",
        "I guess I'll just stay here then...",
        "What if I get stolen?!",
    },


and so on

so inst.components.sentientaxe:Say(STRINGS.LUCY.on_haunt), takes a random "value"(a sentence) from on_haunt, which is stored in LUCY which is stored in STRINGS which is defined in strings.lua

Edited by spideswine
1 hour ago, spideswine said:

When you open lucy.lua and look at the custom onhaunt function, you see this line:

inst.components.sentientaxe:Say(STRINGS.LUCY.on_haunt)

meaning the things she says are stored in "STRINGS" which is defined in strings.lua, which has a section for lucy, which looks like this:

STRINGS.LUCY =
{
    equipped =
    {
        "Let's chop some trees!",
        "Nice day for a walk!",
        "We make a good team!",
        "There must be some trees around here somewhere.",
        "This is perfect chopping weather.",
        "A perfect day for some chopping.",
        "You've got chops, buddy.",
        "Hey! Chop some trees!",
        "All work and no play makes me want to chop some trees.",
        "Chop chop chop. Heh.",
        "Chop, c-c-chop!",
        "So, stone trees... what's up with that?",
        "Let's find a small grove and just go nuts!",
    },

    on_ground =
    {
        "Come back! Take we with you!",
        "Where did you go?",
        "Take me with you!",
        "It's cold!",
        "I'm getting dirty!",
        "There's monsters around you know!",
        "I resent that!",
        "You're abandoning me?!",
        "But... but we're inseparable!",
        "Hey! Get back over here!",
        "I can't chop trees by myself!",
        "So... lonely...",
        "I guess I'll just stay here then...",
        "What if I get stolen?!",
    },


and so on

so inst.components.sentientaxe:Say(STRINGS.LUCY.on_haunt), takes a random "value"(a sentence) from on_haunt, which is stored in LUCY which is stored in STRINGS which is defined in strings.lua

Oh, I thought it was querying a database or something, thanks! I am assuming for a smaller-scale mod, I would just need to create a secondary speech file for the item and have it be called to within the actual item's .lua file?

4 minutes ago, spideswine said:

Yes, but I suppose you could just define the speech in the item's lua as well.

Good to know. I am not new to modding, but I am new to modding DST, so I appreciate the assistance in helping me understand the lua language!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...