×

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
« ‹ 12 / 19 › »
Module FAQ & Documentation
Leo238484
« Citoyen »
1500297120000
    • Leo238484#0000
    • Profil
    • Derniers messages
#221
  0
how to use tfm.exec.removeImage(ID)?
Onkei
« Citoyen »
1500302520000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#222
  0
Leo238484 a dit :
how to use tfm.exec.removeImage(ID)?

You get the ID of an image from executing the tfm.exec.addImage function and storing it into a variable.


Code Lua

1
2
3
local id = tfm.exec.addImage(imageName, target, xPosition, yPosition, targetPlayer)

tfm.exec.removeImage(id)
Censere
« Consul »
1500618780000
    • Censere#0095
    • Profil
    • Derniers messages
    • Tribu
#223
  0
Hey, does anyone have any information about the Bootcamp Training module? CFM is no longer working so I can't see the thread there, does anyone know if there's any other info out there about it?
Honorabilis
« Consul »
1501348500000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#224
  0
How can I do, sub-modules? with code or something else?
Onkei
« Citoyen »
1501349880000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#225
  0
Honorabilis a dit :

How can I do, sub-modules? with code or something else?

Is something like this what you mean? This is untested so I'm not sure if the event loading will work


Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
-- Custom Functions

function debugIt(eventType)
--[[
Print out a random error message for convenience.
]]
print("No " .. eventType .. " event registered.")
end

local currentModule, subModules = {}, {}
function main()
--[[
Loading up all the submodules.
]]
subModules.deathmatch = {
init = function()

end,

eventNewGame = function()

end,

eventKeyboard = function(n, key, down, x, y)

end,

eventLoop = function(passed, left)

end,
}

subModules.drawing = {
init = function()

end,

eventKeyboard = function(n, key, down, x, y)

end,
}

subModules.goat = {
init = function()

end,

eventNewGame = function()

end,

eventKeyboard = function(n, key, down, x, y)

end,

eventLoop = function(passed, left)

end,
}

--[[
Assigning a default module to run.
]]
currentModule = subModules["deathmatch"]
currentModule.init()
end

-- TFM API Functions

function eventNewGame()
currentModule["eventNewGame"] and currentModule["eventNewGame"]() or debugIt("new map loaded")
end

function eventKeyboard(n, key, down, x, y)
currentModule["eventKeyboard"] and currentModule["eventKeyboard"](n, key, down, x, y) or debugIt("keyboard")
end

function eventLoop(passed, left)
currentModule["eventLoop"] and currentModule["eventLoop"](passed, left) or debugIt("loop")
end

local ADMINS = {Onkei = true, Honorabilis = true}
function eventChatCommand(n, cmd)
if ADMINS[n] then
if subModules[cmd] then
currentModule = subModules[cmd]
currentModule.init()
end
end
end

main()


Shamousey's #utility goes even crazier with this idea
Honorabilis
« Consul »
1501354560000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#226
  0
Onkei a dit :
Honorabilis a dit :

How can I do, sub-modules? with code or something else?

Is something like this what you mean? This is untested so I'm not sure if the event loading will work


Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
-- Custom Functions

function debugIt(eventType)
--[[
Print out a random error message for convenience.
]]
print("No " .. eventType .. " event registered.")
end

local currentModule, subModules = {}, {}
function main()
--[[
Loading up all the submodules.
]]
subModules.deathmatch = {
init = function()

end,

eventNewGame = function()

end,

eventKeyboard = function(n, key, down, x, y)

end,

eventLoop = function(passed, left)

end,
}

subModules.drawing = {
init = function()

end,

eventKeyboard = function(n, key, down, x, y)

end,
}

subModules.goat = {
init = function()

end,

eventNewGame = function()

end,

eventKeyboard = function(n, key, down, x, y)

end,

eventLoop = function(passed, left)

end,
}

--[[
Assigning a default module to run.
]]
currentModule = subModules["deathmatch"]
currentModule.init()
end

-- TFM API Functions

function eventNewGame()
currentModule["eventNewGame"] and currentModule["eventNewGame"]() or debugIt("new map loaded")
end

function eventKeyboard(n, key, down, x, y)
currentModule["eventKeyboard"] and currentModule["eventKeyboard"](n, key, down, x, y) or debugIt("keyboard")
end

function eventLoop(passed, left)
currentModule["eventLoop"] and currentModule["eventLoop"](passed, left) or debugIt("loop")
end

local ADMINS = {Onkei = true, Honorabilis = true}
function eventChatCommand(n, cmd)
if ADMINS[n] then
if subModules[cmd] then
currentModule = subModules[cmd]
currentModule.init()
end
end
end

main()


