Sign in to follow this  
osmRhodey

Attempting to link a file with the Status Announcement Mod

Recommended Posts

osmRhodey    1467

All right @rezecib here is the coding as promised and how it is with my mod along with small screenshots to show where stuff is located. Ignore the text being gibberish I had simply wanted to make sure it was reading the things I wrote.

 

My modmain.lua coding with the modimport bolded

Spoiler

PrefabFiles = {
    "luce",
}

Spoiler

 

Assets = {
    Asset( "IMAGE", "images/saveslot_portraits/luce.tex" ),
    Asset( "ATLAS", "images/saveslot_portraits/luce.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/luce.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/luce.xml" ),
    
    Asset( "IMAGE", "images/selectscreen_portraits/luce_silho.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/luce_silho.xml" ),

    Asset( "IMAGE", "bigportraits/luce.tex" ),
    Asset( "ATLAS", "bigportraits/luce.xml" ),
    
    Asset( "IMAGE", "images/map_icons/luce.tex" ),
    Asset( "ATLAS", "images/map_icons/luce.xml" ),
    
    Asset( "IMAGE", "images/avatars/avatar_luce.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_luce.xml" ),
    
    Asset( "IMAGE", "images/avatars/avatar_ghost_luce.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_ghost_luce.xml" ),

}

 

local require = GLOBAL.require
local STRINGS = GLOBAL.STRINGS


-- The character select screen lines
STRINGS.CHARACTER_TITLES.LUCE = "Lucy the Lost"
STRINGS.CHARACTER_NAMES.LUCE = "Lucy"
STRINGS.CHARACTER_DESCRIPTIONS.LUCE = "*Good in the outdoors\n*Has horrible memories\n*Quite Crafty"
STRINGS.CHARACTER_QUOTES.LUCE = "\"Woodie, where are you?\""

-- Custom speech strings
STRINGS.CHARACTERS.LUCE = require "speech_luce"
modimport ("announcestrings.lua") --Posted here as no matter where it went the server had crashed.


-- The character's name as appears in-game 
STRINGS.NAMES.LUCE = "Lucy"

-- The default responses of examining the character
STRINGS.CHARACTERS.GENERIC.DESCRIBE.LUCE = 
{
    GENERIC = "It's Lucy!",
    ATTACKER = "That Lucy looks shifty...",
    MURDERER = "Murderer!",
    REVIVER = "Lucy, friend of ghosts.",
    GHOST = "Lucy could use a heart.",
}

-- --For Rezecib's Status Announcement mod. It is called over in his mod.
-- GLOBAL.STRINGS._STATUS_ANNOUNCEMENTS.LUCE = {
        -- HUNGER = {
            -- FULL  = "fdg",     -- >75%
            -- HIGH  = "dfg",            -- >55%
            -- MID   = "dfgdfg",     -- >35%
            -- LOW   = "dfgdg",                 -- >15%
            -- EMPTY = "dfgh",             -- <15%
        -- },
        -- SANITY = {
            -- FULL  = "nfh",             -- >75%
            -- HIGH  = "hmjgh",                 -- >55%
            -- MID   = "hyt",                 -- >35%
            -- LOW   = "gjh",             -- >15%
            -- EMPTY = "hjgj",     -- <15%
        -- },
        -- HEALTH = {
            -- FULL  = "jtyj",     -- 100%
            -- HIGH  = "dfg",     -- >75%
            -- MID   = "fgh",             -- >50%
            -- LOW   = "dfg",     -- >25%
            -- EMPTY = "qew",     -- <25%
        -- },
        -- WETNESS = {
            -- FULL  = "zx",     -- >75%
            -- HIGH  = "yu",                    -- >55%
            -- MID   = "oui",                 -- >35%
            -- LOW   = "kuiy",         -- >15%
            -- EMPTY = "tfgh",                 -- <15%
        -- },
    -- }

AddMinimapAtlas("images/map_icons/luce.xml")

-- Add mod character to mod character list. Also specify a gender. Possible genders are MALE, FEMALE, ROBOT, NEUTRAL, and PLURAL.
AddModCharacter("luce", "FEMALE")

The announcestrings.lua file that is placed underneath my character's speech files

Spoiler

GLOBAL.STRINGS._STATUS_ANNOUNCEMENTS.LUCE = {
        HUNGER = {
            FULL  = "fdg",     -- >75%
            HIGH  = "dfg",            -- >55%
            MID   = "dfgdfg",     -- >35%
            LOW   = "dfgdg",                 -- >15%
            EMPTY = "dfgh",             -- <15%
        },
        SANITY = {
            FULL  = "nfh",             -- >75%
            HIGH  = "hmjgh",                 -- >55%
            MID   = "hyt",                 -- >35%
            LOW   = "gjh",             -- >15%
            EMPTY = "hjgj",     -- <15%
        },
        HEALTH = {
            FULL  = "jtyj",     -- 100%
            HIGH  = "dfg",     -- >75%
            MID   = "fgh",             -- >50%
            LOW   = "dfg",     -- >25%
            EMPTY = "qew",     -- <25%
        },
        WETNESS = {
            FULL  = "zx",     -- >75%
            HIGH  = "yu",                    -- >55%
            MID   = "oui",                 -- >35%
            LOW   = "kuiy",         -- >15%
            EMPTY = "tfgh",                 -- <15%
        },
    }

An image of where the file is located which is in the scripts folder of the mod

noJd3Lf.png

Share this post


Link to post
Share on other sites
Aquaterion    821

I think modimport starts from ur mod folder, so i think it would have to be

modimport("scripts/announcestrings.lua")

or you should be able to use(might require "GLOBAL." infront of it):

RunScript("announcestrings")

 

Edited by Aquaterion

Share this post


Link to post
Share on other sites
osmRhodey    1467
5 minutes ago, Aquaterion said:

I think modimport starts from ur mod folder, so i think it would have to be


modimport("scripts/announcestrings.lua")

or you should be able to use:


RunScript("announcestrings")

 

I'll try it, give me a moment! :)

EDIT: All right I tried the first one and it works fine! Thank you! I had forgotten to tell it to go to the other folder!

Edited by osmRhodey

Share this post


Link to post
Share on other sites
Aquaterion    821
8 minutes ago, Mobbstar said:

Out of curiosity, does it crash without status announcer?

I don't see why unused strings would do that, but anything can happen I guess

Share this post


Link to post
Share on other sites
Mobbstar    14052
12 minutes ago, Aquaterion said:

I don't see why unused strings would do that, but anything can happen I guess

Well, TheLetterW just showed me a bug with her version of the file. The strings tab does not exist without status announcer, thus resulting in a crash.

A simple if-check solves this.

Share this post


Link to post
Share on other sites

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
Sign in to follow this