×

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
  • /
  • Modules
  • /
  • [Module API] Errors
« ‹ 15 / 17 › »
[Module API] Errors
Evilsantah
« Citoyen »
1445298060000
    • Evilsantah#0000
    • Profil
    • Derniers messages
#281
  0
Fofonams a dit :
Some scripts which used to work aren't working anymore.
I have no idea why.

Should be fixed tomorrow. Pikashu is on it
Gekkeiju
« Citoyen »
1445996100000
    • Gekkeiju#0000
    • Profil
    • Derniers messages
    • Tribu
#282
  0
tfm.exec.setNameColor : argument 2 can't be NIL.

I got this. And the players name color wasn't reset.

setNameColor a dit :
Arguments:
playerName (string) - The username of the player whose name color will be changed.
color (integer) - The color of the text area, as a hexadecimal number. If this argument is nil, their name color will be reset.
Safwanrockz
« Censeur »
1448477040000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#283
  0
Could you post the code you're working on?
Gekkeiju
« Citoyen »
1449992100000
    • Gekkeiju#0000
    • Profil
    • Derniers messages
    • Tribu
#284
  0
Safwanrockz a dit :
Could you post the code you're working on?

I thought setNameColor("Name", nil) resets a player's name color because shamousey wrote so in Module FAQ & Documentation. but maybe it's not nil but 0.

API ERROR:
tfm.exec.addPhysicObject cannot add a water ground. When we call addPhysicObject(id, x, y, {type=9}), a ground which looks water but has collision with mice appears.
Shamousey
« Consul »
1450013460000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#285
  0
gekkeiju a dit :
I thought setNameColor("Name", nil) resets a player's name color because shamousey wrote so in Module FAQ & Documentation. but maybe it's not nil but 0.

Yeah, that was my mistake, sorry ^^" I'd fixed it in the documentation since then.
Candrai
« Citoyen »
1451015280000
    • Candrai#0000
    • Profil
    • Derniers messages
    • Tribu
#286
  0
a dit :
Runtime Error : org.luaj.vm2.LuaError: Candrai.lua:1700: attempt to index ? (a nil value)

what wrong? i'm write this code:

if tfm.get.room.xmlMapInfo.author ~= nil then
map.author = tfm.get.room.xmlMapInfo.author
else
map.author = 'No map author available :('
end

Dernière modification le 1451015760000
Abdeltif
« Citoyen »
1451044200000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#287
  0
Candrai a dit :
a dit :
Runtime Error : org.luaj.vm2.LuaError: Candrai.lua:1700: attempt to index ? (a nil value)

what wrong? i'm write this code:

if tfm.get.room.xmlMapInfo.author ~= nil then
map.author = tfm.get.room.xmlMapInfo.author
else
map.author = 'No map author available :('
end

Which line is the 1700th ?
Esh
« Censeur »
1451050680000
    • Esh#0095
    • Profil
    • Derniers messages
    • Tribu
#288
  0
Candrai a dit :
a dit :
Runtime Error : org.luaj.vm2.LuaError: Candrai.lua:1700: attempt to index ? (a nil value)

what wrong? i'm write this code:

if tfm.get.room.xmlMapInfo.author ~= nil then
map.author = tfm.get.room.xmlMapInfo.author
else
map.author = 'No map author available :('
end

make sure the table map and tfm.get.room.xmlMapInfo exists
Abdeltif
« Citoyen »
1451156100000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#289
  0
Eshkation a dit :
Candrai a dit :
a dit :
Runtime Error : org.luaj.vm2.LuaError: Candrai.lua:1700: attempt to index ? (a nil value)

what wrong? i'm write this code:

if tfm.get.room.xmlMapInfo.author ~= nil then
map.author = tfm.get.room.xmlMapInfo.author
else
map.author = 'No map author available :('
end

make sure the table map and tfm.get.room.xmlMapInfo exists

