×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Bugs
  • /
  • Module API & Minigame Bugs
« ‹ 16 / 16
Module API & Minigame Bugs
Kilamanjaroo
« Censeur »
1593537300000
    • Kilamanjaroo#0000
    • Profil
    • Derniers messages
    • Tribu
#301
  0
Minigame: #parkour
Room: any
What happened: all my stats were reset to 0, played two maps, got 2 points; I received the stats room to run a command and recover them, but they were lost
Expectation: stats on #parkour recovered
Yolanananana
« Citoyen »
1594313280000
    • Yolanananana#0000
    • Profil
    • Derniers messages
    • Tribu
#302
  0
Minigame: #prophunt
Room: any
What happened: The game itself suddenly cuts out at a random moment and changes to vanilla mode room
Expectation: the vanilla mode doesn't appear
Miss_valentina
« Censeur »
1595759100000
    • Miss_valentina#5950
    • Profil
    • Derniers messages
    • Tribu
#303
  0
Miss_valentina a dit :
Minigame : #prophunt
Theres a bug when everybody gets cheese

it keeps happening..
Bhvana
« Censeur »
1595772120000
    • Bhvana#0543
    • Profil
    • Derniers messages
    • Tribu
#304
  0
Yolanananana a dit :
Minigame: #prophunt
Room: any
What happened: The game itself suddenly cuts out at a random moment and changes to vanilla mode room
Expectation: the vanilla mode doesn't appear

Also happens in #parkour
Extremq
« Citoyen »
1595785680000
    • Extremq#0000
    • Profil
    • Derniers messages
    • Tribu
#305
  0
When the module suddenly switches to normal Transformice gameplay it means the module crashed. Sometimes it's Transformice's fault, sometimes the creator's. Don't expect 100% uptime. D:
Pagoda
« Citoyen »
1676504460000
    • Pagoda#4165
    • Profil
    • Derniers messages
    • Tribu
#306
  0
I am trying to parse a string in the Lua console:

1
2
3
4
5
xml_map = "....."

object = xml_map:gmatch("<O>.+?<\/O>")

print(object)

But the output is always a random hex code instead of the parsed string:
1
2
3
4
5
function: 38c2f3bd
function: 50535bd3
function: 6c77460e
function: 5b14b21d
etc..

I believe that Lua is printing the ID of the function rather than actually running it and returning the value!
Deletedaccount
« Citoyen »
1676743860000
    • Deletedaccount#6153
    • Profil
    • Derniers messages
    • Tribu
#307
  1
Pagoda a dit :
I am trying to parse a string in the Lua console:

1
2
3
4
5
xml_map = "....."

object = xml_map:gmatch("<O>.+?<\/O>")

print(object)

But the output is always a random hex code instead of the parsed string:
1
2
3
4
5
function: 38c2f3bd
function: 50535bd3
function: 6c77460e
function: 5b14b21d
etc..

I believe that Lua is printing the ID of the function rather than actually running it and returning the value!

string.gmatch returns an iterator function, which means you have to use it in a for loop to retrieve values.

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local xml_map = "..."

local objects = {}
local counter = 0
local obj

for object in xml_map:gmatch("<O>(.-)</O>") do
obj = {id = counter}

-- Parse all tags from object
for key, value in object:gmatch('(%w+)="(.-)"') do
obj[key] = value
end

counter = counter + 1
objects[counter] = obj
end
Pagoda
« Citoyen »
1677015540000
    • Pagoda#4165
    • Profil
    • Derniers messages
    • Tribu
#308
  0
Indexinel a dit :
Pagoda a dit :
I am trying to parse a string in the Lua console:

1
2
3
4
5
xml_map = "....."

object = xml_map:gmatch("<O>.+?<\/O>")

print(object)

But the output is always a random hex code instead of the parsed string:
1
2
3
4
5
function: 38c2f3bd
function: 50535bd3
function: 6c77460e
function: 5b14b21d
etc..

I believe that Lua is printing the ID of the function rather than actually running it and returning the value!

string.gmatch returns an iterator function, which means you have to use it in a for loop to retrieve values.

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local xml_map = "..."

local objects = {}
local counter = 0
local obj

for object in xml_map:gmatch("<O>(.-)</O>") do
obj = {id = counter}

-- Parse all tags from object
for key, value in object:gmatch('(%w+)="(.-)"') do
obj[key] = value
end

counter = counter + 1
objects[counter] = obj
end

I actually realised my mistake already but thanks for letting me know
Pagoda
« Citoyen »
1677067560000
    • Pagoda#4165
    • Profil
    • Derniers messages
    • Tribu
#309
  0
Hey Indexinel, I have a question.

I have a function I created which runs perfectly fine on any other Lua interpreter, so why am I still getting problems on Transformice?

1
2
3
4
5
6
7
8
9
10
11
xml = ""

function eventNewGame()
xml = tfm.get.room.xmlMapInfo.xml

for object in xml:gmatch("<O(.-)%/>") do
print(object)
end
end

tfm.exec.newGame("@7927593", true)

Sometimes it gives me the output I'm looking for, and sometimes it doesn't. For example, in the following console log it gives me the properties for 3 objects, while there are 4 objects on the map:

1
2
3
• [11:59] #   C="6" Y="274" P="0" X="532" 
• [11:59] # C="6" Y="287" P="0" X="434"
• [11:59] # C="6" Y="188" P="0" X="438"

Furthermore, most of the time, it will not give me properties for any objects at all.

I tried running it with system.newTimer(), in case the XML isn't reading quickly enough, but it was still giving me inconsistent output. There is no other reason I can think of.
Pagoda
« Citoyen »
1677082740000
    • Pagoda#4165
    • Profil
    • Derniers messages
    • Tribu
#310
  1
Hey, it doesn't matter. I realised it was just a bug in the console log and not a problem with the Lua interpreter. So, my code works fine! Nice
Physics
« Censeur »
1722445560000
    • Physics#3066
    • Profil
    • Derniers messages
    • Tribu
#311
  0
minigame: mycity

Room: its happened in every room
What Happened:
1- When I go to the mine downstairs, I can't find the way to the yacht or the yogati, which is considered a secret route.
2- The road to the mine doesn't change like a maze a long time ago.
3- The seller of goods no longer renews his goods like in the past

Expectation : The developers of the model are no longer interested in updating things in it like in the past
Expectation:
  • Forums
  • /
  • Transformice
  • /
  • Bugs
  • /
  • Module API & Minigame Bugs
« ‹ 16 / 16
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27