×

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
« ‹ 9 / 38 › »
Module API FAQ
Epicshawty
« Citoyen »
1378501200000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#161
  0
Is there a code to run ONLY survivor maps?
Or I have to add them manually?
Shamousey
« Consul »
1378501740000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#162
  0
tfm.exec.newGame("#10")
Epicshawty
« Citoyen »
1378501740000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#163
  0
Shamousey a dit :
tfm.exec.newGame("#10")

thanks
e: do i have to loop that? or the scripts restart when the new game starts?
Codework
« Citoyen »
1378504140000
    • Codework#0000
    • Profil
    • Derniers messages
    • Tribu
#164
  0
Epicshawty a dit :
thanks
e: do i have to loop that? or the scripts restart when the new game starts?

use this
tfm.exec.disableAutoNewGame(true)
function eventLoop(currentTime,timeRemaining)
[tab]if timeRemaining <= 1000 then
[tab][tab]tfm.exec.newGame("#10")
[tab]end
end
Epicshawty
« Citoyen »
1378507860000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#165
  0
Codework a dit :
use this
tfm.exec.disableAutoNewGame(true)
function eventLoop(currentTime,timeRemaining)
[tab]if timeRemaining &lt;= 1000 then
[tab][tab]tfm.exec.newGame("#10")
[tab]end
end

danke'
Bigcrushes
« Citoyen »
1378548960000
    • Bigcrushes#0000
    • Profil
    • Derniers messages
    • Tribu
#166
  0
http://pastebin.com/6iM2gsps

ATTEMPT 2!!PLEASE TEST FOR ME D:
Tailtong
« Citoyen »
1378549080000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#167
  0
Bigcrushes a dit :
http://pastebin.com/6iM2gsps

ATTEMPT 2!!PLEASE TEST FOR ME D:

or you could just ask some lua tester to run it and you could see it yourself too
Shamousey
« Consul »
1378549500000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#168
  0
Bigcrushes a dit :
http://pastebin.com/6iM2gsps

ATTEMPT 2!!PLEASE TEST FOR ME D:

Maybe you shouldn't ask for people to test it, rather just let people look at your code and see if anything's wrong with it.

On lines 4, 5, and 6, you have an end - but only two things to end (the opening function, and if statement). The only other problem (although not a technical one) is that when a new player joins, that welcome message will be sent to everyone.
Abdeltif
« Citoyen »
1378561020000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#169
  0
I need help here ,
What does % refer to ?
Thewav
« Citoyen »
1378561740000
    • Thewav#0095
    • Profil
    • Derniers messages
    • Tribu
#170
  0
Look the lua doc about string and format()
Abdeltif
« Citoyen »
1378562400000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#171
  0
Mm , how to pop up a text box ?
Bigcrushes
« Citoyen »
1378562520000
    • Bigcrushes#0000
    • Profil
    • Derniers messages
    • Tribu
#172
  0
maybe this will help
kikoo.formice.com/doku.php?id=module_api_documentation
Abdeltif
« Citoyen »
1378562520000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#173
  0
Bigcrushes a dit :
maybe this will help
kikoo.formice.com/doku.php?id=module_api_documentation

I am reading it , but i don't find it
Fxie
« Citoyen »
1378562640000
    • Fxie#0000
    • Profil
    • Derniers messages
    • Tribu
#174
  0
ui Package (very bottom)

addPopup

Int id, Int type, String text, String targetPlayer, Int x, Int y, Int width

Add a popup. Popup type : 0 (simple), 1 (yes or no), 2 (player input). If targetPlayer is NIL, it sends it to all players.

e.g.: ui.addPopup(1,0,"Hello, close this.") -- shows for everyone since target wasn't defined and is positioned in the top left since x/y/w weren't defined
Abdeltif
« Citoyen »
1378562760000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#175
  0
Fxie a dit :
ui Package (very bottom)

addPopup

Int id, Int type, String text, String targetPlayer, Int x, Int y, Int width

Add a popup. Popup type : 0 (simple), 1 (yes or no), 2 (player input). If targetPlayer is NIL, it sends it to all players.

e.g.: ui.addPopup(1,0,"Hello, close this.") -- shows for everyone since target wasn't defined and is positioned in the top left since x/y/w weren't defined

Thanks , this would help me.
Since you are here , what does % mean ??
Bigcrushes
« Citoyen »
1378562940000
    • Bigcrushes#0000
    • Profil
    • Derniers messages
    • Tribu
#176
  0
Fxie a dit :
% is modulus, it gives you the remainder of a/b.

up one page. She explained it. hope helps :3
Fxie
« Citoyen »
1378563060000
    • Fxie#0000
    • Profil
    • Derniers messages
    • Tribu
#177
  0
When comparing numbers, % is the modulus operator, explained on page 8. It gives you the remainder of division between a%b (a/b). 8%2 is 0 (no remainer), 9%2 is 1 (the remainder of 9/2).

In strings (as you might see in some translations), %s, %d, and other cases are used for formatting. "Hello %s." is replaced with "Hello Abdeltif." This is useful for different languages for the same strings that print the same information regardless of language (usernames, numbers, etc.)

Unless you have a firm understanding of Lua already, I strongly advise you NOT WORRY ABOUT THIS. You'll just end up confusing yourself more starting too far.
Abdeltif
« Citoyen »
1378563060000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#178
  0
Fxie a dit :
When comparing numbers, % is the modulus operator, explained on page 8. It gives you the remainder of division between a%b (a/b). 8%2 is 0 (no remainer), 9%2 is 1 (the remainder of 9/2).

In strings (as you might see in some translations), %s, %d, and other cases are used for formatting. "Hello %s." is replaced with "Hello Abdeltif." This is useful for different languages for the same strings that print the same information regardless of language (usernames, numbers, etc.)

OH THANKS !
Better then typing a long text :]

Sorry for double post again
How to make a team go to x,y
and the other one go to x,y
Using the same way that fxie showed in Page 8

[Sentinel] Please just edit your post by clicking the little icon next to 'edit' under your avatar. Thanks!
Abdeltif
1378565760000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#179
[Modéré par Bolinboy, raison : double post]
Fxie
« Citoyen »
1378566240000
    • Fxie#0000
    • Profil
    • Derniers messages
    • Tribu
#180
  0
for i,name in ipairs(teams[1]) do
tfm.exec.movePlayer(name,x,y)
end

for i,name in ipairs(teams[2]) do
tfm.exec.movePlayer(name,x,y)
end
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Module API FAQ
« ‹ 9 / 38 › »
© Atelier801 2018

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

Version 1.27