Jump to content

Recommended Posts

[00:00:32]: ModIndex:GetModsToLoad inserting moddir,     yuno    
[00:00:32]: loaded mod_config_data/modconfiguration_yuno    
[00:00:32]: Loading mod: yuno (Gasai Yuno) Version:1.2.3    
[00:00:32]: Mod: yuno (Gasai Yuno)    Loading modworldgenmain.lua    
[00:00:32]: Mod: yuno (Gasai Yuno)      Mod had no modworldgenmain.lua. Skipping.    
[00:00:32]: Mod: yuno (Gasai Yuno)    Loading modmain.lua    
[00:00:32]: Mod: yuno (Gasai Yuno)      Error loading mod!
[string "../mods/yuno/modmain.lua"]:147: '=' expected near 'local'

 

I dunno if I'm stupid or something but I've found the = and I've tried removing it,removing the spaces between it but it still shows the same error,please help 

Kasu, '=' expected near 'local' means that there SHOULD have been '=' but instead there is something else.

the only case i can predict causing this, if you have some kind of a code like
 

local var1           <-- var 1 is declared but no initial value is given. Thus an error, expected '=' found another 'local'
local var2 = ...

 

Edited by IvanX
Quote

-- Import the engine.
modimport("engine.lua")

-- Imports to keep the keyhandler from working while typing in chat.
Load "chatinputscreen"
Load "consolescreen"
Load "textedit"

PrefabFiles = {
    "YunoGasai",
    "YunoGasai_none",
    "yukkidoll",
}

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

    Asset( "IMAGE", "images/selectscreen_portraits/YunoGasai.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/YunoGasai.xml" ),
    
    Asset( "IMAGE", "images/selectscreen_portraits/YunoGasai_silho.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/YunoGasai_silho.xml" ),

    Asset( "IMAGE", "bigportraits/YunoGasai.tex" ),
    Asset( "ATLAS", "bigportraits/YunoGasai.xml" ),
    
    Asset( "IMAGE", "images/map_icons/YunoGasai.tex" ),
    Asset( "ATLAS", "images/map_icons/YunoGasai.xml" ),
    
    Asset( "IMAGE", "images/avatars/avatar_YunoGasai.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_YunoGasai.xml" ),
    
    Asset( "IMAGE", "images/avatars/avatar_ghost_YunoGasai.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_ghost_YunoGasai.xml" ),
    
    Asset( "IMAGE", "images/avatars/self_inspect_YunoGasai.tex" ),
    Asset( "ATLAS", "images/avatars/self_inspect_YunoGasai.xml" ),
    
    Asset( "IMAGE", "images/names_YunoGasai.tex" ),
    Asset( "ATLAS", "images/names_YunoGasai.xml" ),
    
    Asset( "IMAGE", "bigportraits/YunoGasai_none.tex" ),
    Asset( "ATLAS", "bigportraits/YunoGasai_none.xml" ),

}

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

--Transformation

local function YunoFn(inst)

local player = GLOBAL.ThePlayer

if inst:HasTag("playerghost") then return end
if inst.transformed then
inst.AnimState:SetBuild("Yuno")
    inst.SoundEmitter:PlaySound("dontstarve/sanity/creature2/taunt")
    local x, y, z = inst.Transform:GetWorldPosition()
    local fx = SpawnPrefab("lightning")
    fx.Transform:SetPosition(x, y, z)
    SpawnPrefab("statue_transition").Transform:SetPosition(inst:GetPosition():Get())
inst.components.locomotor.walkspeed = 6
inst.components.locomotor.runspeed = 8.5
inst.components.health.absorb = 0.10
inst.components.combat.damagemultiplier = 2
inst.Transform:SetScale(0.8, 0.8, 0.8)
inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE)
inst.soundsname = "yuno"

else
inst.AnimState:SetBuild("goddessform")
    inst.SoundEmitter:PlaySound("dontstarve/sanity/creature2/taunt")
    local x, y, z = inst.Transform:GetWorldPosition()
    local fx = SpawnPrefab("lightning")
    fx.Transform:SetPosition(x, y, z)
    SpawnPrefab("statue_transition_2").Transform:SetPosition(inst:GetPosition():Get())
