×

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
  • /
  • [Unofficial Module] #Iced!
« ‹ 2 / 9 › »
[Unofficial Module] #Iced!
Savel
« Citoyen »
1382890080000
    • Savel#0000
    • Profil
    • Derniers messages
    • Tribu
#21
  0
[•] Runtime Error : transformice.lua:11: attempt to index ? (a nil value)

I'm getting the same error as Leaf.. ;-;
Zutto
« Citoyen »
1382891880000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#22
  0
Don't work q.q
Mousechris
« Censeur »
1382893680000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#23
  0
Safwanrockz a dit :
I liked this game :o in fact I made a banner for it~

Hope you like it o/

Yes great banner :D

Also everyone sorry about the funked up script!

Butttttt

It should be working now ^-^ just tested it

also we still need those maps @.@
Savel
« Citoyen »
1382909040000
    • Savel#0000
    • Profil
    • Derniers messages
    • Tribu
#24
  0
@4446136 how about this one?
Felipg
« Citoyen »
1382915040000
    • Felipg#0000
    • Profil
    • Derniers messages
#25
  0
@4446416 ^^ vertical scroll.
Baasbase
« Citoyen »
1382919780000
    • Baasbase#0095
    • Profil
    • Derniers messages
#26
  0
Hi, your script was pretty inconsistent and poorly programmed at certain points, so I decided to clean it up. Please take this as feedback rather than critisism, I hope you can learn from what I did.

Baasbase a dit :
function f(txt) -- just for readability
return string.format([[<font color="#89A7F5">%s</font>]], txt)
end

local welcome = string.format("<N>Hello there! %s is an unofficial minigame that can currently only be played in the tribe house. Please support %s!", f("#Iced"), f("#Iced"))
print(welcome) -- why though?

maps = { 4414828, 4431469, 4433446 }
players = {}

function getMouseCount()
local count = 0
for p in pairs(tfm.get.room.playerList) do
if not tfm.get.room.playerList

.isDead or players

.id then
count = count + 1
end
end
return count
end

function eventLoop(time,remaining)
local n = getMouseCount()
if remaining <= 0 or n == 0 then
newRound()
end
end

