I send a table with 10 keys… How can this be too much?? Can I change the buffer?
Can you share the code?
DEBUG:SCRIPT:
{ --[[0000000005960180]]
1 = { --[[0000000002EFDAD0]]
habilidad = 1,
oro = 2,
coste = 7,
habilidad_texto = “+1 alcance”,
tipo = “arma”,
habilidad_tipo = “Arma”,
nivel = 1,
danio = 2,
tipo_danio = “magico”,
img = “Arcane Orb Fire”
},
2 = { --[[0000000002EFD420]]
habilidad = 0,
oro = 0,
img = “pipo-enemy001”,
habilidad_texto = “Si esta equipado con un
arma,roba una carta extra
en el siguiente turno.”,
tipo = “heroe”,
nivel = 1,
habilidad_tipo = “Batalla”,
coste = 0,
equipado = false,
tipo_danio = “fisico”,
danio = 1
},
3 = { --[[0000000002EFD3A0]]
habilidad = 0,
oro = 0,
img = “pipo-enemy001”,
habilidad_texto = “Si esta equipado con un
arma,roba una carta extra
en el siguiente turno.”,
tipo = “heroe”,
nivel = 1,
habilidad_tipo = “Batalla”,
coste = 0,
equipado = false,
tipo_danio = “fisico”,
danio = 1
},
4 = { --[[0000000002EFD3F0]]
habilidad = 0,
oro = 0,
img = “pipo-enemy001”,
habilidad_texto = “Si esta equipado con un
arma,roba una carta extra
en el siguiente turno.”,
tipo = “heroe”,
nivel = 1,
habilidad_tipo = “Batalla”,
coste = 0,
equipado = false,
tipo_danio = “fisico”,
danio = 1
},
5 = { --[[0000000002EFE0E0]]
habilidad = 1,
oro = 2,
coste = 7,
habilidad_texto = “+1 alcance”,
tipo = “arma”,
habilidad_tipo = “Arma”,
nivel = 1,
danio = 2,
tipo_danio = “magico”,
img = “Arcane Orb Fire”
},
6 = { --[[0000000002EFDB00]]
habilidad = 1,
oro = 2,
coste = 7,
habilidad_texto = “+1 alcance”,
tipo = “arma”,
habilidad_tipo = “Arma”,
nivel = 1,
danio = 2,
tipo_danio = “magico”,
img = “Arcane Orb Fire”
},
7 = { --[[0000000002EFDB60]]
habilidad = 1,
oro = 2,
coste = 7,
habilidad_texto = “+1 alcance”,
tipo = “arma”,
habilidad_tipo = “Arma”,
nivel = 1,
danio = 2,
tipo_danio = “magico”,
img = “Arcane Orb Fire”
},
8 = { --[[0000000002EFDB30]]
habilidad = 1,
oro = 2,
coste = 7,
habilidad_texto = “+1 alcance”,
tipo = “arma”,
habilidad_tipo = “Arma”,
nivel = 1,
danio = 2,
tipo_danio = “magico”,
img = “Arcane Orb Fire”
},
9 = { --[[0000000002EFD710]]
oro = 0,
img = “pipo-enemy002”,
habilidad_texto = “Sube de nivel a
un heroe.”,
tipo = “heroe”,
nivel = 1,
habilidad_tipo = “Batalla”,
coste = 5,
equipado = false,
tipo_danio = “magico”,
danio = 1
}
}
ERROR:SCRIPT: /scripts/logica.script:104: buffer (87 bytes) too small for table, exceeded at ‘habilidad_texto’ for element #4
stack traceback:
But it’s not a code =)
What are you trying to do with this table? Do you want to send this table as a message in msg.post() or what?
a sorry, yes, I send it as message
msg.post(“gui#mazo-mano”, “cartas_mano”,mano)
need to use a module isnt it?
Yes, messages have a limit of 2KB. Your message looks to be just over 2KB.
Yes, you right.
Of course, it’s possible to make this buffer a few megs, but then you would have another issue with performance =)
The messages as communication mechanism should contain only the necessary information for identifying the action you want to do, but shouldn’t contain information as a data container.
as always a noob error.
Thanks
This is what I like about Defold. It tends to give you a slight slap on the wrist if you’re doing something stupid. And you know what? It’s happening to me less and less, so it’s working.
yeah, its true
Few examples of my messages (with comments) for better visualization what I mean:
-- Show loader. I send information about the next screen
-- and some settings for the transition.
msg.post(msgs.PATH_LOADER, msgs.C_SHOW, {id = msgs.SCREEN_MAP, skip_show = true})
-- I don't send a wallet table here. The wallet is a module
-- with user balance and other data. This event told to the TOP_BAR
-- that it should check the wallet because it was updated.
msg.post(msgs.PATH_MONEY_BAR, msgs.C_UPDATE_WALLET)
-- the game event: time's up (from the game logic submodule
-- to the main game logic manager)
msg.post(msgs.PATH_GAME_LOGIC, msgs.C_SHOW_NO_TIME)
-- update counter of hints with animation. Yes, it's possible
-- to take this value from the wallet in this case too, but wallet
-- saves data before all visualizations It's possible that I have more
-- than one events of hint counter increasing and I wanna show
-- them separately for the user with different animations.
msg.post(msgs.PATH_GAME_UI_LEFT_BAR, omsgs.HINT, {hints = wallet.hints, is_animate = true})
-- Show animation on gems in GUI
msg.post(self.money_top, msgs.C_ATTENSION_TO_GEM, {bounce = true})
-- the game event: restart the level (user tapped to the restart button,
-- and we send this event to the main game logic manager)
msg.post(msgs.PATH_GAME_LOGIC, msgs.C_RESTART_LEVEL)
-- Show the top bar when the start level popup was closed
msg.post(msgs.PATH_GAME_UI_TOP_BAR, monarch.TRANSITION.SHOW_IN)
And a part of msgs.lua
module:
local M ={}
...
-- pathes
M.PATH_LOADER = "loader:/_grass#grass"
M.PATH_MONEY_BAR = "ui#money_top_bar"
M.PATH_GAME_LOGIC = "game:/init_obj#entry_point"
M.PATH_SPINER = "loader:/_spiner#spiner"
M.PATH_GAME_UI_LEFT_BAR = "game:/ui#left_bar"
M.PATH_GAME_UI_TOP_BAR = "game:/ui#top_bar"
...
-- custom messages
M.C_RESTART_LEVEL = hash("C_RESTART_LEVEL")
M.C_SHOW = hash("c_show")
M.C_UPDATE_WALLET = hash("C_UPDATE_WALLET")
M.C_SHOW_NO_TIME = hash("C_SHOW_NO_TIME")
M.C_ATTENSION_TO_GEM = hash("C_ATTENSION_TO_GEM")
...
return M
I got message similar today, posting it so it’s more easily searchable (table was too big due to code error)
buffer (882 bytes) too small for table, exceeded at value (number) for element