Forums » Themes » Making a theme from scratch

The CodeMessageCommand part should be in a BGAnimation-side lua script, e.g.

local t = Def.ActorFrame{

Def.Actor{
Name="CodeController";
CodeMessageCommand=%function(self, param)
Trace("CodeMessageCommand received.")
local codeName = param.Name -- code name, matches the one in metrics
local pn = param.PlayerNumber -- which player entered the code
end
};
};
Reply
Post valid and tested code if you're going to give an example.
"00:04.367: Dialog: "Lua runtime error: /Themes/consensual/BGAnimations/ScreenSelectMusic background.lua:5: unexpected symbol near '%'" [LUA_ERROR]"
< cybik> til Kyzentun fixes bugs for breakfast
--
< maxvg1> shakesoda: then why do i still play lol
<@shakesoda> because you're an ITG player. And thus, a masochist
--
<@shakesoda> Kyzentun: I think you might need to put down the meshes for a bit
Reply
The CodeMessageCommand part should be in a BGAnimation-side lua script, e.g.

local t = Def.ActorFrame {

Def.Actor {
Name="CodeController",
CodeMessageCommand=function(self, param)
Trace("CodeMessageCommand received.")
local codeName = param.Name -- code name, matches the one in metrics
local pn = param.PlayerNumber -- which player entered the code
end
},
-- [...]
}


you don't want the "%". edited AJ's code slightly to reflect that.

EDIT: whoa, quote and code do not play nice.

Last edited: 13 November 2013 6:15pm

Reply
It turns out that actor with its function has to be specifically in "ScreenSelectMusic overlay.lua" to do what I want. Putting it in "ScreenSelectMusic background.lua" doesn't work. I didn't try the other two layers the screen has.

Additionally, while tracking this down I added some LOG->Info calls, and found that the "Code" message is in fact broadcast to every actor, even though it didn't look like it was when I traced the code before. Oddly, even though I had the actor's name in the info messages, the name didn't show up for the actor that actually had CodeMessageCommand set.
< cybik> til Kyzentun fixes bugs for breakfast
--
< maxvg1> shakesoda: then why do i still play lol
<@shakesoda> because you're an ITG player. And thus, a masochist
--
<@shakesoda> Kyzentun: I think you might need to put down the meshes for a bit
Reply
(Love this thread/topic. A lot of useful information in it thusfar.) I have experimented with a theme from scratch and I learned a bit here and there. (Still have little idea of what I am doing but eh...) I am mainly waiting for better documentation. (Probably will be a while... However, I am willing to wait.) One thing I wanted to try was setting up my own screens but yeah... I may just be better off leaving it as is and basing it off fallback. (Which is probably a good/safe idea...) I'll check in this thread from time to time though. (subscribes to topic)

~ SpoOkyMagician
"You don't have to understand me; I'm just there!" ~ SpoOkyMagician
Reply
It turns out that actor with its function has to be specifically in "ScreenSelectMusic overlay.lua" to do what I want. Putting it in "ScreenSelectMusic background.lua" doesn't work. I didn't try the other two layers the screen has.
A bit late to the discussion, but I figured I'd throw in some additional info:

The code message is not actually broadcast using MESSAGEMAN, which would send the message to all subscribers. It is instead processed by the Screen, using the "HandleMessage" function, which passes the message down through to all children.

Background is not a child of the Screen, so background never sees that message when sent from the CodeDetector. Likewise, Overlay screens are not children of the screen, and will also not see the message.

Last edited: 9 January 2014 11:05am

Reply
Can anybody help me how to making a theme? I read the other posts in this topic and still dont understand.
Reply
Gotta be more specific than that on what's confusing you on theming

Work in Progress
Reply