Recommended Posts

igrokartkam    0

[string "../mods/workshop-2239615658/modmain.lia"]:57: unexpected symbol near `=`

I wanted to make a mod that would reduce the % of marble armor protection and increase the speed.

57. GLOBAL.TUNING.ARMORMARBLE_ABSORPTION = .75*multiplayer_armor_absorption_modifier,
58. GLOBAL.TUNING.ARMORMARBLE_SLOW = 1.4,

if anyone knows what the problem is, please let me know.

Share this post


Link to post
Share on other sites
Yakuzashi    136

Try "0.75" instead ."75". It seems like a solution according to this notification:

Quote

[string "../mods/workshop-2239615658/modmain.lia"]:57: unexpected symbol near `=`


 

Share this post


Link to post
Share on other sites
igrokartkam    0

did not help. Here is the whole modmain

PrefabFiles = {
"smoke_grenade",
"newturfs",
}

local _G = GLOBAL
local require = GLOBAL.require
local GROUND = _G.GROUND
local SpawnPrefab = GLOBAL.SpawnPrefab
local TUNING = _G.TUNING
local STRINGS = _G.STRINGS
local RECIPETABS = _G.RECIPETABS
local Ingredient = _G.Ingredient
local TECH = _G.TECH
local CUSTOM_RECIPETABS = _G.CUSTOM_RECIPETABS

Assets = {
Asset("ANIM", "anim/flint.zip"),

Asset( "IMAGE", "levels/textures/noise_forgeash.tex" ),
Asset( "IMAGE", "levels/textures/mini_noise_forgeash.tex" ),
Asset( "IMAGE", "levels/tiles/forgeash.tex" ),
Asset( "FILE", "levels/tiles/forgeash.xml" ),
    
Asset( "IMAGE", "levels/textures/noise_lavafloor.tex" ),
Asset( "IMAGE", "levels/textures/mini_noise_lavafloor.tex" ),
Asset( "IMAGE", "levels/tiles/lavafloor.tex" ),
Asset( "FILE", "levels/tiles/lavafloor.xml" ),
    
Asset( "IMAGE", "levels/textures/noise_metal.tex" ),
Asset( "IMAGE", "levels/textures/mini_noise_metal.tex" ),
Asset( "IMAGE", "levels/tiles/metal.tex" ),
Asset( "FILE", "levels/tiles/metal.xml" ),
}

AddComponentPostInit("health", function(self)
self.maxhealth = 150
self.currenthealth = 150
function self:SetMaxHealth(amount)
return
end
end)

GLOBAL.TUNING.WX78_MAX_HEALTH = 150
GLOBAL.TUNING.WX78_MIN_HEALTH = 150

GLOBAL.TUNING.ARMORMARBLE = wilson_health*7*multiplayer_armor_durability_modifier,
GLOBAL.TUNING.ARMORMARBLE_ABSORPTION = 75*multiplayer_armor_absorption_modifier,
GLOBAL.TUNING.ARMORMARBLE_SLOW = 0.7,

GLOBAL.STRINGS.NAMES.SMOKE_GRENATE = "Smoke grenate"
GLOBAL.STRINGS.RECIPE_DESC.SMOKE_GRENATE = "secret."
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SMOKE_GRENATE = "secret."

local MOD_GROUND_TURFS = {
[GROUND.FORGEASH] = "turf_forgeash",
[GROUND.LAVAFLOOR] = "turf_lavafloor",
[GROUND.METAL] = "turf_metal",
}

local Terraformer = require("components/terraformer")
local OldTerraform = Terraformer.Terraform or function() return false end

local function SpawnTurf(turf, pt)
if turf ~= nil then
local loot = SpawnPrefab(turf)

if loot.components.inventoryitem ~= nil then
loot.components.inventoryitem:InheritMoisture(GLOBAL.TheWorld.state.wetness, GLOBAL.TheWorld.state.iswet)
end

loot.Transform:SetPosition(pt:Get())

if loot.Physics ~= nil then
local angle = math.random() * 2 * GLOBAL.PI
loot.Physics:SetVel(2 * math.cos(angle), 10, 2 * math.sin(angle))
end
end
end

function Terraformer:Terraform(pt, spawnturf)
local Map = GLOBAL.TheWorld.Map

if not Map:CanTerraformAtPoint(pt:Get()) then
return false
end

local original_tile_type = Map:GetTileAtPoint(pt:Get())

if OldTerraform(self, pt, spawnturf) then
local turfPrefab = MOD_GROUND_TURFS[original_tile_type]

if spawnturf and turfPrefab ~= nil then
SpawnTurf(turfPrefab, pt)
end

return true
end

return false
end

local DST = GLOBAL.TheSim:GetGameID() == "DST"
local resolvefilepath = GLOBAL.resolvefilepath

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