×

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 FAQ & Documentation
« ‹ 3 / 19 › »
Module FAQ & Documentation
Itchyboy
« Citoyen »
1413066120000
    • Itchyboy#0000
    • Profil
    • Derniers messages
    • Tribu
#41
  0
thanks Saf. i realize what i was doing wrong now. I like the circle thing though
Drgenius
« Citoyen »
1414399500000
    • Drgenius#0000
    • Profil
    • Derniers messages
    • Tribu
#42
  0
Can someone please explain to me why I can't use the : shortcut in custom string child functions? For example:

string function a dit :
function string.test(foo,bar)
    print(foo==bar)
end
s='moo'
s:test('car')


This works fine in my local interpreter, and I'm not quite sure why it doesn't work here. :(
Operop
« Citoyen »
1414414740000
    • Operop#0000
    • Profil
    • Derniers messages
#43
  0
drgenius a dit :
Can someone please explain to me why I can't use the : shortcut in custom string child functions? For example:

string function a dit :
function string.test(foo,bar)
    print(foo==bar)
end
s='moo'
s:test('car')


This works fine in my local interpreter, and I'm not quite sure why it doesn't work here. :(

this is OOP
Drgenius
« Citoyen »
1414438020000
    • Drgenius#0000
    • Profil
    • Derniers messages
    • Tribu
#44
  0
operop a dit :
drgenius a dit :
Can someone please explain to me why I can't use the : shortcut in custom string child functions? For example:

string function a dit :
function string.test(foo,bar)
    print(foo==bar)
end
s='moo'
s:test('car')


This works fine in my local interpreter, and I'm not quite sure why it doesn't work here. :(

this is OOP

I'm quite confused. I do understand this is OOP, are you implying that the API is OOP and my Lua interpreter isn't?
Makinit
« Citoyen »
1414497900000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#45
  0
Drgenius a dit :
Can someone please explain to me why I can't use the : shortcut in custom string child functions? For example:

string function a dit :
function string.test(foo,bar)
    print(foo==bar)
end
s='moo'
s:test('car')


This works fine in my local interpreter, and I'm not quite sure why it doesn't work here. :(

This is probably a difference in the Lua implementation. The global string function table is seperate from the functions that are added to strings:
a dit :
function string:upper()
    return "overridden"
end
s = "test"
print(string.upper(s))
print(s:upper())
Drgenius
« Citoyen »
1414525620000
    • Drgenius#0000
    • Profil
    • Derniers messages
    • Tribu
#46
  0
makinit a dit :
Drgenius a dit :
Can someone please explain to me why I can't use the : shortcut in custom string child functions? For example:

string function a dit :
function string.test(foo,bar)
    print(foo==bar)
end
s='moo'
s:test('car')


This works fine in my local interpreter, and I'm not quite sure why it doesn't work here. :(

This is probably a difference in the Lua implementation. The global string function table is seperate from the functions that are added to strings:
a dit :
function string:upper()
    return "overridden"
end
s = "test"
print(string.upper(s))
print(s:upper())


Aha, that makes sense. Thank you!
Itchyboy
« Citoyen »
1416274740000
    • Itchyboy#0000
    • Profil
    • Derniers messages
    • Tribu
#47
  0
I tried playing an XML with a chat command, the XML was <C><P L="2400" H="800" /><Z><S><S H="10" P="0,0,0.3,0.2,0,0,0,0" L="2400" o="0" X="1200" Y="805" T="12" /></S><D /><O /></Z></C>. It said, "Argument must be integer." It was my understanding though that you can load XML's with tfm.exec.newGame(). Is there a way I can fix this?
Shamousey
« Consul »
1416274980000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#48
  0
itchyboy a dit :
I tried playing an XML with a chat command, the XML was &lt;C&gt;&lt;P L="2400" H="800" /&gt;&lt;Z&gt;&lt;S&gt;&lt;S H="10" P="0,0,0.3,0.2,0,0,0,0" L="2400" o="0" X="1200" Y="805" T="12" /&gt;&lt;/S&gt;&lt;D /&gt;&lt;O /&gt;&lt;/Z&gt;&lt;/C&gt;. It said, "Argument must be integer." It was my understanding though that you can load XML's with tfm.exec.newGame(). Is there a way I can fix this?

You can load XMLs with tfm.exec.newGame(), and the XML you've posted here works just fine. The issue would've been elsewhere in your code, you can post in the errors thread with your full code for someone else to look into it for you.
Panadesoim
« Citoyen »
1417331880000
    • Panadesoim#0000
    • Profil
    • Derniers messages
#49
  0
Tanks!
Skittleeeeee
« Citoyen »
1417543860000
    • Skittleeeeee#0000
    • Profil
    • Derniers messages
    • Tribu
#50
  0
Like when I use scripts in lua at my tribehouse, it doesn't say error, they just never work! I never learned how to use it. I am VERY confused. Help me please?
Makinit
« Citoyen »
1417558560000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#51
  0
skittleeeeee a dit :
Like when I use scripts in lua at my tribehouse, it doesn't say error, they just never work! I never learned how to use it. I am VERY confused. Help me please?

You probably don't meet all of these requirements:
shamousey a dit :
be in your tribe house, have the appropriate permissions to use the "/np" command, have over 1,000 cheese, and never be banned for hacking
Itchyboy
« Citoyen »
1419659100000
    • Itchyboy#0000
    • Profil
    • Derniers messages
    • Tribu
#52
  0
OMG OMG OMG I JUST FOUND BRAND NEW SHAMAN OBJECTS
80- A MOUSE IN A BUBBLE OMG (appears at 0,0 though)
85- Normal cannons (Weird, there must be something up with them.)
91- Snowman (at 0,0)
That's all I could find. I found it while I was making my new minigame. (Shhh, don't tell anyone I was making a new minigame)
It was a complete accident. I. Freaked. Out.
These new ones must be from the new skill tree they're making. I'm still stunned I found them. Have fun with them.
EDIT: The cannons I said were normal, are NOT normal. They don't roll, they always point in the same direction.

Dernière modification le 1419663540000
Bushmeister
« Consul »
1423733880000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#53
  0
How often can I call system.savePlayerData(pName), system.loadPlayerData(pName) and system.saveFile(data, fileNumber), system.loadFile(fileNumber)?

What max. size can I save in system.savePlayerData(pName)? If I will save data[playerName].cheese=200 it will be 27 characters or 3(only value)?
Safwanrockz
« Censeur »
1423760700000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#54
  0
Bushmeister a dit :
How often can I call system.savePlayerData(pName), system.loadPlayerData(pName) and system.saveFile(data, fileNumber), system.loadFile(fileNumber)?

You can call system.savePlayerData() and system.loadPlayerData() as often as you want. However, you can only call system.loadFile() and system.saveFile() once per 10 minutes.

Bushmeister a dit :
What max. size can I save in system.savePlayerData(pName)? If I will save data[playerName].cheese=200 it will be 27 characters or 3(only value)?

system.savePlayerData(String pName, String data) saves data of type string to the player pName (2k characters max), saving data[playerName].cheese=200 as a string (as in, system.savePlayerData(name, "data[playerName].cheese=200")) will make it 27 characters, while saving data[playerName].cheese=200 as the value of the variable cheese inside data[playerName] table (as in, system.savePlayerData(playerName, data[playerName].cheese) whereas data[playerName].cheese is 200) will make it 3 characters. Note that these functions can only be used for Module team members.

Dernière modification le 1423765320000
Shamousey
« Consul »
1423760760000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#55
  0
savePlayerData and loadPlayerData have no limits but can save a maximum of 2,000 characters per player.

saveFile and loadFile can only be used once every 10 minutes, as explained in the documentation in this thread.

Saving "200" will use 3 characters. Saving "2705452" will use 7 characters. Saving "stinky poodles" will use 14 characters, for example.

Edit: Safwaninja

Dernière modification le 1423760940000
Bushmeister
« Consul »
1423768380000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#56
  0
Omg. Now I know all about system.saveblablabla. Thx Shamousey and Safwanrockz ;)
Bushmeister
1423924200000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#57
[Modéré par Sabusha]

Dernière modification le 1424203860000
Shamousey
« Consul »
1426106160000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#58
  0
The server-side Lua got updated from 5.1 to 5.2 today!
Safwanrockz
« Censeur »
1426283820000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#59
  0
Yep, some changes include using the first argument of os.time(), also the function returns time in seconds rather than milliseconds now.
Micesoareci
« Citoyen »
1426306740000
    • Micesoareci#0000
    • Profil
    • Derniers messages
    • Tribu
#60
  0
Which is the command for ffa beach balls?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Module FAQ & Documentation
« ‹ 3 / 19 › »
© Atelier801 2018

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

Version 1.27