×

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
  • /
  • [Semi-official] Flood
1 / 2 › »
[Semi-official] Flood
Natsmiro
« Citoyen »
1612463100000
    • Natsmiro#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  6
  • What is it?
  • Bug report and suggestions
Flood is a simple Minigame that consists of a Shaman chosen at random to build a structure to keep himself and the mices alive while the flood increases over time. If you touch the water, you will lose 1 life out of 5, and if you zero all lives you die.

But be careful! Sometimes some random events happen, try to survive them.

You can play by going in the room #flood.
Bugs
If you find a bug, you can report on this topic. Explain the bug in detail what happens and what happened before the bug happened.

Suggestions
On this topic, you can also make suggestions for improving the module. Explain in detail the suggestion and how it will benefit the module and the players.

Do you think that a suggestion is interesting? You can support by giving a heart to the message.

Dernière modification le 1615478040000
Nnaaaz
« Citoyen »
1612580100000
    • Nnaaaz#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  0
NICE GAME
King_seniru
« Censeur »
1612594080000
    • King_seniru#5890
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Nice one!
Natsmiro
« Citoyen »
1612653780000
    • Natsmiro#0000
    • Profil
    • Derniers messages
    • Tribu
#4
  0
I apologize for any bugs that have occurred, I believe that they are now fixed. To play the new version just enter the same link to copy the code.
Fem31415
« Citoyen »
1612674600000
    • Fem31415#9265
    • Profil
    • Derniers messages
    • Tribu
#5
  2
Your module was really fun to play! You should consider adding some other aspects, such as preventing the shaman from spawning objects after the flood starts, or having random objects fall down from the sky so it increases the difficulty of surviving :)

Dernière modification le 1612674660000
Hapiupvis
« Citoyen »
1612684860000
    • Hapiupvis#6840
    • Profil
    • Derniers messages
#6
  0
Hey, can you please put the script in a spoiler ? Pastebin it's not working for me. =(
https://i.imgur.com/DrQn8Gd.png
Fawn
« Consul »
1612699920000
    • Fawn#5789
    • Profil
    • Derniers messages
    • Tribu
#7
  1
Legend a dit :
Hey, can you please put the script in a spoiler ? Pastebin it's not working for me. =(
https://i.imgur.com/DrQn8Gd.png

Script below

-- configuration

-- default = 300
local gameTime = 300 -- in seconds
-- default = 60
local waterUpdateTime = 60 -- in seconds
-- default = {"@7820619"}
local maps = {"@7820619"}
-- default = 60
local buildTime = 60 -- in seconds
-- default = true
local enableShamanSkills = true
local language = "en"

-- end configuration

tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoScore(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disablePhysicalConsumables(true)
tfm.exec.disableAllShamanSkills(enableShamanSkills)
tfm.exec.disableAutoShaman(true)

local translations = {
br = {
startingFlood = "<R>Iniciando a inundação!</R>",
health = "Vida",
waterLevel = "Nível da água",
buildTime = "<J>O Shaman tem %d minuto(s) para construir uma estrutura.</J>",
welcome = "<J>Bem vindo ao <CH>Flood</CH>!\n\nSobreviva à água na estrutura contruída pelo Shaman até o fim da inundação!\nMinigame desenvolvido por Natsmiro#0000</J>"
},
en = {
startingFlood = "<R>Starting the flood!</R>",
health = "Health",
waterLevel = "Water level",
buildTime = "<J>The Shaman has %d minute(s) to build a structure.</J>",
welcome = "<J>Welcome to <CH>Flood</CH>!\n\nSurvive the water in the structure built by the Shaman until the end of the flood!\nMinigame developed by Natsmiro#0000</J>"
}
}

translations["pt"] = translations["br"]
translations = translations[language] or translations["en"]

local timer = {
timeouts = {},
intervals = {},
tempTimers = {},

setTimeout = function(self, callback, timeout)
self.timeouts[#self.timeouts + 1] = { c = callback, t = timeout}
end,
setInterval = function(self, callback, timeout)
local id = #self.intervals + 1

self.intervals[id] = { count = timeout, c = callback, t = timeout}

return id
end,
clearInterval = function(self, id)
if self.intervals[id] then
table.remove(self.intervals, id)
end
end
}

local level = 1
local shaman
local height = 0
local deathEnabled = false
local startedFlood = false
local endRound = false
local playersAlive = {}
local playersAliveCount = 0
local buildTimeRemaining = 0

function sendMessage(text, player)
if tfm.get.room.isTribeHouse then
if not player then
print(text)
end
else
tfm.exec.chatMessage(text, player)
end
end

function welcomeMessage(p)
sendMessage(string.format(translations["welcome"], math.floor(buildTime / 60)), p)
end

function setWater(level)
height = level * 50

tfm.exec.addPhysicObject(0, 800, 800 - height / 2, {
type = 9,
width = 4000,
height = height,
miceCollision = false,
groundCollision = false,
foreground = true
})

height = 800 - height

updateUIMapName()

if level >= 4 then
deathEnabled = false

timer:setTimeout(function()
deathEnabled = true
end, 2000)
end
end

function startRound()
level = 1
height = 0
deathEnabled = false
startedFlood = false
endRound = false
playersAlive = {}
playersAliveCount = 0
buildTimeRemaining = 0
timer.timeouts = {}
timer.intervals = {}
timer.toDelete = {}
timer.tempTimers = {}

ui.removeTextArea(0)
ui.removeTextArea(1)
ui.removeTextArea(2)
ui.removeTextArea(3)

local map = maps[math.random(#maps)]
tfm.exec.newGame(map)
tfm.exec.setGameTime(gameTime)

local playerList = {}

for playerName, player in next, tfm.get.room.playerList do
playerList[#playerList + 1] = player

if not playersAlive[playerName] then
playersAlive[playerName] = 5
end
end

playersAliveCount = #playerList

shaman = playerList[math.random(#playerList) or 1].playerName
tfm.exec.setShaman(shaman)
ui.setShamanName(shaman)

if tfm.get.room.playerList[shaman].shamanMode < 1 then
tfm.exec.setShamanMode(shaman, 1)
end

sendMessage(string.format(translations["buildTime"], math.floor(buildTime/60)))

updateUIMapName()
end

function isDrowning(p)
return tfm.get.room.playerList

and tfm.get.room.playerList

.y >= height
end

function updateHealthBar(p)
if playersAlive

then
local health = playersAlive


local barSize = (health/5)*150

ui.addTextArea(0, "", p, 400-150/2, 370, 150, 25, nil, nil, 0.5, true)
if barSize > 0 then
ui.addTextArea(1, "", p, 400-150/2, 370, barSize, 25, 0xfa3425, nil, 0.8, true)
else
ui.removeTextArea(1, p)
end
ui.addTextArea(2, "<font size=\"16\"><p align=\"center\">" .. translations["health"] .. ": " .. health .. "/5</p></font>", p, 400-150/2, 370, 150, 25, nil, nil, 0, true)
end
end

function updateUIMapName()
tfm.exec.setUIMapName("<CH>Flood</CH> <G>|</G> <N>" .. translations["waterLevel"] .. ":</N> <R>" .. level - 1 .. "</R>")
end

function updateAlives()
for playerName, player in next, tfm.get.room.playerList do
if player.isDead and playersAlive[playerName] then
playersAlive[playerName] = nil
playersAliveCount = playersAliveCount - 1
end
end
end

function showTimeRemaining()
local time = 0

if startedFlood then
local updateWaterTimer = timer.tempTimers.updateWater
if updateWaterTimer then
time = math.floor(timer.intervals[updateWaterTimer].count / 1000)
end
else
time = buildTimeRemaining
end

if (not startedFlood and time > 0 and time <= 60) or (time > 0 and time <= 10) then
ui.addTextArea(3, "<font size=\"26\"><p align=\"center\"><R>" .. time, nil, 400-50/2, 25, 40, 40, 1, 1, 0.7, true)
else
ui.removeTextArea(3)
end
end

function eventLoop(elapsedTime, remainingTime)
-- Timers
for k, v in ipairs(timer.timeouts) do
v.t = v.t - 500

if v.t <= 0 then
v.c()
timer.timeouts[k] = nil
end
end

for k, v in ipairs(timer.intervals) do
v.count = v.count - 500

if v.count <= 0 then
v.c()
v.count = v.t
end
end

-- Game
if elapsedTime >= buildTime * 1000 and not startedFlood and not endRound then
startedFlood = true
buildTimeRemaining = 0

sendMessage(translations["startingFlood"])
ui.removeTextArea(4)
elseif not startedFlood and not endRound then
buildTimeRemaining = math.floor(buildTime - elapsedTime / 1000)
end

if ((remainingTime > 0 and remainingTime <= 5000) or level >= 10) and not endRound then
deathEnabled = false

ui.removeTextArea(0)
ui.removeTextArea(1)
ui.removeTextArea(2)

if playersAliveCount > 0 then
for playerName, health in next, playersAlive do
tfm.exec.giveCheese(playerName)
tfm.exec.playerVictory(playerName)
end
end

startedFlood = false
endRound = true
elseif remainingTime <= 0 then
startRound()
else
if startedFlood then
if level <= 3 then -- starting flood
if not timer.tempTimers.startingFlood then
timer.tempTimers.startingFlood = timer:setInterval(function()
level = level + 1
setWater(level)
end, 5000)
end
else -- started flood
if timer.tempTimers.startingFlood then
timer:clearInterval(timer.tempTimers.startingFlood)
timer.tempTimers.startingFlood = nil
deathEnabled = true

for playerName, health in next, playersAlive do -- show health bar
updateHealthBar(playerName)
end
end

if not timer.tempTimers.updateWater then
timer.tempTimers.updateWater = timer:setInterval(function()
level = level + 1
setWater(level)
end, waterUpdateTime * 1000)
end
end

if not timer.tempTimers.drowningChecker then
timer.tempTimers.drowningChecker = timer:setInterval(function()
if deathEnabled then
for playerName, health in next, playersAlive do
if isDrowning(playerName) then
playersAlive[playerName] = playersAlive[playerName] - 1

updateHealthBar(playerName)

if playersAlive[playerName] <= 0 then
tfm.exec.killPlayer(playerName)
end

updateAlives()
end
end
end
end, 1000)
end
end
end

if not endRound then
showTimeRemaining()
else
ui.removeTextArea(3)
end
end

function eventSummoningEnd(p, objectType, xPosition, yPosition, angle, objectDescription)
if objectDescription.baseType == 28 then
tfm.exec.removeObject(objectDescription.id)
end
end

function eventPlayerDied(p)
ui.removeTextArea(0, p)
ui.removeTextArea(1, p)
ui.removeTextArea(2, p)

if playersAlive

then
playersAlive

= nil
playersAliveCount = playersAliveCount - 1
end

if playersAliveCount <= 0 or (p == shaman and not startedFlood and not endRound) then
tfm.exec.setGameTime(5)
end
end

eventPlayerLeft = eventPlayerDied
eventNewPlayer = welcomeMessage

for playerName, player in next, tfm.get.room.playerList do
tfm.exec.setPlayerScore(playerName, 0)
end

startRound()

welcomeMessage()

Natsmiro
« Citoyen »
1612706580000
    • Natsmiro#0000
    • Profil
    • Derniers messages
    • Tribu
#8
  2
Fem31415 a dit :
Your module was really fun to play! You should consider adding some other aspects, such as preventing the shaman from spawning objects after the flood starts, or having random objects fall down from the sky so it increases the difficulty of surviving :)

Yeah, a saw some suggestions while playing in a room, and the players suggested something like remove the shaman, object limit or objects disappearing over time, an anvil/cannon rain would also be nice.
Natsmiro
« Citoyen »
1613143260000
    • Natsmiro#0000
    • Profil
    • Derniers messages
    • Tribu
#9
  0
Update

- More bug fix
- Some code improvements
- Added water level limit. If the water level reaches 10, the players alive automatically win.

If you have the old code just copy the current code on the same link.

Dernière modification le 1613143380000
Natsmiro
« Citoyen »
1615479120000
    • Natsmiro#0000
    • Profil
    • Derniers messages
    • Tribu
#10
  1
Update

v1.0.0
- Now the module Flood is semi-official! You can play in the room #flood without having to run the script in the tribe.
- Added the command !help to inform new players.
- Added random events. Sometimes some random events can happen, from windstorms to anvil rain.

v1.1.0
- Bug fix.
- Now the water rises every 35 seconds instead of 1 minute.
- Added limit of objects. I noticed that the game was very easy, because of the players filling the map with boxes, so I put a limit.
Shun_kazami
« Citoyen »
1615858920000
    • Shun_kazami#7014
    • Profil
    • Derniers messages
    • Tribu
#11
  0
I have some suggestions to your module and some bugs that needs to be fixed:

  • You need to fix this problem: Sometimes the shaman can make grounds with red nails or something related.
    https://i.imgur.com/Ji4t6al.png
  • If possible, remove the ability of use hardmode on your module. A lot of shamans will only use this ability and spawn a lot of objects, removing the entire fun.
  • Also if possible, when the 1 minute timer of building ends, you can remove the shaman of the map (isn't needed to kill). It will make the module more harder.
  • And you can also limit the quantity of certain objects like boxes. Various shamans only will spawn 20 large boxes and this item is very unfair on a lot of scenarios.

  • But your module is very good. Thanks!
Clara
« Citoyen »
1616583300000
    • Clara#0416
    • Profil
    • Derniers messages
#12
  0
Hello I love your module very much :] But maybe you can fix this glitch/bug:

Sometimes at a random moment when I'm standing on the build, I go through the boxes slowly and end up in the water and die.

But excluding that glitch/bug I love your module very much again !
Natsmiro
« Citoyen »
1616620980000
    • Natsmiro#0000
    • Profil
    • Derniers messages
    • Tribu
#13
  0
Zipa10 a dit :
Hello I love your module very much :] But maybe you can fix this glitch/bug:

Sometimes at a random moment when I'm standing on the build, I go through the boxes slowly and end up in the water and die.

But excluding that glitch/bug I love your module very much again !

Unfortunately, I can't do anything about this, this is a sync problem. If the room sync lags, the objects may malfunction.

https://transformice.fandom.com/wiki/Sync
Miss_valentina
« Censeur »
1618559160000
    • Miss_valentina#5950
    • Profil
    • Derniers messages
    • Tribu
#14
  0
please delete the "Acid Rain", its too hard to survive when it starts and almost everybody hates it
Natsmiro
« Citoyen »
1618684260000
    • Natsmiro#0000
    • Profil
    • Derniers messages
    • Tribu
#15
  0
Miss_valentina a dit :
please delete the "Acid Rain", its too hard to survive when it starts and almost everybody hates it

Why? I think the idea of ​​Acid Rain is cool. I can shorten the spawn time to make it easier.
Xzowtx
« Citoyen »
1618688700000
    • Xzowtx#0000
    • Profil
    • Derniers messages
#16
  0
I like this module, is very funny!
Miss_valentina
« Censeur »
1618690560000
    • Miss_valentina#5950
    • Profil
    • Derniers messages
    • Tribu
#17
  0
Natsmiro a dit :
Miss_valentina a dit :
please delete the "Acid Rain", its too hard to survive when it starts and almost everybody hates it

Why? I think the idea of ​​Acid Rain is cool. I can shorten the spawn time to make it easier.

its hard cuz the acid falls too fast, i think its gonna be fine if u slow it down
Ttrgan
« Citoyen »
1619767140000
    • Ttrgan#6168
    • Profil
    • Derniers messages
    • Tribu
#18
  1
acid rain falls too fast and kills instantly imo it should only deal 2-3 hp damage
Miss_valentina
« Censeur »
1624300860000
    • Miss_valentina#5950
    • Profil
    • Derniers messages
    • Tribu
#19
  0
what happened to the module? i cant find that
Natsmiro
« Citoyen »
1624464960000
    • Natsmiro#0000
    • Profil
    • Derniers messages
    • Tribu
#20
  0
Miss_valentina a dit :
what happened to the module? i cant find that

Nothing? You can simply create a room by typing /room *#flood
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Semi-official] Flood
1 / 2 › »
© Atelier801 2018

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

Version 1.27