×

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
  • /
  • [Aide] Demandes de codes et d'explications
« ‹ 21 / 70 › »
[Aide] Demandes de codes et d'explications
Nicolasledu
« Citoyen »
1389459660000
    • Nicolasledu#0000
    • Profil
    • Derniers messages
    • Tribu
#401
  0
J'ai jamais compris le return ... On peux m'expliquer ? :)
Podoko
« Citoyen »
1389463020000
    • Podoko#0000
    • Profil
    • Derniers messages
    • Tribu
#402
  0
quand t'as une fonction, tu peux affecter son résultat à une variable, par exemple si tu as la le code.
a dit :
function toto()
a = 5
return a
end

b = toto()

ta variable b contiendra 5.
On peut aussi faire des retours multiples en Lua :
a dit :
function toto()
return 1,"un truc",3
end

a,b,c = toto()

a, b et c contiendront respectivement 1, "un truc" et 3.

*Si une fonction n'a pas de return, elle renvoit 'nil'.
Htolmak
« Citoyen »
1389697500000
    • Htolmak#0000
    • Profil
    • Derniers messages
    • Tribu
#403
  0
J'ai rien compris, j'ai copier des codes, et maintenant,
J'ai au moin 3000 lignes '-'
J'arrive a rien faire ._.
J'ai fais ./module stop '-'

EDIT :

C'est bon j'ai eu ma reponce :x
Nathaan
« Citoyen »
1389769200000
    • Nathaan#0000
    • Profil
    • Derniers messages
    • Tribu
#404
  0
CE /LUA QUI S'EFFACE !!!

Pour tout dire, j'ai codé un module PENDANT 2 HEURES ET MON LUA S'EFFACE, omg ça saoule ça.

