×

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
  • /
  • Archives
  • /
  • Module API FAQ
« ‹ 35 / 38 › »
Module API FAQ
Podoko
« Citoyen »
1399395420000
    • Podoko#0000
    • Profil
    • Derniers messages
    • Tribu
#681
  0
It's a bug that had been removed in april the 28th. Looks like the admins restored it a few days ago.
a dit :
sorry for my english ^__^
Zutto
« Citoyen »
1399472220000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#682
  0
How can we learn tfm's Lua if we can't use many functions and events ?
Gabrijelr
« Citoyen »
1399472880000
    • Gabrijelr#0000
    • Profil
    • Derniers messages
    • Tribu
#683
  0
Aritxy a dit :
How can we learn tfm's Lua if we can't use many functions and events ?

You can program minigames for you tribe, and you can use 90% of all the events and functions.
Zutto
« Citoyen »
1399473240000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#684
  0
Gabrijelr a dit :


You can program minigames for you tribe, and you can use 90% of all the events and functions.

Yes, but with the Module they wanted to have more official minigames, if we can't use those functions that aren't available, we don't know how do they work and we can't do more minigames and we can't be part of the module team
Gabrijelr
« Citoyen »
1399493760000
    • Gabrijelr#0000
    • Profil
    • Derniers messages
    • Tribu
#685
  0
Aritxy a dit :


Yes, but with the Module they wanted to have more official minigames, if we can't use those functions that aren't available, we don't know how do they work and we can't do more minigames and we can't be part of the module team

You can apply for the module team here: CLICK ME!
Yteizz
« Citoyen »
1399762140000
    • Yteizz#0000
    • Profil
    • Derniers messages
#686
  0
As is transformed into another animal #control?
Gabrijelr
« Citoyen »
1399810680000
    • Gabrijelr#0000
    • Profil
    • Derniers messages
    • Tribu
#687
  0
Yteizz a dit :
As is transformed into another animal #control?

You can only do that if you are in the module team. They have rights to load images. The Nyan Cat gif is just loaded over players corfinates like this:

a dit :

for name, player in pairs(tfm.get.room.playerList) do
tfm.exec.addImage("http://img1.wikia.nocookie.net/__cb20130608144609/anime-arts/images/7/7a/Nyan_cat_by_kkiittuuss-d4k5mf8.png", "%"..name, 0, 0)
end
Shamousey
« Consul »
1399815420000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#688
  0
Gabrijelr a dit :
You can only do that if you are in the module team. They have rights to load images. The Nyan Cat gif is just loaded over players corfinates like this:

Minor nitpicking but someone may find it useful, only images uploaded to imgur can be used in tfm.exec.addImage(). If you wanted to use http://i.imgur.com/1Sg9gfU.png for example, you'd need to only put in the file name, 1Sg9gfU.png

Also, the top-left of the image is aligned to the center of the mouse, meaning that you'd need to offset the image by half the height and width of the full image.

tfm.exec.addImage("1Sg9gfU.png","%"..name,-21,-30)
Bruno
« Censeur »
1399831020000
    • Bruno#3852
    • Profil
    • Derniers messages
    • Tribu
#689
  0
% and $ are both?
Shamousey
« Consul »
1399839180000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#690
  0
Zzmacth a dit :
% and $ are both?

% Replaces the mouse graphic.
$ adds an image next to the mouse graphic.
Gabrijelr
« Citoyen »
1399892340000
    • Gabrijelr#0000
    • Profil
    • Derniers messages
    • Tribu
#691
  0
Shamousey a dit :


Minor nitpicking but someone may find it useful, only images uploaded to imgur can be used in tfm.exec.addImage(). If you wanted to use http://i.imgur.com/1Sg9gfU.png for example, you'd need to only put in the file name, 1Sg9gfU.png

Also, the top-left of the image is aligned to the center of the mouse, meaning that you'd need to offset the image by half the height and width of the full image.

tfm.exec.addImage("1Sg9gfU.png","%"..name,-21,-30)

I'm sorry for that, I'm not in the Module Team so I haven't tested it.(I didn't even think about that)
Zutto
« Citoyen »
1400846160000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#692
  0
Hey.

I'm confused because shamo, you gave an example of an image, but another people says that is like this:

a dit :

local images = {
test = "1Sg9gfU.png"
}

function main()
tfm.exec.addImage(images.test,"!1",-21,-30)
end

main()


Wich is the correct?
Makinit
« Citoyen »
1400848620000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#693
  0
Aritxy a dit :
Hey.

I'm confused because shamo, you gave an example of an image, but another people says that is like this:
Wich is the correct?

It's in the documentation: Topic-451587
a dit :
*tfm.exec.addImage(String imageName, String target, Int xPosition, Int yPosition, String targetPlayer)
• Add an image to the map. Target can be :
#mobileId
$playerName
%playerName
?backgroundLayerDepth
_groundLayerDepth
!foregroundLayerDepth
&fixedLayerDepth
Return an image id. If targetPlayer is NIL, it sends it to all players.
Shamousey
« Consul »
1400862720000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#694
  0
Aritxy a dit :
Hey.

I'm confused because shamo, you gave an example of an image, but another people says that is like this:
Wich is the correct?

That's exactly the same, except they're using a basic table and function for it too. The addImage() function is still the same.
Figurar
« Citoyen »
1400895480000
    • Figurar#0000
    • Profil
    • Derniers messages
    • Tribu
#695
  0
When I press TAB, open the messagem for everyone. Ho I make to appear just 4me?
@edit: just for the mice then start the function.
Skynanners
« Citoyen »
1400952960000
    • Skynanners#0000
    • Profil
    • Derniers messages
    • Tribu
#696
  0
How to fix
134: 'end' expected (to close 'if' at line 17)

sorry im just a noob
Gabrijelr
« Citoyen »
1400957040000
    • Gabrijelr#0000
    • Profil
    • Derniers messages
    • Tribu
#697
  0
Skynanners a dit :
How to fix
134: 'end' expected (to close 'if' at line 17)

sorry im just a noob

Just add another "end" on the last line of your code like this:
a dit :

function eventChatCommand(name,command)
if command == "test" then
print("Test")
end
end <----- You put end here if you have an "if" statement

You're probably wondering why.

Every function needs to end, so you put "end" in your code so the computer knows you're closing that function and it will do whatever you told him to do in that function. But you also need to "end" your "if" statements.
You should not use end for "else" or"elseif" statements.

If you know something about Java or similar programming languages, you notice you need to use { and }brackets. Those are somewhat similar to "end" and you can compare it to Lua.
Shamousey
« Consul »
1400958180000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#698
  0

http://i.imgur.com/MDGwUGi.jpg
Gabrijelr
« Citoyen »
1400958540000
    • Gabrijelr#0000
    • Profil
    • Derniers messages
    • Tribu
#699
  0
Shamousey a dit :

Oh my God! I'm still laughing.
Crazysushi
« Citoyen »
1401647340000
    • Crazysushi#0000
    • Profil
    • Derniers messages
#700
  0
How do you undo a module in a tribe? Is there like an " /unmodule #utility " thing I could say?
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Module API FAQ
« ‹ 35 / 38 › »
© Atelier801 2018

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

Version 1.27