function newRound()
tfm.exec.newGame(maps[math.random(#maps)])
end

function eventNewGame()
tfm.exec.snow()
tfm.exec.setUIMapName(string.format("<N>Welcome to %s! Press %s to turn into an Ice Cube! Press %s to turn into an Ice Plank! Have fun! \n", f("#Iced"), f("Z"), f("X")))
end

function eventNewPlayer(name)
ui.addTextArea(1, string.format("<p align='center'><b>%s</b></p>", welcome), name, 5, 25, 790, 25, nil, nil, 0)
tfm.exec.bindKeyboard(name, 87, true, true)
tfm.exec.bindKeyboard(name, 88, true, true)
players[name] = { timestamp = os.time() }
end

function eventKeyboard(name,key,down,x,y)
local p = players[name]
if p.timestamp < os.time() - 800 then
if not tfm.get.room.playerList[name].isDead then
tfm.exec.killPlayer(name)
local id = tfm.exec.addShamanObject((key == 87 and 54 or 45), x, y)
p.id = id
elseif p.id then
tfm.exec.respawnPlayer(name)
local x_ = tfm.get.room.objectList[p.id].x
if x_ == 0 then
tfm.exec.killPlayer(name)
else
tfm.exec.movePlayer(name, x_, tfm.get.room.objectList[p.id].y)
end
tfm.exec.removeObject(p.id)
p.id = nil
end
p.timestamp = os.time()
end
end


function main()
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.newGame(maps[math.random(#maps)])
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
end

main()

function eventPlayerWon(name)
players[name].id = nil
end

function eventPlayerGetCheese(name)
tfm.exec.playerVictory(name)
end

Mousechris
« Censeur »
1382920320000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#27
  0
Savel a dit :
@4446136 how about this one?

No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^
No cheese for you! ^_^

This says "too much spawn jump spawn gameplay"

Felipg a dit :
@4446416 ^^ vertical scroll.

I'd like to add this with some edits, make the grounds behind the Icey Water Invisable, and the left water ground needs to be aligned better. Also add a cloud or invisable ground that has collision with grounds at the spawn so afk mice can't be disturbed. Also, please improve the height of the ground in the top right.

Baasbase a dit :
Hi, your script was pretty inconsistent and poorly programmed at certain points, so I decided to clean it up. Please use take this as feedback rather than critisism, I hope you can learn from what I did.
text after quote.

Thanks, I'll test this out once I can get a few tribe members in the tribe house, much appriciated, I'm not exactly the best coder. :c
Jordy
« Consul »
1382920440000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#28
  0
Mousechris a dit :
Jordynl for being such a kickass coder and cleaning up the script!

Actually I just gave you hints and edited some stuff. :P
I'm a totally noob at Lua. Baasbase best coder!
Theleetcoder
« Citoyen »
1382923380000
    • Theleetcoder#0000
    • Profil
    • Derniers messages
    • Tribu
#29
  0
(Sorry for my bad english, i'm french :3).

The dead spamming is horrible...
To make it up, just move player at the top of the map in a box (maked with xml).
(In my example, you have to use the base xml in take you in the bottom of this post).

Example :

[quote=Lua code (base by Baas)]
function f(txt) -- just for readability
return string.format([[<font color="#89A7F5">%s</font>]], txt)
end

local welcome = string.format("<N>Hello there! %s is an unofficial minigame that can currently only be played in the tribe house. Please support %s!", f("#Iced"), f("#Iced"))
print(welcome) -- why though?

maps = { 4414828, 4431469, 4433446, 4446136 }
players = {}

function getMouseCount()
local count = 0
for p in pairs(tfm.get.room.playerList) do
if not tfm.get.room.playerList

.isDead or players

.id then
count = count + 1
end
end
return count
end

function eventLoop(time,remaining)
local n = getMouseCount()
if remaining <= 0 or n == 0 then
newRound()
end
end

function newRound()
tfm.exec.newGame(maps[math.random(#maps)])
end

function eventNewGame()
tfm.exec.snow()
tfm.exec.setUIMapName(string.format("<N>Welcome to %s! Press %s to turn into an Ice Cube! Press %s to turn into an Ice Plank! Have fun! \n", f("#Iced"), f("Z"), f("X")))
end

function eventNewPlayer(name)
ui.addTextArea(1, string.format("<p align='center'><b>%s</b></p>", welcome), name, 5, 25, 790, 25, nil, nil, 0)
tfm.exec.bindKeyboard(name, 87, true, true)
tfm.exec.bindKeyboard(name, 88, true, true)
players[name] = { timestamp = os.time(), isIced = false }
end

function eventKeyboard(name,key,down,x,y)
local p = players[name]
if p.timestamp < os.time() - 800 then
if not p.isIced then
p.isIced = true -- player is now iced.
tfm.exec.movePlayer(name, 400, -520, false, 0, 0, false) -- For avoid dead spamming.
local id = tfm.exec.addShamanObject((key == 87 and 54 or 45), x, y)
p.id = id
elseif p.id then
local x_ = tfm.get.room.objectList[p.id].x
if x_ == 0 then
tfm.exec.killPlayer(name)
else
p.isIced = false
tfm.exec.movePlayer(name, x_, tfm.get.room.objectList[p.id].y)
end
tfm.exec.removeObject(p.id)
p.id = nil
end
p.timestamp = os.time()
end
end


function main()
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.newGame(maps[math.random(#maps)])
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
end

main()

function eventPlayerWon(name)
players[name].id = nil
end

function eventPlayerGetCheese(name)
tfm.exec.playerVictory(name)
end

function eventChatCommand(name, command)
if command == "np" then
tfm.exec.newGame(maps[math.random(#maps)])
elseif command == "die" or command == "mort" or command == "kill" then
tfm.exec.killPlayer(name)
end
end[/quote]

Base xml a dit :

<C><P /><Z><S><S L="60" o="324650" H="10" X="400" Y="-520" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="60" o="324650" X="400" Y="-570" T="12" H="10" /><S L="60" o="324650" X="425" H="10" Y="-545" T="12" P="0,0,0.3,0.2,90,0,0,0" /><S P="0,0,0.3,0.2,90,0,0,0" L="60" o="324650" H="10" Y="-545" T="12" X="375" /></S><D /><O /></Z></C>

Regards.
Mousechris
« Censeur »
1382923500000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#30
  0
Theleetcoder a dit :
The dead spamming is...
To make it up, just move player at the top of the map in a box (maked with xml).
(In my example, you have to make a box of 30 x 30 (x: 400 y: 520) on every maps).

Example :


Regards.

Oh wow your amazing thanks

seems rather glitchy but still much better then what we all did
Theleetcoder
« Citoyen »
1382923740000
    • Theleetcoder#0000
    • Profil
    • Derniers messages
    • Tribu
#31
  0
In the version i've helped, you have a « glitch » because you have not a box at the top of the map. :)

edit: I've cleaned my code to the forum « &amp;, &lt;, &gt; ».
Mousechris
« Censeur »
1382923860000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#32
  0
Theleetcoder a dit :
In the version i've helped, you have a « glitch » because you have not a box at the top of the map. :)

could you explain better what you mean by box @_@
Theleetcoder
« Citoyen »
1382923980000
    • Theleetcoder#0000
    • Profil
    • Derniers messages
    • Tribu
#33
  0
Mousechris a dit :
could you explain better what you mean by box @_@

Yes, i go make a little map for show you.
(Load my xml code and press space + clic, drag down your mouse. A box appears :p).

Just wait a little ;)
Mousechris
« Censeur »
1382924280000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#34
  0
Theleetcoder a dit :
Yes, i go make a little map for show you.
(Load my xml code and press space + clic, drag down your mouse. A box appears :p).

Just wait a little ;)

Oh I see it now, ok i'll see what I can do
Theleetcoder
« Citoyen »
1382924400000
    • Theleetcoder#0000
    • Profil
    • Derniers messages
    • Tribu
#35
  0
This map : @4446887
This code :
a dit :

<C><P F="2" /><Z><S><S L="60" o="324650" H="10" X="400" Y="-520" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="60" o="324650" X="400" Y="-570" T="12" H="10" /><S L="60" o="324650" X="425" H="10" Y="-545" T="12" P="0,0,0.3,0.2,90,0,0,0" /><S P="0,0,0.3,0.2,90,0,0,0" L="60" o="324650" H="10" Y="-545" T="12" X="375" /><S L="80" X="41" H="80" Y="350" T="1" P="0,0,0,0.2,0,0,0,0" /><S L="150" X="119" H="100" Y="390" T="1" P="0,0,0,0.2,30,0,0,0" /><S L="30" X="264" H="212" Y="258" T="1" P="0,0,0,0.2,0,0,0,0" /><S L="800" X="400" H="50" Y="400" T="11" P="0,0,0.05,0.1,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="70" H="195" c="3" Y="278" T="14" X="515" /><S L="183" X="709" H="36" Y="263" T="1" P="0,0,0,0.2,0,0,0,0" /><S L="70" X="515" H="195" Y="279" T="9" P="0,0,,,,0,0,0" /><S L="175" H="75" X="713" Y="230" T="1" P="0,0,0,0.2,0,0,0,0" /><S L="65" X="768" H="93" Y="175" T="1" P="0,0,0,0.2,0,0,0,0" /><S L="180" X="678" H="75" Y="205" T="1" P="0,0,0,0.2,-30,0,0,0" /><S L="20" X="559" H="194" Y="278" T="1" P="0,0,0,0.2,0,0,0,0" /><S L="20" X="471" H="129" Y="245" T="1" P="0,0,0,0.2,0,0,0,0" /></S><D><DS Y="295" X="39" /><F Y="371" X="705" /><P X="453" Y="386" T="4" P="0,0" /><P X="718" Y="281" T="58" P="0,0" /><P X="648" Y="280" T="58" P="0,0" /><P X="616" Y="280" T="58" P="0,0" /><P X="192" Y="380" T="1" P="0,0" /><P X="183" Y="388" T="5" P="0,0" /><P X="667" Y="377" T="55" P="0,0" /><P X="330" Y="87" T="64" P="0,0" /><P X="782" Y="376" T="62" P="0,0" /></D><O /></Z></C>

 
Championrs
« Citoyen »
1382924640000
    • Championrs#0000
    • Profil
    • Derniers messages
#36
  0
PLease add a !mort function
Theleetcoder
« Citoyen »
1382924880000
    • Theleetcoder#0000
    • Profil
    • Derniers messages
    • Tribu
#37
  0
Championrs a dit :
PLease add a !mort function

Fixed a bug when a new round start a dit :

function f(txt) -- just for readability
return string.format([[<font color="#89A7F5">%s</font>]], txt)
end

local welcome = string.format("<N>Hello there! %s is an unofficial minigame that can currently only be played in the tribe house. Please support %s!", f("#Iced"), f("#Iced"))
print(welcome) -- why though?

maps = { 4446887 }
players = {}

function getMouseCount()
local count = 0
for p in pairs(tfm.get.room.playerList) do
if not tfm.get.room.playerList

.isDead or players

.id then
count = count + 1
end
end
return count
end

function eventLoop(time,remaining)
local n = getMouseCount()
if remaining <= 0 or n == 0 then
newRound()
end
end

function newRound()
tfm.exec.newGame(maps[math.random(#maps)])
end

function eventNewGame()
tfm.exec.snow()
tfm.exec.setUIMapName(string.format("<N>Welcome to %s! Press %s to turn into an Ice Cube! Press %s to turn into an Ice Plank! Have fun! \n", f("#Iced"), f("Z"), f("X")))
for player in pairs(tfm.get.room.playerList) do
if player.isIced then
player.isIced = false
end
end
end

function eventNewPlayer(name)
ui.addTextArea(1, string.format("<p align='center'><b>%s</b></p>", welcome), name, 5, 25, 790, 25, nil, nil, 0)
tfm.exec.bindKeyboard(name, 87, true, true)
tfm.exec.bindKeyboard(name, 88, true, true)
players[name] = { timestamp = os.time(), isIced = false }
end

function eventKeyboard(name,key,down,x,y)
local p = players[name]
if p.timestamp < os.time() - 800 then
if not p.isIced then
p.isIced = true -- player is now iced.
tfm.exec.movePlayer(name, 400, -520, false, 0, 0, false) -- For avoid dead spamming.
local id = tfm.exec.addShamanObject((key == 87 and 54 or 45), x, y)
p.id = id
elseif p.id then
local x_ = tfm.get.room.objectList[p.id].x
if x_ == 0 then
tfm.exec.killPlayer(name)
else
p.isIced = false
tfm.exec.movePlayer(name, x_, tfm.get.room.objectList[p.id].y)
end
tfm.exec.removeObject(p.id)
p.id = nil
end
p.timestamp = os.time()
end
end


function main()
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.newGame(maps[math.random(#maps)])
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
end

main()

function eventPlayerWon(name)
players[name].id = nil
end

function eventPlayerGetCheese(name)
tfm.exec.playerVictory(name)
end

function eventChatCommand(name, command)
if command == "np" then
tfm.exec.newGame(maps[math.random(#maps)])
elseif command == "die" or command == "mort" or command == "kill" then
tfm.exec.killPlayer(name)
end
end


 
Mousechris
« Censeur »
1382930520000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#38
  0
put the old code back due to weird bugs that were hard to control and were map based
Theleetcoder
« Citoyen »
1382965620000
    • Theleetcoder#0000
    • Profil
    • Derniers messages
    • Tribu
#39
  0
Can I translate your post and post it to french forums? :)
Mousechris
« Censeur »
1382996220000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#40
  0
Theleetcoder a dit :
Can I translate your post and post it to french forums? :)

I'd rather not, let's just keep this minigame small untill there's more control, it's not like everything is ready fully yet
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Unofficial Module] #Iced!
« ‹ 2 / 9 › »
© Atelier801 2018

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

Version 1.27