Mises à jour de la exe... Vive Baffler !
EDIT ; Baffler vidé aussi (#@!$ les updates)

EDIT² ; Cheeseformice Maps qui marche plus j'ai plus ma map, FUUUUUUUUUUUUUUUU

NEED EXPLICATION.
Nicolasledu
« Citoyen »
1389771240000
    • Nicolasledu#0000
    • Profil
    • Derniers messages
    • Tribu
#405
  0
Nathaan a dit :
CE /LUA QUI S'EFFACE !!!

Pour tout dire, j'ai codé un module PENDANT 2 HEURES ET MON LUA S'EFFACE, omg ça saoule ça.

Mises à jour de la exe... Vive Baffler !
EDIT ; Baffler vidé aussi (#@!$ les updates)

EDIT² ; Cheeseformice Maps qui marche plus j'ai plus ma map, FUUUUUUUUUUUUUUUU

NEED EXPLICATION.

T'as cas coder dans un editeur de texte et pour cheese for mice c'est normal !
Deathmatic
« Citoyen »
1389784320000
    • Deathmatic#0000
    • Profil
    • Derniers messages
#406
  0
Non mais coder directement depuis le /lua, faut pas s'étonner, hein. ^^
Pouletbraise
« Citoyen »
1389805020000
    • Pouletbraise#0000
    • Profil
    • Derniers messages
    • Tribu
#407
  0
Comment faire pour lancer des parties avec des cartes d'une seule catégorie? le newGame("#X") semble ne pas marcher
Victorleprot
« Citoyen »
1389806940000
    • Victorleprot#0000
    • Profil
    • Derniers messages
    • Tribu
#408
  0
Quelqu'un peut m'expliquer comment marche CookieClicker ?
Pouletbraise
« Citoyen »
1389807360000
    • Pouletbraise#0000
    • Profil
    • Derniers messages
    • Tribu
#409
  0
tu parles du site http://orteil.dashnet.org/cookieclicker/ ou il y a un module CookieClicker?
Victorleprot
« Citoyen »
1389807360000
    • Victorleprot#0000
    • Profil
    • Derniers messages
    • Tribu
#410
  0
Je parle du salon CookieClicker.
*#cookieclicker
Transfohera
« Citoyen »
1391626080000
    • Transfohera#0000
    • Profil
    • Derniers messages
    • Tribu
#411
  0
Comment on fait pour la commande !fly pour voler ??
Pyrospower
« Citoyen »
1391705160000
    • Pyrospower#0000
    • Profil
    • Derniers messages
#412
  0
ESPACE (touche)
Transfohera
« Citoyen »
1391708400000
    • Transfohera#0000
    • Profil
    • Derniers messages
    • Tribu
#413
  0
Nan le code lua :)
Thewav
« Citoyen »
1391795400000
    • Thewav#0095
    • Profil
    • Derniers messages
    • Tribu
#414
  0
Il faut utiliser la fonction tfm.exec.movePlayer avec tfm.exec.bindKeyboard.
Voici un exemple où il faut appuyer sur espace pour voler:

Shamousey a dit :

function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

function eventKeyboard(name,key,down,x,y)
if key==32 then
tfm.exec.movePlayer(name,0,0,true,0,-50,false)
end
end
Transfohera
« Citoyen »
1391795700000
    • Transfohera#0000
    • Profil
    • Derniers messages
    • Tribu
#415
  0
Merci mes je demander le code de la commandes que quans tu fais :
!fly tu pe voler et quans tu fais
!flyoff tu ne peux plus voler
Thewav
« Citoyen »
1391796480000
    • Thewav#0095
    • Profil
    • Derniers messages
    • Tribu
#416
  0
Le code devient alors

a dit :

players={}

function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

function eventKeyboard(name,key,down,x,y)
if key==32 and players[name] then
tfm.exec.movePlayer(name,0,0,true,0,-50,false)
end
end

function eventChatCommand(name,msg)
if msg=="fly" then
players[name]=true
elseif msg=="flyoff" then
players[name]=false
end
end
Louimice
« Citoyen »
1391947380000
    • Louimice#0000
    • Profil
    • Derniers messages
    • Tribu
#417
  0
Salut, je viens de découvrir le lua, et j'essaye d'apprendre les bases, mais si ça tombe, j'ai rien compris :S

Voilà, pourquoi dans ce code, les commandes "!fromage" et "!gagner" fonctionnent et pas celle "!vampire" ?

a dit :
function eventChatCommand(name,command)
if command == "fromage" then
tfm.exec.giveCheese(name)
function eventChatCommand(name,command)
if command == "gagner" then
tfm.exec.playerVictory(name)
function eventChatCommand(name,command)
if command == "vampire" then
tfm.exec.setVampirePlayer (playerName)
end
end
end
end
end
end

.
Transfohera
« Citoyen »
1391947980000
    • Transfohera#0000
    • Profil
    • Derniers messages
    • Tribu
#418
  0
a dit :

function eventChatCommand(name,command)
if command == "fromage" then
tfm.exec.giveCheese(name)
end
if command == "gagner" then
tfm.exec.playerVictory(name)
end
if command == "vampire" then
tfm.exec.setVampirePlayer (name)
end
end

Voila :)
Sinon je pence que vampire ne marche pas car tu a mi playerName allor que sais name .
Louimice
« Citoyen »
1391949420000
    • Louimice#0000
    • Profil
    • Derniers messages
    • Tribu
#419
  0
Merci ^^ Sinon, pourquoi t'as mis deux fois "end" à la fin ?

Et aussi, pour les couleurs, faut faire quoi ? "0x@code" ?

Et pour afficher un message quand un joueur entre dans le salon faut remplacer "message" par son message dans ce code ? Comment on fait ?

a dit :

function eventNewPlayer(name)
tfm.exec.chatMessage (message,name)
end
Transfohera
« Citoyen »
1391951700000
    • Transfohera#0000
    • Profil
    • Derniers messages
    • Tribu
#420
  0
Si j'ais mi 2 fois end sais pour fermer la function et le tfm.exec.setVampirePlayer :)

pour les couleur de quoi ?

et pour le mesage sais :
a dit :
function eventNewPlayer(pseudo)
ui.addPopup(1, 0, "[mesage]", pseudo, 150, 75, 500);
end
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Aide] Demandes de codes et d'explications
« ‹ 21 / 70 › »
© Atelier801 2018

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

Version 1.27