inst.components.locomotor.walkspeed = 7
inst.components.locomotor.runspeed = 9.5
inst.components.health.absorb = 0.80
inst.components.combat.damagemultiplier = 3.5
inst.Transform:SetScale(1, 1, 1)
inst.components.hunger:SetRate(1)
inst.soundsname = "goddess"

inst.components.talker:Say("I have business to attend to.", 2.5,true) 


end
 
inst.transformed = not inst.transformed

inst.components.sanity:DoDelta(-20)
return true
 
end

AddModRPCHandler("yuno", "GODDESS", YunoFn)

--Max sanity Penalty
local function sanityPostInit(self)
    local OldRecalculatePenalty = self.RecalculatePenalty
    local function RecalculatePenalty(self, forceupdatewidget)
        local mult = GLOBAL.TUNING.REVIVE_sanity_PENALTY_AS_MULTIPLE_OF_EFFIGY
        mult = mult * GLOBAL.TUNING.EFFIGY_sanity_PENALTY
        local maxrevives = (self.maxsanity - 40)/mult
        if self.numrevives > maxrevives then
            self.numrevives = maxrevives
        end
        OldRecalculatePenalty(self, forceupdatewidget)
    end
    self.RecalculatePenalty = RecalculatePenalty
end

AddComponentPostInit('sanity', SanityPostInit) 

-- Custom items
GLOBAL.STRINGS.NAMES.YUNOKNIFE = "Yuno's knife" 
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.YUNOKNIFE = "A dangerous weapon of a yandere!"


-- Custom Items dolls
STRINGS.RECIPE_DESC.YUKKIDOLL = "A doll of Yukki!" 

GLOBAL.STRINGS.NAMES.YUKKIDOLL = "Yukki Doll"

GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.YUKKIDOLL = "A cute snuggly Yukki!"

AddMinimapAtlas("images/inventoryimages/yunoknife.xml")
AddMinimapAtlas("images/inventoryimages/yukkidoll.xml")

--Yuno Tab

Yunostab = AddRecipeTab("Yuno", 998, "images/hud/yunotab.xml", "yunotab.tex", "yunobuilder")

-Yuno Recipes

local yukkidoll_recipe = AddRecipe("yukkidoll",
{GLOBAL.Ingredient("beefalowool", 4), GLOBAL.Ingredient("silk", 2)},
yunostab, TECH.NONE,
nil, nil, nil, nil, nil,
"images/inventoryimages/yukkidoll.xml", "yukkidoll.tex")
yukkidoll_recipe.tagneeded = false
yukkidoll_recipe.builder_tag = "yunobuilder"

-- The character select screen lines
STRINGS.CHARACTER_TITLES.YunoGasai = "The Yandere"
STRINGS.CHARACTER_NAMES.YunoGasai = "Gasai Yuno"
STRINGS.CHARACTER_DESCRIPTIONS.YunoGasai = "*Is insane(ly in love)\Is stronger when sanity is low\Comes with her own weapon"
STRINGS.CHARACTER_QUOTES.YunoGasai = "\"I'M CRAZY!? WHAT'S CRAZY IS THIS WORLD, THAT REFUSES TO LET ME BE WITH YOU!!!\""

-- Custom speech strings
STRINGS.CHARACTERS.Yuno = require "speech_yuno"

-- The character's name as appears in-game 
STRINGS.NAMES.YunoGasai = "Yuno"

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

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

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

 

I do have '=' on that line 

Edited by Kasu

I believe you have...


-Yuno Recipes

An attempt to substract Yuno with floating Recipes instead of actually having a comment line :p

On line 139.

Do you not use an advanced editor to highlight code for you? I recommend you try Atom, just need to install LUA language package to it, and you won't experience such issues.

6 hours ago, IvanX said:

local var1 <-- var 1 is declared but no initial value is given.

Thus an error, expected '=' found another 'local' local var2 = ...

Doing

local a
local b = 1

if b == 1 then
	a = 2
end

print(a)
print(b)

is valid.

You can declare locals and define them later. The value for the "undefined" variable is not undefined, it's nil.

Useful to extend the scope of the variable and not make it a global, and instead of passing it as a parameter everywhere.

Also refer to the definition of local function: https://www.lua.org/pil/6.2.html

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...