Attempt to call a table value

import { Manim } from "@rbxts/manim";
import { BaseScene } from "../../scene";

@Manim.Decorators.Scene({
name: "ColorSpace",
enabled: true,
deleteOnFinish: false,
})
export class ColorSpace extends BaseScene {
public construct(): void {
print("Hello from ColorSpace");
}
}
import { Manim } from "@rbxts/manim";
import { BaseScene } from "../../scene";

@Manim.Decorators.Scene({
name: "ColorSpace",
enabled: true,
deleteOnFinish: false,
})
export class ColorSpace extends BaseScene {
public construct(): void {
print("Hello from ColorSpace");
}
}
This is my TS file
27 Replies
longuint
longuintOP2mo ago

12:06:19.187 ServerScriptService.TS.scenes.color-space:25: attempt to call a table value - Server - color-space:25
12:06:19.187 Stack Begin - Studio
12:06:19.187 Script 'ServerScriptService.TS.scenes.color-space', Line 25 - Studio - color-space:25
12:06:19.187 Stack End - Studio

12:06:19.187 ServerScriptService.TS.scenes.color-space:25: attempt to call a table value - Server - color-space:25
12:06:19.187 Stack Begin - Studio
12:06:19.187 Script 'ServerScriptService.TS.scenes.color-space', Line 25 - Studio - color-space:25
12:06:19.187 Stack End - Studio
This is the output in studio And this is the emitted luau
-- Compiled with roblox-ts v3.0.0
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Manim = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src").Manim
local BaseScene = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src", "scene").BaseScene
local ColorSpace
do
local super = BaseScene
ColorSpace = setmetatable({}, {
__tostring = function()
return "ColorSpace"
end,
__index = super,
})
ColorSpace.__index = ColorSpace
function ColorSpace.new(...)
local self = setmetatable({}, ColorSpace)
return self:constructor(...) or self
end
function ColorSpace:constructor(...)
super.constructor(self, ...)
end
function ColorSpace:construct()
print("Hello from ColorSpace")
end
ColorSpace = Manim.Decorators.Scene({
name = "ColorSpace",
enabled = true,
deleteOnFinish = false,
})(ColorSpace) or ColorSpace
end
return {
ColorSpace = ColorSpace,
}
-- Compiled with roblox-ts v3.0.0
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Manim = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src").Manim
local BaseScene = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src", "scene").BaseScene
local ColorSpace
do
local super = BaseScene
ColorSpace = setmetatable({}, {
__tostring = function()
return "ColorSpace"
end,
__index = super,
})
ColorSpace.__index = ColorSpace
function ColorSpace.new(...)
local self = setmetatable({}, ColorSpace)
return self:constructor(...) or self
end
function ColorSpace:constructor(...)
super.constructor(self, ...)
end
function ColorSpace:construct()
print("Hello from ColorSpace")
end
ColorSpace = Manim.Decorators.Scene({
name = "ColorSpace",
enabled = true,
deleteOnFinish = false,
})(ColorSpace) or ColorSpace
end
return {
ColorSpace = ColorSpace,
}
Tester
Tester2mo ago
can you delete out folder and recompile? sometimes happens
longuint
longuintOP2mo ago
Yeah I have
Tester
Tester2mo ago
and still?
Tesmi
Tesmi2mo ago
Manim.Decrators.Scene 'show it
Tester
Tester2mo ago
or is there a specific error?
longuint
longuintOP2mo ago
import { Modding } from "@flamework/core";
import { BaseSceneAttributes } from "../scene";
import { addScene } from "../registry";

export const Scene = Modding.createDecorator<[BaseSceneAttributes]>("Class", (descriptor, config) => {
addScene(config[0]?.name, config[0]);
});
import { Modding } from "@flamework/core";
import { BaseSceneAttributes } from "../scene";
import { addScene } from "../registry";

