Jump to content

Error [string "..mods/character/modmain.lua"]:79: '}' expected (to close '{' at line 76) near 'ATTACKER'


Recommended Posts

I've been working on a new mod recently, but I can't seem to test it because of the error in the script.
This may be the case that I am just blind or something, but i still can't figure it out.

 

PrefabFiles = {
    "gengar",
    "gengar_none",
}


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

    Asset( "IMAGE", "images/selectscreen_portraits/gengar.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/gengar.xml" ),
    
    Asset( "IMAGE", "images/selectscreen_portraits/gengar_silho.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/gengar_silho.xml" ),

    Asset( "IMAGE", "bigportraits/gengar.tex" ),
    Asset( "ATLAS", "bigportraits/gengar.xml" ),
    
    Asset( "IMAGE", "images/map_icons/gengar.tex" ),
    Asset( "ATLAS", "images/map_icons/gengar.xml" ),
    
    Asset( "IMAGE", "images/avatars/avatar_gengar.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_gengar.xml" ),
    
    Asset( "IMAGE", "images/avatars/avatar_ghost_gengar.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_ghost_gengar.xml" ),
    
    Asset( "IMAGE", "images/avatars/self_inspect_gengar.tex" ),
    Asset( "ATLAS", "images/avatars/self_inspect_gengar.xml" ),
    
    Asset( "IMAGE", "images/names_gengar.tex" ),
    Asset( "ATLAS", "images/names_gengar.xml" ),
    
    Asset( "IMAGE", "images/names_gold_gengar.tex" ),
    Asset( "ATLAS", "images/names_gold_gengar.xml" ),
    
    Asset( "IMAGE", "bigportraits/gengar_none.tex" ),
    Asset( "ATLAS", "bigportraits/gengar_none.xml" ),
    
    Asset("SOUNDPACKAGE","sound/gengar.fev"),
    Asset("SOUND","sound/gengar.fsb"),
}

RemapSoundEvent("dontstarve/characters/gengar","gengar/gengar")
RemapSoundEvent("dontstarve/characters/talk_LP","gengar/gengar/talk_LP")
RemapSoundEvent("dontstarve/characters/ghost_LP","gengar/gengar/ghost_LP")
RemapSoundEvent("dontstarve/characters/hurt","gengar/gengar/hurt")
RemapSoundEvent("dontstarve/characters/death_voice","gengar/gengar/death_voice")
RemapSoundEvent("dontstarve/characters/emote","gengar/gengar/emote")
RemapSoundEvent("dontstarve/characters/pose","gengar/gengar/pose")
RemapSoundEvent("dontstarve/characters/yawn","gengar/gengar/yawn")

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

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

-- The character select screen lines
STRINGS.CHARACTER_TITLES.gengar = "Ghost"
STRINGS.CHARACTER_NAMES.gengar = "Gengar"
STRINGS.CHARACTER_DESCRIPTIONS.gengar = "*Perk 1\n*Perk 2\n*Perk 3"
STRINGS.CHARACTER_QUOTES.gengar = "\"*gigle.*\""

-- Custom speech strings
STRINGS.CHARACTERS.GENGAR = require "speech_gengar"

-- The character's name as appears in-game
STRINGS.NAMES.GENGAR = "Gengar"

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


-- The default responses of examining the character
STRINGS.CHARACTERS.GENERIC.DESCRIBE.GENGAR = {

    GENERIC = "It looks peaceful?"
    ATTACKER = "It's giving me the creeps."
    MURDERER = "Stay away from me, freak!"
    REVIVER = "If you can revive, then why are you still a ghost?"
    GHOST = "It could use a revive or two."
}

Edited by PidorPi
Link to comment
Share on other sites

This is your problem.

-- The default responses of examining the character
STRINGS.CHARACTERS.GENERIC.DESCRIBE.GENGAR = {

    GENERIC = "It looks peaceful?"
    ATTACKER = "It's giving me the creeps."
    MURDERER = "Stay away from me, freak!"
    REVIVER = "If you can revive, then why are you still a ghost?"
    GHOST = "It could use a revive or two."
}

Contrary to your other STRINGS lines above this snippet, which save a single value (phrase in this case) to one "variable", this snippet of code declares an object containing several such declarations. In Lua, everything is an object. Objects can have references to other objects, and these references have names = a "variable". When declaring an object like this, you need to have commas indicating the splits between the pairs (sets of variables and values).

This should work.

-- The default responses of examining the character
STRINGS.CHARACTERS.GENERIC.DESCRIBE.GENGAR = {
    GENERIC = "It looks peaceful?",
    ATTACKER = "It's giving me the creeps.",
    MURDERER = "Stay away from me, freak!",
    REVIVER = "If you can revive, then why are you still a ghost?",
    GHOST = "It could use a revive or two."
}

It is basically shorthand for this:

STRINGS.CHARACTERS.GENERIC.DESCRIBE.GENGAR.GENERIC = "It looks peaceful?"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.GENGAR.ATTACKER = "It's giving me the creeps."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.GENGAR.MURDERER = "Stay away from me, freak!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.GENGAR.REVIVER = "If you can revive, then why are you still a ghost?"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.GENGAR.GHOST = "It could use a revive or two."

Generally, you want to use as few . as possible, since every single . is a reference lookup of some kind, so you can see why the list-thing is preferable when you have thousands of these declarations from both the game and mods.

Link to comment
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
 Share

×
×
  • Create New...