Shamousey's #utility goes even crazier with this idea

i meant #grounds00hardcamp, #ffarace00click.

Dernière modification le 1501354740000
Barberserk
« Consul »
1503579420000
    • Barberserk#0000
    • Profil
    • Derniers messages
    • Tribu
#227
  0
Unotfm often lags/freezes. Other times it suddenly changes to a normal room. It's impossible to unlock the shaman chair while this problem exists, any solution in the horizon?

Dernière modification le 1503649500000
Ceapasy
« Censeur »
1503826980000
    • Ceapasy#4992
    • Profil
    • Derniers messages
    • Tribu
#228
  0
What is #minigolf?
Help
Anthonyjones
« Censeur »
1505195100000
    • Anthonyjones#0000
    • Profil
    • Derniers messages
    • Tribu
#229
  0
Anyelse link for Official Module of #unotfm? Thank
Ceapasy
« Censeur »
1506017880000
    • Ceapasy#4992
    • Profil
    • Derniers messages
    • Tribu
#230
  0
A guide for Pewpew?
Antonio
« Sénateur »
1507649580000
    • Antonio#9975
    • Profil
    • Derniers messages
    • Tribu
#231
  0
Is there a codeacademy like course for lua? Sort like step by step w/ interactions.

What version of lua are you guys using?

Dernière modification le 1507649700000
Honorabilis
« Consul »
1508251560000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#232
  0
Nekotonyy a dit :
What version of lua are you guys using?

TFM's Lua isn't same with real one but similar.

Dernière modification le 1508251620000
Syrius
« Consul »
1508251920000
    • Syrius#8114
    • Profil
    • Derniers messages
    • Tribu
#233
  0
Nekotonyy a dit :
Is there a codeacademy like course for lua? Sort like step by step w/ interactions.

What version of lua are you guys using?

If I remember correctly, it was 5.2, if it isn' updated for now.
Antonio
« Sénateur »
1509919080000
    • Antonio#9975
    • Profil
    • Derniers messages
    • Tribu
#234
  0
In Lua, what's an alt to json. Like assign a string to another string?
Parfait
« Citoyen »
1510827600000
    • Parfait#0000
    • Profil
    • Derniers messages
#235
  0
Hi, is there a way through code to see the current ping of a player in the room?
Onkei
« Citoyen »
1510832520000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#236
  0
Nekotonyy a dit :
In Lua, what's an alt to json. Like assign a string to another string?

Apologies for the super late reply, do you mean something like this?

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
local mice = {
["Nekotonyy"] = {
["position"] = {
x = 0,
y = 0
}
},

["Onkei"] = {
["position"] = {
x = 0,
y = 0
}
}
}

Parfait a dit :
Hi, is there a way through code to see the current ping of a player in the room?

I believe it's impossible to see the ping of a player in the room.
Antonio
« Sénateur »
1510837680000
    • Antonio#9975
    • Profil
    • Derniers messages
    • Tribu
#237
  0
Onkei a dit :
Nekotonyy a dit :
In Lua, what's an alt to json. Like assign a string to another string?

Apologies for the super late reply, do you mean something like this?

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
local mice = {
["Nekotonyy"] = {
["position"] = {
x = 0,
y = 0
}
},

["Onkei"] = {
["position"] = {
x = 0,
y = 0
}
}
}

Parfait a dit :
Hi, is there a way through code to see the current ping of a player in the room?

I believe it's impossible to see the ping of a player in the room.

Yeah basically...
Onkei
« Citoyen »
1510839180000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#238
  0
Nekotonyy a dit :
Yeah basically...

You probably know this already, but you can also access the data the same way you would in JS.

Code Lua

1
2
3
4
5
6
7
8
9
10
-- Accessing Nekotonyy's x position
local x = mice.Nekotonyy.position.x

-- Transporting players that are located in the table to their positions
for name in pairs(tfm.get.room.playerList) do
if mice[name] then
local position = mice[name].position
tfm.exec.movePlayer(name, position.x, position.y)
end
end
Fusionisreal
« Citoyen »
1514116380000
    • Fusionisreal#0000
    • Profil
    • Derniers messages
    • Tribu
#239
  0
How can I join the Module Team? The link does not seem to work as well as apply.staff801.com.
Bolodefchoco
« Sénateur »
1514127240000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#240
  1
Fusionisreal a dit :
How can I join the Module Team? The link does not seem to work as well as apply.staff801.com.

Currently you can't.
The form was deactivated due to security problems and admins doesn't care about the lua team, so it's gonna be back too late probably xD
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Module FAQ & Documentation
« ‹ 12 / 19 › »
© Atelier801 2018

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

Version 1.27