×

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
« ‹ 13 / 19 › »
Module FAQ & Documentation
Fusionisreal
« Citoyen »
1514231580000
    • Fusionisreal#0000
    • Profil
    • Derniers messages
    • Tribu
#241
  0
What about creating a Google Forms, because you can still check it, and when the form is activated you can simply remove the Google Forms? Lots of people wanna join but they can not :/
Bolodefchoco
« Sénateur »
1514232000000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#242
  2
Yeah. I agree with your idea, actually, I've suggested this to the team a month ago, but no one answered yet.
Unfortunately we'll all need to wait :/
Syrius
« Consul »
1514387820000
    • Syrius#8114
    • Profil
    • Derniers messages
    • Tribu
#243
  1
New color tags:
<N2>
<PT>
<CE>
<CEP>
<CS>
<S>
<A:ACTIVE>
<PS>
Koruto
« Citoyen »
1515812640000
    • Koruto#2851
    • Profil
    • Derniers messages
    • Tribu
#244
  0
Can you tell me that is there a difference between normal lua and TFM lua. I mean if I learn lua can I make a module or do I need to learn anything else.
Bolodefchoco
« Sénateur »
1515812820000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#245
  1
Hemant2002 a dit :
Can you tell me that is there a difference between nirmal liya and TFM lua. I mean of I learn lua can I make a module or do I need to learn anything else.

TFM Lua is basically the Lua 5.1 with some Lua 5.2 functions (I recommend you to learn Lua 5.2)
Lua on TFM provides some other functions, like giving cheese for the mice or things like that. An API. It also has some limitations: no io lib, no debug.setmetatable(), no require, no load(), no C functions, etc...

Knowing lua is enough. After that you need to test the API functions and the events as TFM Lua looks like an event programming ^^'

Check the lua tree, so you can see the available functions
Koruto
« Citoyen »
1515820860000
    • Koruto#2851
    • Profil
    • Derniers messages
    • Tribu
#246
  0
Thank you but can you give me a link beside those given in forum I can't learn from them for lua. More easy and good understanding.
Sebafrancuz
« Consul »
1515842580000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#247
  1
Hemant2002 a dit :
Thank you but can you give me a link beside those given in forum I can't learn from them for lua. More easy and good understanding.

I think every link with tutorial would be hard for you, generally learning your first programming language is really hard. At the beginning you should look every Lua code and analize how it works. Then you should write as much scripts / codes as you can by using tutorial, which you'd learnt ( it's the easiest way to learn new language ).
Bolodefchoco
« Sénateur »
1515852960000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#248
  0
Hemant2002 a dit :
Thank you but can you give me a link beside those given in forum I can't learn from them for lua. More easy and good understanding.

In sum of Seba said, the 'easiest' manual I know is the official one. It is the best documentation I've ever seen.
https://www.lua.org/manual/5.2/manual.html.

You can start from basics.
Code Lua

1
2
3
4
5
6
7
function eventChatCommand(playerName, command) -- API + Lua
if command == "cheese" then -- Lua
tfm.exec.giveCheese(playerName) -- API
elseif command == "shaman" then -- Lua
tfm.exec.setShaman(playerName) -- API
end -- Lua
end -- Lua
Type !cheese or !shaman and check how it works. The eventChatCommand is always triggered when you type something that starts with !. So you have to make so " if then " conditions (normal in any programming language) to check if the command someone typed worth an execution
Koruto
« Citoyen »
1516617240000
    • Koruto#2851
    • Profil
    • Derniers messages
    • Tribu
#249
  0
Forgot to tell you it's not my 1st language in school I have being taught c++ which is half complete and I am the topper besides thay I know html and learning CSS. I wanted to learn this also but got stuck after some time of learning. So can anyone clear my doubts or refer to any other better thing.
Bolodefchoco
« Sénateur »
1516632000000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#250
  0