and if that's not the problem, make sure that the table map exists
(that's why I asked which line)
Candrai
« Citoyen »
1451185860000
    • Candrai#0000
    • Profil
    • Derniers messages
    • Tribu
#290
  0
Abdeltif a dit :
Candrai a dit :
a dit :
Runtime Error : org.luaj.vm2.LuaError: Candrai.lua:1700: attempt to index ? (a nil value)

what wrong? i'm write this code:

if tfm.get.room.xmlMapInfo.author ~= nil then
map.author = tfm.get.room.xmlMapInfo.author
else
map.author = 'No map author available :('
end

Which line is the 1700th ?

http://i.imgur.com/qc3LZju.png
Bushmeister
« Consul »
1451211960000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#291
  0
Candrai a dit :
Abdeltif a dit :
Candrai a dit :
a dit :
Runtime Error : org.luaj.vm2.LuaError: Candrai.lua:1700: attempt to index ? (a nil value)

what wrong? i'm write this code:

if tfm.get.room.xmlMapInfo.author ~= nil then
map.author = tfm.get.room.xmlMapInfo.author
else
map.author = 'No map author available :('
end

Which line is the 1700th ?

http://i.imgur.com/qc3LZju.png

tfm.get.room.xmlMapInfo is available from next round after you load a script.
For example, this code will not work
a dit :

if tfm.get.room.xmlMapInfo.author~=nil then
print(tfm.get.room.xmlMapInfo.author)
end

But this will work fine after new round
a dit :

function eventNewGame()
if tfm.get.room.xmlMapInfo.author~=nil then
print(tfm.get.room.xmlMapInfo.author)
end
end

/np @1125782

You have to check tfm.get.room.xmlMapInfo instead of tfm.get.room.xmlMapInfo.author, because it will cause an error when you try to get(the state of) an element from nil table.
Candrai
« Citoyen »
1451226840000
    • Candrai#0000
    • Profil
    • Derniers messages
    • Tribu
#292
  0
Bushmeister a dit :
Candrai a dit :
Abdeltif a dit :
Candrai a dit :
a dit :
Runtime Error : org.luaj.vm2.LuaError: Candrai.lua:1700: attempt to index ? (a nil value)

what wrong? i'm write this code:

if tfm.get.room.xmlMapInfo.author ~= nil then
map.author = tfm.get.room.xmlMapInfo.author
else
map.author = 'No map author available :('
end

Which line is the 1700th ?

http://i.imgur.com/qc3LZju.png

tfm.get.room.xmlMapInfo is available from next round after you load a script.
For example, this code will not work
a dit :

if tfm.get.room.xmlMapInfo.author~=nil then
print(tfm.get.room.xmlMapInfo.author)
end

But this will work fine after new round
a dit :

function eventNewGame()
if tfm.get.room.xmlMapInfo.author~=nil then
print(tfm.get.room.xmlMapInfo.author)
end
end

/np @1125782

You have to check tfm.get.room.xmlMapInfo instead of tfm.get.room.xmlMapInfo.author, because it will cause an error when you try to get(the state of) an element from nil table.

thanks :D
it worked.
Tat
« Censeur »
1451523960000
    • Tat#0095
    • Profil
    • Derniers messages
    • Tribu
#293
  0
a dit :
function eventChatCommand(name,command)
if command:sub(0,4)=="help" then
print("help")
end
end

when i type !help in the chat, this error comes out:
Runtime Error : org.luaj.vm2.LuaError: Mousetat.lua:2: LUA on room [*Natal] unloaded. Reason : Asked by user

Can someone help or is this a bug?

Edit: Oh its fixed nvm

Dernière modification le 1451609580000
Philarry
« Citoyen »
1451779920000
    • Philarry#0000
    • Profil
    • Derniers messages
    • Tribu
#294
  0
a dit :
textareatext = "<font size='14'>["..time.."] Welcome</font>"
time = os.date()
ui.addTextArea(10000,textareatext,nil,0,25,800,200,0x000000,0xFFFFFF,0.3,true)
function eventPlayerDied(name)
ui.updateTextArea(10000,""..textareatext.."\n"<font size='14'>["..time.."] "..name.." just died</font>"",nil)
end

Init Error : [string "Philarry.lua"]:5: ')' expected
Shamousey
« Consul »
1451781600000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#295
  0
On line 5 where you're having this issue, you're doing some odd things with the strings.

http://i.imgur.com/MjDNOd9.png

1. You're ending the string pre-emptively, the HTML <font> tag afterwards also needs to be encapsulated in a string.
2. You're ending the string but the second quote is starting a new one unnecessarily.

Additionally in the snippet you've given, you're trying to use the time variable before you're setting it.

a dit :
time = os.date()
textareatext = "<font size='14'>["..time.."] Welcome</font>"
ui.addTextArea(10000,textareatext,nil,0,25,800,200,0x000000,0xFFFFFF,0.3,true)
function eventPlayerDied(name)
ui.updateTextArea(10000,""..textareatext.."\n<font size='14'>["..time.."] "..name.." just died</font>",nil)
end
Philarry
« Citoyen »
1451846580000
    • Philarry#0000
    • Profil
    • Derniers messages
    • Tribu
#296
  0
Shamousey a dit :
On line 5 where you're having this issue, you're doing some odd things with the strings.

http://i.imgur.com/MjDNOd9.png

1. You're ending the string pre-emptively, the HTML &lt;font&gt; tag afterwards also needs to be encapsulated in a string.
2. You're ending the string but the second quote is starting a new one unnecessarily.

Additionally in the snippet you've given, you're trying to use the time variable before you're setting it.

a dit :
time = os.date()
textareatext = "&lt;font size='14'&gt;["..time.."] Welcome&lt;/font&gt;"
ui.addTextArea(10000,textareatext,nil,0,25,800,200,0x000000,0xFFFFFF,0.3,true)
function eventPlayerDied(name)
ui.updateTextArea(10000,""..textareatext.."\n&lt;font size='14'&gt;["..time.."] "..name.." just died&lt;/font&gt;",nil)
end


thanks it works now
Chaebyl
« Citoyen »
1451935440000
    • Chaebyl#0000
    • Profil
    • Derniers messages
#297
  0
Code a dit :
function eventChatCommand(name,msg)
if name=="Chaebyl" and msg=="kill" then
ui.addPopup(1,2,"Who do you want to kill?",name,300,100,200)
end
end

function eventPopupAnswer(popup1,name,answer)
tfm.exec.killPLayer(answer)
end

In the line of "tfm.exec.killPlayer(answer)" it gives me an "attempt to call nil" error.

I wanted a pop up to appear (that works fine) that would ask me who do I want to kill, so when I type a name (any name) it would kill that person.

Thanks!
Gekkeiju
« Citoyen »
1451964360000
    • Gekkeiju#0000
    • Profil
    • Derniers messages
    • Tribu
#298
  0
exec.killPLayer -> exec.killPlayer
?

Dernière modification le 1451964420000
Dianawass
« Citoyen »
1451968800000
    • Dianawass#0000
    • Profil
    • Derniers messages
    • Tribu
#299
  0
gekkeiju a dit :
exec.killPLayer -&gt; exec.killPlayer
?

I can't believe it. I'm blind.
Thank you so much.
Smechg
1471907760000
    • Smechg#0000
    • Profil
    • Derniers messages
#300
[Modéré par Whiskypickle, raison : Por favor, não fale português no fórum inglês. Procure pela bandeira no canto superior direito, selecione a brasileira e vá para o fórum BR.]
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Module API] Errors
« ‹ 15 / 17 › »
© Atelier801 2018

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

Version 1.27