export const Scene = Modding.createDecorator<[BaseSceneAttributes]>("Class", (descriptor, config) => {
addScene(config[0]?.name, config[0]);
});
Tester
Tester2mo ago
what line errors?
longuint
longuintOP2mo ago
Line 25 it says
Tester
Tester2mo ago
oh
longuint
longuintOP2mo ago
I'm trying to use flamework's decorators in my package
Tesmi
Tesmi2mo ago
Flamework transformer does not work for you, so you received such a message
Tester
Tester2mo ago
why? could you use normal decorators?
longuint
longuintOP2mo ago
I could probably do that. I just like the lifecycle systems in flamework
Tester
Tester2mo ago
function Decorator(parameters: {}){
return (ctor: object) => {
...
}
}

@Decorator({})
class Scene{}
function Decorator(parameters: {}){
return (ctor: object) => {
...
}
}

@Decorator({})
class Scene{}
do you really need to have a lifecycle?
longuint
longuintOP2mo ago
Yeah, probably not. I can just do the functionality through a registry.
Tester
Tester2mo ago
and just in case, how does the scene compile?
longuint
longuintOP2mo ago
the base scene file?
Tester
Tester2mo ago
.
longuint
longuintOP2mo ago
-- Compiled with roblox-ts v3.0.0
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Modding = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@flamework", "core", "out").Modding
local addScene = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src", "registry").addScene
local Scene = Modding.createDecorator("Class", function(descriptor, config)
local _result = config[1]
if _result ~= nil then
_result = _result.name
end
addScene(_result, config[1])
end)
return {
Scene = Scene,
}
-- Compiled with roblox-ts v3.0.0
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Modding = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@flamework", "core", "out").Modding
local addScene = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src", "registry").addScene
local Scene = Modding.createDecorator("Class", function(descriptor, config)
local _result = config[1]
if _result ~= nil then
_result = _result.name
end
addScene(_result, config[1])
end)
return {
Scene = Scene,
}
Tester
Tester2mo ago
would be nice if you could print the Scene but i would not suggest debugging flamework unless you really need to include it in lyfecycle
longuint
longuintOP2mo ago
Yeah I'm refactoring away from flamework right now, thanks for the help.
Tester
Tester2mo ago
yw
longuint
longuintOP2mo ago
Sorry for the ping but I'm confused how I should go about implementing this. I want it so that functions annotated with @SceneCode() in any class with the @Manim.Decorators.Scene() annotation are added to a registry where they can all be called.
import { Manim } from "@rbxts/manim";
import { BaseScene } from "../../scene";
import { SceneCode } from "../../decorators/scene-code";

@Manim.Decorators.Scene({
name: "ColorSpace",
enabled: true,
deleteOnFinish: false,
})
export class ColorSpace extends BaseScene {
@SceneCode({})
public construct(): void {
print("Hello from ColorSpace");
}
}
import { Manim } from "@rbxts/manim";
import { BaseScene } from "../../scene";
import { SceneCode } from "../../decorators/scene-code";

@Manim.Decorators.Scene({
name: "ColorSpace",
enabled: true,
deleteOnFinish: false,
})
export class ColorSpace extends BaseScene {
@SceneCode({})
public construct(): void {
print("Hello from ColorSpace");
}
}
--
import { MANIM_GLOBAL } from "../global";
import { ManimRegistry } from "../registry";

export interface SceneCodeConfig {}

export function SceneCode(config: SceneCodeConfig) {
// I don't know how to access the methods...
}
import { MANIM_GLOBAL } from "../global";
import { ManimRegistry } from "../registry";

export interface SceneCodeConfig {}

export function SceneCode(config: SceneCodeConfig) {
// I don't know how to access the methods...
}
Tester
Tester2mo ago
in the decorator factory should be
return (ctor: object, function_name: string) => {}
return (ctor: object, function_name: string) => {}
longuint
longuintOP2mo ago
So would it be:
export function SceneCode(config: SceneCodeConfig) {
return (ctor: object, name: string) => {
ManimRegistry.addSceneCode(name, ctor as () => void);
}
}
export function SceneCode(config: SceneCodeConfig) {
return (ctor: object, name: string) => {
ManimRegistry.addSceneCode(name, ctor as () => void);
}
}
?
Tester
Tester2mo ago
as new () => ObjectType or you could do as never

Did you find this page helpful?