Hemant2002 a dit :
Forgot to tell you it's not my 1st language in school I have being taught c++ which is half complete and I am the topper besides thay I know html and learning CSS. I wanted to learn this also but got stuck after some time of learning. So can anyone clear my doubts or refer to any other better thing.

np! feel free to ask anything about lua ^_^
Koruto
« Citoyen »
1516701360000
    • Koruto#2851
    • Profil
    • Derniers messages
    • Tribu
#251
  0
For now I didn't got loops and function.
Bolodefchoco
« Sénateur »
1516730160000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#252
  2
Hemant2002 a dit :
For now I didn't got loops and function.

Let's compare with C++

@Noob codes for syntax purposes

Code C++

1
2
3
4
5
6
7
8
9
10
11
12
int addNumbers(int number1, int number2)
{
int result;
result = number1 + number2;
return result;
}

int main()
{
int result = addNumbers(10, 20);
cout << "The sum between 10 and 20 is " << result;
}
=
Code Lua

1
2
3
4
5
6
7
function addNumbers(number1, number2)
local result
result = number1 + number2
return result
end
result = addNumbers(10, 20)
print("The sum between 10 and 20 is " .. result)

and

Code C++

1
2
3
4
5
6
7
int main()
{
for (int i = 0; i < 10; i++)
{
cout << i << endl;
}
}
=
Code Lua

1
2
3
for i = 0, 9 do
print(i .. "\n")
end

and

Code C++

1
2
3
4
5
6
7
8
9
10
int main()
{
int numbers[] = {0, 10, 20, 30, 40, 45, 50};
int currentIndex = 0;
for (int number : numbers)
{
cout << "The number " << number << " is located in numbers[" << currentIndex << "]" << endl;
currentIndex++;
}
}

=

Code Lua

1
2
3
4
numbers = {0, 10, 20, 30, 40, 45, 50}
for currentIndex, number in next, numbers do
print("The number " .. number .. " is located in numbers[" .. currentIndex .. "]\n")
end
Wtal
« Citoyen »
1516972080000
    • Wtal#5272
    • Profil
    • Derniers messages
    • Tribu
#253
  0
try www.lua-users.org.
But the only problem is what are metastables
King_seniru
« Censeur »
1517036760000
    • King_seniru#5890
    • Profil
    • Derniers messages
    • Tribu
#254
  0
How to write something on the chat panel?
print() isnt showing anything to others
Bolodefchoco
« Sénateur »
1517079900000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#255
  0
Indika123 a dit :
How to write something on the chat panel?
print() isnt showing anything to others

You must use tfm.exec.chatMessage(message, playerName), but it is allowed for lua team members only
Wtal
« Citoyen »
1517308260000
    • Wtal#5272
    • Profil
    • Derniers messages
    • Tribu
#256
  0
How to get the position(X and Y position) of players or objects?
Bolodefchoco
« Sénateur »
1517315640000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#257
  0
Mouseclick1 a dit :
How to get the position(X and Y position) of players or objects?

tfm.get.room.playerList[player_name].X
tfm.get.room.playerList[player_name].Y

tfm.get.room.objectList[id].X
tfm.get.room.objectList[id].Y
Wtal
« Citoyen »
1517379900000
    • Wtal#5272
    • Profil
    • Derniers messages
    • Tribu
#258
  0
what are metatables? Can we use them in tfm (I didn't see them in Lua tree)
Bolodefchoco
« Sénateur »
1517409420000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#259
  0
Mouseclick1 a dit :
what are metatables? Can we use them in tfm (I didn't see them in Lua tree)

I had a thread about them on BR. The translators team are translating the topic. I'll make sure to quote you again with the link later ^_^
here it is

Dernière modification le 1517430960000
King_seniru
« Censeur »
1517454000000
    • King_seniru#5890
    • Profil
    • Derniers messages
    • Tribu
#260
  0
How to get the list of the players in a room?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Module FAQ & Documentation
« ‹ 13 / 19 › »
© Atelier801 2018

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

Version 1.27