×

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
  • /
  • Atelier 801
  • /
  • Announcements
  • /
  • Documentation sur le LUA
  • Portugais (brésilien)
  • Arabe
  • Russe
  • Anglais
  • Croate
  • Italien
  • Français
  • Roumain
  • Hongrois
  • Espagnol
Documentação Luaمصادر الـ LuaLua документацияLua documentationLua dokumentacijaDocumentazione LUADocumentation sur le LUADocumentație LUALua dokumentációDocumentación Lua
Tigrounette
« Consul »
1380187980000
    • Tigrounette#0001
    • Profil
    • Derniers messages
    • Tribu
#1
  99
How to use LUA script

http://www.lua.org/docs.html

launch a script : type /lua in chat

You can only launch a lua script in your tribe house.

Want some help ? /chat lua

Dernière modification le 1402859820000
Tigrounette
« Consul »
1380187980000
    • Tigrounette#0001
    • Profil
    • Derniers messages
    • Tribu
#2
  91

Version 0.28



Changelog: https://atelier801.com/topic?f=5&t=451587&p=1#m19


Lua tree



_G
assert
bit32
    arshift
    band
    bnot
    bor
    btest
    bxor
    extract
    lrotate
    lshift
    replace
    rrotate
    rshift
coroutine
    create
    resume
    running
    status
    wrap
    yield
debug
    disableEventLog
    disableTimerLog
    getCurrentLuaThreadName
    traceback
error
getmetatable
ipairs
math
    abs
    acos
    asin
    atan
    atan2
    ceil
    cos
    cosh
    deg
    exp
    floor
    fmod
    frexp
    huge
    ldexp
    log
    max
    min
    modf
    pi
    pow
    rad
    random
    randomseed
    sin
    sinh
    sqrt
    tan
    tanh
next
os
    date
    difftime
    time
pairs
pcall
print
rawequal
rawget
rawlen
rawset
select
setmetatable
string
    byte
    char
    dump
    find
    format
    gmatch
    gsub
    len
    lower
    match
    rep
    reverse
    sub
    upper
system
    bindKeyboard
    bindMouse
    disableChatCommandDisplay
    exit
    giveEventGift
    loadFile
    loadPlayerData
    luaEventLaunchInterval
    newTimer
    removeTimer
    saveFile
    savePlayerData
table
    concat
    foreach
    foreachi
    insert
    pack
    remove
    sort
    unpack
tfm
    enum
      bonus
        point : 0
        speed : 1
        death : 2
        spring : 3
        booster : 5
        electricArc : 6
      emote
        dance : 0
        laugh : 1
        cry : 2
        kiss : 3
        angry : 4
        clap : 5
        sleep : 6
        facepaw : 7
        sit : 8
        confetti : 9
        flag : 10
        marshmallow : 11
        selfie : 12
        highfive : 13
        highfive_1 : 14
        highfive_2 : 15
        partyhorn : 16
        hug : 17
        hug_1 : 18
        hug_2 : 19
        jigglypuff : 20
        kissing : 21
        kissing_1 : 22
        kissing_2 : 23
        carnaval : 24
        rockpaperscissors : 25
        rockpaperscissors_1 : 26
        rockpaperscissor_2 : 27
      ground
        wood : 0
        ice : 1
        trampoline : 2
        lava : 3
        chocolate : 4
        earth : 5
        grass : 6
        sand : 7
        cloud : 8
        water : 9
        stone : 10
        snow : 11
        rectangle : 12
        circle : 13
        invisible : 14
        web : 15
        yellowGrass : 17
        pinkGrass : 18
        acid : 19
      particle
        whiteGlitter : 0
        blueGlitter : 1
        orangeGlitter : 2
        cloud : 3
        dullWhiteGlitter : 4
        heart : 5
        bubble : 6
        tealGlitter : 9
        spirit : 10
        yellowGlitter : 11
        ghostSpirit : 12
        redGlitter : 13
        waterBubble : 14
        plus1 : 15
        plus10 : 16
        plus12 : 17
        plus14 : 18
        plus16 : 19
        meep : 20
        redConfetti : 21
        greenConfetti : 22
        blueConfetti : 23
        yellowConfetti : 24
        diagonalRain : 25
        curlyWind : 26
        wind : 27
        rain : 28
        star : 29
        littleRedHeart : 30
        littlePinkHeart : 31
        daisy : 32
        bell : 33
        egg : 34
        projection : 35
        mouseTeleportation : 36
        shamanTeleportation : 37
        lollipopConfetti : 38
        yellowCandyConfetti : 39
        pinkCandyConfetti : 40
      shamanObject
        arrow : 0
        littleBox : 1
        box : 2
        littleBoard : 3
        board : 4
        ball : 6
        trampoline : 7
        anvil : 10
        cannon : 17
        bomb : 23
        orangePortal : 26
        blueBalloon : 28
        redBalloon : 29
        greenBalloon : 30
        yellowBalloon : 31
        rune : 32
        chicken : 33
        snowBall : 34
        cupidonArrow : 35
        apple : 39
        sheep : 40
        littleBoardIce : 45
        littleBoardChocolate : 46
        iceCube : 54
        cloud : 57
        bubble : 59
        tinyBoard : 60
        companionCube : 61
        stableRune : 62
        balloonFish : 65
        longBoard : 67
        triangle : 68
        sBoard : 69
        paperPlane : 80
        rock : 85
        pumpkinBall : 89
        tombstone : 90
        paperBall : 95
    exec
      addBonus
      addConjuration
      addImage
      addJoint
      addPhysicObject
      addShamanObject
      attachBalloon
      bindKeyboard
      changePlayerSize
      chatMessage
      disableAfkDeath
      disableAllShamanSkills
      disableAutoNewGame
      disableAutoScore
      disableAutoShaman
      disableAutoTimeLeft
      disableDebugCommand
      disableMinimalistMode
      disableMortCommand
      disablePhysicalConsumables
      disablePrespawnPreview
      disableWatchCommand
      displayParticle
      explosion
      freezePlayer
      getPlayerSync
      giveCheese
      giveConsumables
      giveMeep
      giveTransformations
      killPlayer
      linkMice
      lowerSyncDelay
      moveObject
      movePlayer
      newGame
      playEmote
      playerVictory
      removeBonus
      removeCheese
      removeImage
      removeJoint
      removeObject
      removePhysicObject
      respawnPlayer
      setAutoMapFlipMode
      setGameTime
      setNameColor
      setPlayerSync
      setPlayerScore
      setRoomMaxPlayers
      setRoomPassword
      setShaman
      setShamanMode
      setUIMapName
      setUIShamanName
      setVampirePlayer
      setWorldGravity
      snow
    get
      misc
        apiVersion : 0.28
        transformiceVersion : 6.09
      room
        community : -
        language : int
        isTribeHouse : false
        currentMap : 0
        maxPlayers : 50
        mirroredMap : false
        name : -
        objectList
          1
            angle : 0
            baseType : 2
            colors
              1
              2
              3
            ghost : false
            id : 1
            type : 203
            vx : 0
            vy : 0
            x : 400
            y : 200
        passwordProtected : false
        playerList
          Tigrounette
            cheeses : 0
            community : en
            gender : 0
            hasCheese : false
            id : 0
            inHardMode : 0
            isDead : true
            isFacingRight : true
            isInvoking : false
            isJumping : false
            isShaman : false
            isVampire : false
            language : int
            look : 1;0,0,0,0,0,0,0,0,0
            movingLeft : false
            movingRight : false
            playerName : Tigrounette#0001
            registrationDate : 0
            score : 0
            shamanMode : 0
            spouseId : 1
            spouseName : Pikashu#0095
            title : 0
            tribeId : 1234
            tribeName : Kikoo
            vx : 0
            vy : 0
            x : 0
            y : 0
        uniquePlayers : 1
        xmlMapInfo
          author : Tigrounette#0001
          mapCode : 184924
          permCode : 1
          xml : <C><P /><Z><S /><D /><O /></Z></C>
tonumber
tostring
type
ui
    addPopup
    addTextArea
    removeTextArea
    setBackgroundColor
    setMapName
    setShamanName
    showColorPicker
    updateTextArea
xpcall

Dernière modification le 1643407800000
Pikashu
« Consul »
1446120300000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#3
  84

Events



• eventChatCommand ( playerName, command )
 This event is triggered when a player uses a chat command (a message beginning with « ! »).
 Arguments:
  - playerName (String) : the player who sent the command
  - command (String) : the message (without the initial « ! »)




• eventChatMessage ( playerName, message )
 This event is triggered when a player talks in the room chat.
 Arguments:
  - playerName (String) : the player who sent the message
  - message (String) : the message




• eventContactListener ( playerName, groundId, contactInfo )
 This event is triggered when a player hits a ground with a contact listener.
 Arguments:
  - playerName (String) : the player who hit the ground
  - groundId (Int) : the ground identifier
  - contactInfo (Table) : Collision informations
   - contactX (Int), contactY (Int), playerX (Int), playerY (Int), speedX (Int), speedY (Int)




• eventEmotePlayed ( playerName, emoteType, emoteParam )
 This event is triggered when the player does an emote.
 Arguments:
  - playerName (String) : the player who did the emote
  - emoteType (Int) : the type of emote played
  - emoteParam (String) : the parameter used with the emote (only applies to the flag one)




• eventFileLoaded ( fileNumber, fileData )
 This event is triggered when a file gets fully loaded.
 Arguments:
  - fileNumber (String) : the file identifier
  - fileData (String) : the file data




• eventFileSaved ( fileNumber )
 This event is triggered when a file gets saved.
 Arguments:
  - fileNumber (String) : the name of the file




• eventKeyboard ( playerName, keyCode, down, xPlayerPosition, yPlayerPosition )
 This event is triggered when a player presses a key.
 Arguments:
  - playerName (String) : the player who typed the key
  - keyCode (Int) : the code of the typed key
  - down (Boolean) : whether it was the press event, or the release one
  - xPlayerPosition (Int) : the horizontal coordinate of the player when he or she typed the key
  - yPlayerPosition (Int) : the vertical coordinate of the player when he or she typed the key




• eventMouse ( playerName, xMousePosition, yMousePosition )
 This event is triggered when a player perfoms a mouse click.
 Arguments:
  - playerName (String) : the player who made the click
  - xMousePosition (Int) : the horizontal coordinate of the mouse click
  - yMousePosition (Int) : the vertical coordinate of the mouse click




• eventLoop ( elapsedTime, remainingTime )
 This event occurs every 500 milliseconds.
 Arguments:
  - elapsedTime (Int) : the time in milliseconds elapsed since the beginning of the round
  - remainingTime (Int) : the time in milliseconds remaining before the next round




• eventNewGame ()
 This event is triggered when a new round begins.



• eventNewPlayer ( playerName )
 This event is triggered when a new player joins the room.
 Arguments:
  - playerName (String) : the player who joined the room




• eventPlayerDataLoaded ( playerName, playerData )
 This event is triggered when player data gets loaded.
 Arguments:
  - playerName (String) : the player whose data got loaded
  - playerData (String) : the data about the player




• eventPlayerDied ( playerName )
 This event is triggered when a player dies.
 Arguments:
  - playerName (String) : the player who died




• eventPlayerGetCheese ( playerName )
 This event is triggered when a player gets the cheese.
 Arguments:
  - playerName (String) : the player who got the cheese




• eventPlayerBonusGrabbed ( playerName, bonusId )
 This event is triggered when a player grabs a bonus of type 0 (point).
 Arguments:
  - playerName (String) : the player who grabbed the bonus
  - bonusId (Int) : bonus identifier (if the bonus belongs to the map, this will be 0)




• eventPlayerLeft ( playerName )
 This event is triggered when a player leaves the room.
 Arguments:
  - playerName (String) : the player who left the room




• eventPlayerVampire ( playerName, vampire )
 This event is triggered when a player turns into a vampire.
 Arguments:
  - playerName (String) : the player who turned into a vampire
  - vampire (String) : the vampire who contamined the player (or nil if it hasn't been contamined by another player)




• eventPlayerWon ( playerName, timeElapsed, timeElapsedSinceRespawn )
 This event triggers when a player enters the hole.
 Arguments:
  - playerName (String) : the player who entered the hole
  - timeElapsed (Int) : the time in milliseconds elapsed since the beginning of the round
  - timeElapsedSinceRespawn (Int) : the time in milliseconds elapsed since the last respawn




• eventPlayerRespawn ( playerName )
 This event is triggered when a player respawns.
 Arguments:
  - playerName (String) : the player who respawned




• eventPlayerMeep ( playerName, xPosition, yPosition )
 This event is triggered when a player meeps.
 Arguments:
  - playerName (String) : the player who meeped
  - xPosition (Int) : the horizontal coordinate of the player when they meeped
  - yPosition (Int) : the vertical coordinate of the player when they meeped




• eventPopupAnswer ( popupId, playerName, answer )
 This event is triggered when a player answers a popup (only type 1 and 2 popups).
 Arguments:
  - popupId (Int) : the popup identifier
  - playerName (String) : the player who answered the popup
  - answer (String) : the player's answer
   - yes or no for a type 1 popup
   - any string for a type 2 poup




• eventSummoningStart ( playerName, objectType, xPosition, yPosition, angle )
 This event is triggered when a player starts summoning a shaman object.
 Arguments:
  - playerName (String) : the player who started summoning
  - objectType (Int) : the kind of shaman object being summoned
  - xPosition (Int) : the horizontal coordinate of the summoning point
  - yPosition (Int) : the vertical coordinate of the summoning point
  - angle (Int) : the rotation angle of the object being summoned




• eventSummoningCancel ( playerName )
 This event is triggered when a player cancels an object invocation.
 Arguments:
  - playerName (String) : the player who stopped summoning




• eventSummoningEnd ( playerName, objectType, xPosition, yPosition, angle, objectDescription )
 This event triggers when a player has finished an invocation.
 Arguments:
  - playerName (String) : the player who summoned the object
  - objectType (Int) : the kind of the object
  - xPosition (Int) : the horizontal position of the summoned object
  - yPosition (Int) : the vertical position of the summoned object
  - angle (Int) : the rotation angle of the summoned object
  - objectDescription (Table) : the object table description as it would appear in the room's objectList




• eventTalkToNPC ( playerName, npcName )
 This event is triggered when a player clicks in an interactive NPC.
 Arguments:
  - playerName (String) : the name of the player who clicked the NPC
  - npcName (String) : the name of the NPC




• eventTextAreaCallback ( textAreaId, playerName, eventName )
 This event is triggered when a player clicks a text event.
 Text event links are anchors tags links beginning with the "event:" string (e.g. : <a href="event:callbackString">Click here</a>).
 If the link eventName begins with '#clear,' the text area will be cleared, and the received eventName will be the text following the coma.

 Arguments:
  - textAreaId (Int) : the text area identifier
  - playerName (String) : the player who clicked
  - eventName (String) : the name of the clicked text event




• eventColorPicked ( colorPickerId, playerName, color )
 This event is triggered when a player chooses a color with a color picker.
 Arguments:
  - colorPickerId (Int) : the color picker identifier
  - playerName (String) : the player who picked a color
  - color (Int) : the color picked (-1 if the player didn't pick one))

Dernière modification le 1647124860000
Pikashu
« Consul »
1446125520000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#4
  80

Functions



• debug.disableEventLog ( activate )
 Deactivates the events log.
 Parameters:
  - activate (Boolean) : whether it should be active (default value = true)






• system.bindKeyboard ( playerName, keyCode, down, activate )
 Listens to the player's keyboard events.
 Parameters:
  - playerName (String) : the player you want to listen keyboard events from
  - keyCode (Int) : the code of the key you want to listen
   - to accurately listen for player movement (both arrows and wasd/zqsd keys), you can use 0 (left), 1 (up), 2 (right) or 3 (down)
   - regular AS3 keycodes can be found on Adobe website
  - down (Boolean) : whether it should listen for the press event, or the release one
  - activate (Boolean) : whether it should be active (default value = true)




• system.bindMouse ( playerName, active )
 Listens to a player's mouse events.
 Parameters:
  - playerName (String) : the player you want to listen mouse events from
  - active (Boolean) : whether it should be active (default value = true)




• system.disableChatCommandDisplay ( command, hide )
 Prevents a module command (commands starting with « ! ») to be displayed in the room. If the supplied command is nil, the parameter will apply to all the commands.
 Parameters:
  - command (String) : the command (without the initial « ! ») to hide (default value = nil)
  - hide (Boolean) : whether the command should be hided (default value = true)




• system.exit ()
 Deactivates the lua script running.



• system.giveEventGift ( playerName, giftCode )
 Gives an event reward to the targeted player.
 Parameters:
  - playerName (String) : the player to give the gift to
  - giftCode (String) : the gift identifier (given by an admin)




• system.loadFile ( fileNumber )
 Requests the loading of a data file. The event eventFileLoaded is triggered when the file gets loaded.
 Parameters:
  - fileNumber (Int) : the identifier of the file to load (default value = 0)

 Returns: (Boolean) whether the loading got started



• system.loadPlayerData ( playerName )
 Requests the loading of the player's data for this module. The event eventPlayerDataLoaded is triggered when the player data gets loaded.
 Parameters:
  - playerName (String) : the player about whom you want to get the data

 Returns: (Boolean) whether the loading got started



• system.luaEventLaunchInterval ( interval, random )
 Gets or sets the timer interval between two Lua events.
 Parameters:
  - interval (Int) : timer interval in minutes (default value = 40)
  - random (Int) : random added interval in minutes (default value = 20)

 Returns: (Table) current interval settings



• system.newTimer ( callback, time, loop, arg1, arg2, arg3, arg4 )
 Creates a new timer to call a function after a delay, once or continuously.
 Parameters:
  - callback (Function) : The function to call
  - time (Int) : the number of milliseconds that the function call should be delayed by
  - loop (Boolean) : whether the function call should loop or happen only once (default value = false)
  - arg1 (Object) : 1st argument of the callback function (default value = nil)
  - arg2 (Object) : 2nd argument of the callback function (default value = nil)
  - arg3 (Object) : 3rd argument of the callback function (default value = nil)
  - arg4 (Object) : 4th argument of the callback function (default value = nil)

 Returns: (Int) the new timer id



• system.removeTimer ( timerId )
 Destroys a timer.
 Parameters:
  - timerId (Int) : the identifier of the timer to stop




• system.saveFile ( data, fileNumber )
 Requests the saving of a data file (throttled to one per minute). The event eventFileSaved is triggered when the file get saved.
 Parameters:
  - data (String) : the data to store in the file
  - fileNumber (Int) : the identifier (from 0 to 99) of the file to write the data in (default value = 0)

 Returns: (Boolean) whether the saving got started



• system.savePlayerData ( playerName, data )
 Saves module data about a player. Please note that this data is per player and per Lua dev, so take care not to overwrite data from another one of your modules.
 Parameters:
  - playerName (String) : the player about whom you want to save data
  - data (String) : the player data to save




• system.setLuaEventBanner ( bannerId )
 Sets the event banner in the login page.
 Parameters:
  - bannerId (Number) : the banner id




• tfm.exec.addBonus ( type, x, y, id, angle, visible, targetPlayer )
 Adds a defilante bonus to the map, and if it is of type 0 (point), it will trigger eventPlayerBonusGrabbed when someone grabs it.
 Parameters:
  - type (Int) : Bonus type (see tfm.enum.bonus) (default value = 1)
  - x (Int) : X position. (default value = 0)
  - y (Int) : Y position. (default value = 0)
  - id (Int) : Identifier. (default value = 0)
  - angle (Int) : Angle (deg). (default value = 0)
  - visible (Boolean) : Make the bonus visible or not. (default value = true)
  - targetPlayer (String) : Send only to this specific player. (default value = nil)




• tfm.exec.addConjuration ( xPosition, yPosition, duration )
 Adds conjuration to the map. Note: Grid coordinate are regular coordinate divided by 10 (as conjuration is a 10x10 pixel square).
 Parameters:
  - xPosition (Int) : the horizontal grid coordinate of the conjuration
  - yPosition (Int) : the vertical grid coordinate of the conjuration
  - duration (Int) : the duration of the conjuration in milliseconds (default value = 10000)




• tfm.exec.addImage ( imageId, target, xPosition, yPosition, targetPlayer, scaleX, scaleY, angle, alpha, anchorX, anchorY )
 Displays an image on the map.
 Parameters:
  - imageId (String) : the image identifier
  - target (String) : the game element to attach the image to
   - #mobileId (with the object sprite removed)
   - $playerName (on the mouse sprite)
   - %playerName (with the mouse sprite removed)
   - ?backgroundLayerDepth
   - _groundLayerDepth
   - !foregroundLayerDepth
   - &fixedLayerDepthBeforeLuaInterfaces
   - :fixedLayerDepthBehindLuaInterfaces
   - +physicObjectID
   - ~interfaceLayerDepth
   - =mobileId (on the object sprite)
  - xPosition (Int) : the horizontal offset of the top-left corner of the image (0 being the middle of the game element) (default value = 0)
  - yPosition (Int) : the vertical offset of the top-left corner of the image (0 being the middle of the game element) (default value = 0)
  - targetPlayer (String) : the player who will see the image (if nil, applies to all players) (default value = nil)
  - scaleX (Number) : the X (width) scale of the image (default value = 1)
  - scaleY (Number) : the Y (height) scale of the image (default value = 1)
  - angle (Number) : the angle of the image (in radians) (default value = 0)
  - alpha (Number) : the image opacity (default value = 1)
  - anchorX (Number) : The horizontal anchor in which the image's angle will use. (from -1 to 1, 0.5 being the center) (default value = 0)
  - anchorX (Number) : The vertical anchor in which the image's angle will use. (from -1 to 1, 0.5 being the center) (default value = 0)

 Returns: (Int) the image identifier



• tfm.exec.addJoint ( id, ground1, ground2, jointDef )
 Adds a joint between two physic objects. . Note: In map XML codes, you can also add a « lua="id" » property in a joint definition to be able to interact with it with Lua code.
 Parameters:
  - id (Int) : the identifier of the joint
  - ground1 (Int) : the first ground the joint will affect
  - ground2 (Int) : the second ground the joint will affect
  - jointDef (Table) : the ground description
   - type (Int): 0 -> distance joint, 1 -> prismatic joint, 2 -> pulley joint, 3 -> revolute joint
   - point1 (String "x,y"): location of the ground1 anchor (default: the ground1's center)
   - point2 (String "x,y"): location of the ground2 anchor (default: the ground2's center), only used with distance and pulley joints
   - point3 (String "x,y"), point4 (String "x,y"): locations of the pulley's anchors, only used with pulley joints
   - frequency (Float), damping (Float): distance joints' frequency and damping ratio
   - axis (String "x,y"), angle (Int): prismatic joints' axis and angle
   - limit1 (Float), limit2 (Float), forceMotor (Float), speedMotor (Float): prismatic and revolute joints' translation/rotation limits and motors
   - ratio (Float): revolute joints' ratio
   - line (Int), color (Int), alpha (Float), foreground (Boolean): if none of these properties is defined, the joint won't be drawn




• tfm.exec.addNPC ( npcName, npcDef )
 Places a NPC in the map.
 Parameters:
  - npcName (String) : the name of the NPC
  - npcDef (Table) : the NPC description
   - title (Int), look (String), x (Int), y (Int), female (Boolean), lookLeft (Boolean), lookAtPlayer (Boolean), interactive (Boolean)




• tfm.exec.addPhysicObject ( id, xPosition, yPosition, bodyDef )
 Spawns a ground.
 Parameters:
  - id (Int) : the identifier of the physic object
  - xPosition (Int) : the horizontal coordinate of the center of the ground
  - yPosition (Int) : the vertical coordinate of the center of the ground
  - bodyDef (Table) : the ground description
   - type (Int), width (Int), height (Int), foreground (Boolean), friction (Float), restitution (Float), angle (Int), color (Int), miceCollision (Boolean), groundCollision (Boolean)
   - dynamic (Boolean), fixedRotation (Boolean), mass (Int), linearDamping (Float), angularDamping (Float) for dynamic grounds




• tfm.exec.addShamanObject ( objectType, xPosition, yPosition, angle, xSpeed, ySpeed, ghost, options )
 Spawns a shaman object.
 Parameters:
  - objectType (Int) : the type of the shaman object to spawn
  - xPosition (Int) : the horizontal position of the spawn
  - yPosition (Int) : the vertical position of the spawn
  - angle (Int) : the rotation angle of the object, in degrees (default value = 0)
  - xSpeed (Int) : the horizontal speed of the object (default value = 0)
  - ySpeed (Int) : the vertical speed of the object (default value = 0)
  - ghost (Boolean) : whether the spawned object should be transparent (default value = false)
  - options (Table) : the object description
   - fixedXSpeed (Number), fixedYSpeed (Number)

 Returns: (Int) the shaman object identifier



• tfm.exec.attachBalloon ( playerName, isAttached, colorType, ghost, , speed )
 Attaches a balloon to player.
 Parameters:
  - playerName (String) : the player's nickname
  - isAttached (Boolean) : whether the balloon should be attached or detached from the player (default value = true)
  - colorType (Int) : the color type of the balloon [1-4] (default value = 1)
  - ghost (Boolean) : whether the spawned balloon should be transparent (default value = false)
  - speed (Number) : the vertical speed of the balloon. (default value = 1)




• tfm.exec.changePlayerSize ( playerName, size )
 Changes the size of a player.
 Parameters:
  - playerName (String) : the player's nickname
  - size (Number) : the new size of the player (between 0.1 and 5) (default value = 1)




• tfm.exec.chatMessage ( message, playerName )
 Displays a chat message.
 Parameters:
  - message (String) : the chat message to display
  - playerName (String) : the player who will get the message (if nil, applies to all players) (default value = nil)




• tfm.exec.disableAfkDeath ( activate )
 Deactivates the automatic afk death.
 Parameters:
  - activate (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disableAllShamanSkills ( active )
 Deactivates all shaman skills.
 Parameters:
  - active (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disableAutoNewGame ( activate )
 Deactivates the automatic renewal of rounds.
 Parameters:
  - activate (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disableAutoScore ( activate )
 Deactivates the automatic scoring management.
 Parameters:
  - activate (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disableAutoShaman ( activate )
 Deactivates the automatic selection of shaman.
 Parameters:
  - activate (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disableAutoTimeLeft ( activate )
 Deactivates the automatic remaining time change to 20s (when the shaman dies for example).
 Parameters:
  - activate (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disableDebugCommand ( activate )
 Disables the effects of the /debug command.
 Parameters:
  - activate (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disableMinimalistMode ( activate )
 Disables the minimalist mode.
 Parameters:
  - activate (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disableMortCommand ( activate )
 Disables the /mort command.
 Parameters:
  - activate (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disablePhysicalConsumables ( active )
 Deactivates physical consumables (like in racing and bootcamp rooms).
 Parameters:
  - active (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.disablePrespawnPreview ( display )
 Enables or disables the shaman objects prespawn preview.
 Parameters:
  - display (Boolean) : whether the prespawn preview should not be displayed (default value = true)




• tfm.exec.disableWatchCommand ( activate )
 Disables the effects of the /watch command.
 Parameters:
  - activate (Boolean) : whether the deactivation should be active (default value = true)




• tfm.exec.displayParticle ( particleType, xPosition, yPosition, xSpeed, ySpeed, xAcceleration, yAcceleration, targetPlayer )
 Displays a particle.
 Parameters:
  - particleType (Int) : the kind of particle you want to display
  - xPosition (Int) : the horizontal coordinate of the particle
  - yPosition (Int) : the vertical coordinate of the particle
  - xSpeed (Number) : the horizontal speed of the particle (default value = 0)
  - ySpeed (Number) : the vertical speed of the particle (default value = 0)
  - xAcceleration (Number) : the horizontal acceleration of the particle (default value = 0)
  - yAcceleration (Number) : the vertical acceleration of the particle (default value = 0)
  - targetPlayer (String) : the player who should see the particle (if nil, applies to all players) (default value = nil)




• tfm.exec.explosion ( xPosition, yPosition, power, radius, miceOnly )
 Throws an explosion.
 Parameters:
  - xPosition (Int) : the horizontal coordinate of the center of the explosion
  - yPosition (Int) : the vertical coordinate of the center of the explosion
  - power (Int) : the maximum power of the explosion
  - radius (Int) : the explosion radius (players further away won't be affected)
  - miceOnly (Boolean) : whether the explosion should affect only mice, or objects too (default value = false)




• tfm.exec.freezePlayer ( playerName, freeze, displayIce )
 Freezes a player.
 Parameters:
  - playerName (String) : the player who is going to be frozen
  - freeze (Boolean) : if the player should be frozen (default value = true)
  - displayIce (Boolean) : if the ice image should be displayed on the player (default value = true)




• tfm.exec.getPlayerSync ( )
 Gets the room's sync player.



• tfm.exec.giveCheese ( playerName )
 Gives the cheese to a player.
 Parameters:
  - playerName (String) : the player who should get the cheese




• tfm.exec.giveConsumables ( playerName, consumableId, amount )
 Gives consumables to the targeted player.
 Parameters:
  - playerName (String) : the player to give the gift to
  - consumableId (String) : the consumable identifier
  - amount (String) : the amount of consumables to give (default value = "1")




• tfm.exec.giveMeep ( playerName, canMeep )
 Gives the meep competence to a player, or removes it.
 Parameters:
  - playerName (String) : the player's nickname
  - canMeep (Boolean) : whether the player should be able to meep (default value = true)




• tfm.exec.giveTransformations ( playerName, canTransform )
 Gives the transformations to a player, or removes them.
 Parameters:
  - playerName (String) : the player's nickname
  - canTransform (Boolean) : whether the player should be able to use transformations (default value = true)




• tfm.exec.killPlayer ( playerName )
 Kills the selected player.
 Parameters:
  - playerName (String) : the player to kill




• tfm.exec.linkMice ( playerName1, playerName2, linked )
 Allows to link players like in soulmate maps.
 Parameters:
  - playerName1 (String) : the first player's nickname
  - playerName2 (String) : the second player's nickname
  - linked (Boolean) : whether the two players should be linked (default value = true)




• tfm.exec.lowerSyncDelay ( playerName )
 Lowers the synchronization delay of a player to 400ms max
 Parameters:
  - playerName (String) : the player who should have a lower sync delay




• tfm.exec.moveObject ( objectId, xPosition, yPosition, positionOffset, xSpeed, ySpeed, speedOffset, angle, angleOffset )
 Defines the speed and position of a shaman object.
 Parameters:
  - objectId (Int) : the shaman object identifier
  - xPosition (Int) : the horizontal coordinate of the point where the object will be moved
  - yPosition (Int) : the vertical coordinate of the point where the object will be moved
  - positionOffset (Boolean) : whether the specified position is an offset to apply to the current one, or the absolute one (default value = false)
  - xSpeed (Int) : the horizontal coordinate of the speed to give to the object (default value = 0)
  - ySpeed (Int) : the vertical coordinate of the speed to give to the object (default value = 0)
  - speedOffset (Boolean) : whether the specified speed is an offset to apply to the current one, or the absolute one (default value = false)
  - angle (Int) : the angle of the the object (default value = 0)
  - angleOffset (Boolean) : whether the specified angle is an offset to apply to the current one, or the absolute one (default value = false)




• tfm.exec.movePlayer ( playerName, xPosition, yPosition, positionOffset, xSpeed, ySpeed, speedOffset )
 Defines the speed and position of a player.
 Parameters:
  - playerName (String) : the player to move
  - xPosition (Int) : the horizontal coordinate of the point where the player will be moved
  - yPosition (Int) : the vertical coordinate of the point where the player will be moved
  - positionOffset (Boolean) : whether the specified position an offset to apply to the current one, or the absolute one (default value = false)
  - xSpeed (Int) : the horizontal coordinate of the speed to give to the player (default value = 0)
  - ySpeed (Int) : the vertical coordinate of the speed to give to the player (default value = 0)
  - speedOffset (Boolean) : whether the specified speed an offset to apply to the current one, or the absolute one (default value = false)




• tfm.exec.newGame ( mapCode, flipped )
 Starts a new game
 Parameters:
  - mapCode (String) : the map code (default value = nil)
   - nil (a random map)
   - 6 (vanilla map)
   - @42583 (editor map)
   - #4 (perm category map)
   - anything beginning with '&lt;' (xml map)
  - flipped (Boolean) : whether the map should be flipped (default value = nil (randomly mirrored in racing and bootcamp rooms, unless))




• tfm.exec.playEmote ( playerName, emoteId, emoteArg )
 Makes a player do an emote.
 Parameters:
  - playerName (String) : the player who should do the emote
  - emoteId (Int) : the emote to do
  - emoteArg (String) : the emote attribute (for the flag emote for example) (default value = nil)




• tfm.exec.playerVictory ( playerName )
 Makes a player enter the hole. It only works if the player already has a cheese!
 Parameters:
  - playerName (String) : the player who should win




• tfm.exec.removeBonus ( id, targetPlayer )
 Removes a bonus previously spawned with tfm.exec.addBonus
 Parameters:
  - id (Int) : Identifier. (default value = 0)
  - targetPlayer (String) : Send only to this specific player. (default value = nil)




• tfm.exec.removeCheese ( playerName )
 Takes away the cheese from a player.
 Parameters:
  - playerName (String) : the player who should get their cheese removed




• tfm.exec.removeImage ( imageId )
 Removes an image.
 Parameters:
  - imageId (Int) : the image identifier




• tfm.exec.removeJoint ( id )
 Removes a joint from the game.
 Parameters:
  - id (Int) : the identifier of the joint to remove




• tfm.exec.removeObject ( objectId )
 Removes a shaman object.
 Parameters:
  - objectId (Int) : the shaman object identifier




• tfm.exec.removePhysicObject ( id )
 Removes a ground from the game.
 Parameters:
  - id (Int) : the identifier of the ground to remove




• tfm.exec.respawnPlayer ( playerName )
 Respawns a player.
 Parameters:
  - playerName (String) : the player to respawn




• tfm.exec.setAieMode ( enable, sensibility, targetPlayer )
 Enables the AIE mode (when mice die when they hit something too hard). Lasts until the next map.
 Parameters:
  - enable (Boolean) : whether the AIE mode should be enabled (default value = true)
  - sensibility (Number) : sensibility of the AIE mode (default value = 1)
  - targetPlayer (String) : the player in which the AIE mode should be enabled to (default value = nil)




• tfm.exec.setAutoMapFlipMode ( flipped )
 Sets whether the following maps should be flipped (always, never, or TFM's default behaviour).
 Parameters:
  - flipped (Boolean) : whether the maps should be flipped (default value = nil (the default TFM behaviour))




• tfm.exec.setGameTime ( time, init )
 Sets the game remaining time.
 Parameters:
  - time (Int) : the remaining time in seconds
  - init (Boolean) : whether the remaining time should change even if the specified remaining time is higher than the current one (default value = true)




• tfm.exec.setNameColor ( playerName, color )
 Changes a player's nickname's color.
 Parameters:
  - playerName (String) : the player whose nickname should be colored
  - color (Int) : the color of the nickname




• tfm.exec.setPlayerGravityScale ( playerName, gravityScale )
 Sets the world's gravity scale for a player.
 Parameters:
  - playerName (String) : the player who should get their gravity changed
  - gravityScale (Number) : the gravity scale (default value = 1)




• tfm.exec.setPlayerNightMode ( enable, playerName )
 Enables the night mode for a player.
 Parameters:
  - enable (Boolean) : whether the night mode should be enabled (default value = true)
  - playerName (String) : the player whom should have the night mode enabled (default value = nil)




• tfm.exec.setPlayerScore ( playerName, score, add )
 Sets the player's score.
 Parameters:
  - playerName (String) : the player who should get his or her score changed
  - score (Int) : the score
  - add (Boolean) : whether the current score should be added to the specified one (default value = false)




• tfm.exec.setPlayerSync ( playerName )
 Defines the new room's sync player.
 Parameters:
  - playerName (String) : the username of the player who is going to be the sync. Use nil for the server to choose.




• tfm.exec.setRoomMaxPlayers ( maxPlayers )
 Sets the max number of players in a room.
 Parameters:
  - maxPlayers (Int) : the maximum number of players the room can hold




• tfm.exec.setRoomPassword ( password )
 Password-protects a room.
 Parameters:
  - password (String) : the string to set as the password (an empty string removes the protection)




• tfm.exec.setShaman ( playerName, makeAShaman )
 Makes a player a shaman.
 Parameters:
  - playerName (String) : the player who should become a shaman
  - makeAShaman (Boolean) : whether the player should be a shaman (default value = true)




• tfm.exec.setShamanMode ( playerName, mode )
 Changes the shaman mode of a player.
 Parameters:
  - playerName (String) : the player's nickname who will have another shaman mode
  - mode (Int) : the new shaman mode of the target (use nil to use the player's real mode) (default value = nil)




• tfm.exec.setVampirePlayer ( playerName, makeAVampire )
 Makes a player a vampire.
 Parameters:
  - playerName (String) : the player to make a vampire
  - makeAVampire (Boolean) : whether the player should be a vampire (default value = true)




• tfm.exec.setWorldGravity ( x, y )
 Allows you to change the world forces on the x axis (wind) and on the y axis (gravity).
 Parameters:
  - x (Int) : force on the x axis (wind) (default value = 0)
  - y (Int) : force on the y axis (gravity) (default value = 10)




• tfm.exec.snow ( duration, snowballPower )
 Makes the snow fall.
 Parameters:
  - duration (Int) : the snowfall duration in seconds (default value = 60)
  - snowballPower (Int) : (default value = 10)






• ui.addPopup ( id, type, text, targetPlayer, x, y, width, fixedPos )
 Displays a popup.
 Parameters:
  - id (Int) : the identifier of the popup
  - type (Int) : the popup type (0 for simple, 1 for yes or no, 2 for player input)
  - text (String) : the text to display
  - targetPlayer (String) : the player who will see the popup (if nil, applies to all players)
  - x (Int) : the horizontal coordinate of the top-left corner (default value = 50)
  - y (Int) : the vertical coordinate of the top-left corner (default value = 50)
  - width (Int) : the width in pixels of the popup (if 0, it will be ajusted to the text width) (default value = 0)
  - fixedPos (Boolean) : whether the position is fixed or if it should follow the player's camera on long maps (default value = false)




• ui.addTextArea ( id, text, targetPlayer, x, y, width, height, backgroundColor, borderColor, backgroundAlpha, fixedPos )
 Displays a text area.
 Parameters:
  - id (Int) : the identifier of the text area
  - text (String) : the text to display
  - targetPlayer (String) : the player who will see the text area (if nil, applies to all players) (default value = nil)
  - x (Int) : the horizontal coordinate of the top-left corner (default value = 50)
  - y (Int) : the vertical coordinate of the top-left corner (default value = 50)
  - width (Int) : the width in pixels of the text area (if 0, it will be ajusted to the text width) (default value = 0)
  - height (Int) : the height in pixels of the text area (if 0, it will be ajusted to the text height) (default value = 0)
  - backgroundColor (Int) : the background color of the text area (default value = 0x324650)
  - borderColor (Int) : the border color of the text area (default value = 0)
  - backgroundAlpha (Number) : the background's opacity, from 0 (transparent) to 1 (opaque) (default value = 1)
  - fixedPos (Boolean) : whether the position is fixed or if it should follow the player's camera on long maps (default value = false)




• ui.removeTextArea ( id, targetPlayer )
 Removes a text area.
 Parameters:
  - id (Int) : the identifier of the text area
  - targetPlayer (String) : the player whom the text area will disappear (if nil, applies to all players) (default value = nil)




• ui.setBackgroundColor ( color )
 Sets the background color. Lasts one map.
 Parameters:
  - color (String) : the background color (default value = #6A7495)




• ui.setMapName ( text )
 Sets the map name.
 Parameters:
  - text (String) : the text to display as the map name




• ui.setShamanName ( text )
 Sets the shaman name.
 Parameters:
  - text (String) : the text to display as the shaman name




• ui.showColorPicker ( id, targetPlayer, defaultColor, title )
 Displays a color picker.
 Parameters:
  - id (Int) : the identifier of the color picker
  - targetPlayer (String) : the player who will see the color picker (if nil, applies to all players) (default value = nil)
  - defaultColor (Int) : the default color on the color picker (default value = 0)
  - title (String) : the title of the color picker (default value = nil)




• ui.updateTextArea ( id, text, targetPlayer )
 Updates the content of a text area.
 Parameters:
  - id (Int) : the identifier of the text area
  - text (String) : the new text to display
  - targetPlayer (String) : the player who will get displayed the new text (if nil, applies to all players) (default value = nil)

Dernière modification le 1647126360000
Pikashu
« Consul »
1453480560000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#5
  76

29/10/2015 changes


  • Some functions got moved/renamed, but the original ones are still working:
    • tfm.exec.bindKeyboard is now system.bindkeyboard
    • tfm.exec.setUIMapName is now ui.setmapName
    • tfm.exec.setUIShamanName is now ui.setShamanName
  •  
  • Player's shaman mode will now be in the property "shamanMode" (the previous property "inHardMode" is still present)
  •  
  • All functions whose name starts with disable used to not have any default parameter. They will now have true as the default parameter.
  •  
  • The event eventEmotePlayed now has an additional parameter, which is the emote parameter (only useful for the flag emote, at least for now)
  •  
  • There is a new function tfm.exec.playEmote to make people do an emote.
  •  
  • There is a new function ui.showColorPicker to display a color picker. When a player selects a color, it triggers the new event eventColorPicked.
  •  
  • The enums in tfm.enum used to lack a lot of elements, it should be fixed. There is also a particle enum, as well as a ground type one.
  •  
  • The xSpeed and ySpeed arguments in the event eventSummoningEnd, which refered to the initial speed of the spawned object, got removed as it is impossible to summon an object with a non-null speed (even if the object starts moving after being spawned, such as cannon balls), so they were always equal to 0.
    If you use the last argument (the spawned object description), you should now use the 6th one instead of the 8th one. However, the object description is actually still served as the 8th argument to prevent current script from breaking.
  •  
  • The way the /clavier setting works (which used to simulate the keys q or z when a or w were pressed), which made listening for some keypress events tricky, got changed. There isn't any key simulation anymore so /clavier won't change anything in regard of listened keys. Moreover, I've "added" 4 keycodes to accurately listen for player directions : 0 (left), 1 (up), 2 (right) and 3 (down). Events listening for these keycodes are triggered indistinctively when the player use the arrows, zqsd (w/o the /clavier setting) or wasd (w/ the /clavier setting).
  •  
  • The minimum possible value you could use with tfm.exec.setRoomMaxPlayers used to be 5, it is now 1.
  •  
  • os.date didn't work correctly (it didn't used the right time), it should be fixed.
  •  
  • Objects speed, base type (useful for customizable objects) and custom colors (useful for customizable objects) has been added in the object descriptions in tfm.get.room.objectList
  •  
  • Official Lua Devs now can have better player positions/speed accuracy using tfm.exec.lowerSyncDelay. The method isn't available to all players as it is network-intensive.



22/01/2016 changes (version 0.21)


  • Sending huge Lua scripts should not disconnect you from the room anymore.
  •  
  • The String metatable, being shared between all scripts because of the Lua implementation we use, isn't accessible anymore.
  •  
  • The registrationDate property in tfm.get.room.playerList tables now contains the right registration date timestamp.
  •  
  • Players who clicked on a textarea don't get blocked anymore when the textarea is updated.
  •  
  • Color selectors don't stay displayed anymore when a module ends.

Dernière modification le 1621104480000
Pikashu
« Consul »
1460721900000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#6
  79

15/04/2016 changes (version 0.22)


  • New event eventChatMessage which is triggered when people send a message in the room chat
  •  
  • The function tfm.exec.newGame now can take a 2nd argument to specify whether the map should be played mirrored or not. If you don't specify this parameter, it will have the default behaviour (i.e. maps randomly mirrored in racing/bootcamp rooms)
  •  
  • There is a new boolean property tfm.get.room.mirroredMap which indicates whether the current map is mirrored.
  •  
  • Since people can't password-protect module rooms anymore using the /pw command, there is a new function tfm.exec.setRoomPassword which allows to set the room password. It's only available to official Lua devs scripts (password-protecting a tribehouse isn't possible anyway).
  •  
  • There is a new boolean property tfm.get.room.passwordProtected which indicates whether the room password-protected.

Dernière modification le 1460722200000
Pikashu
« Consul »
1480692420000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#7
  80

02/12/2016 changes (version 0.23)



NEW:

  • Players' information tables in tfm.get.room.playerList now includes their id (in the id field)
  • The new function tfm.exec.setAutoMapFlipMode allows you to define how next maps shoud be displayed: flipped (true), not flipped (false), or the default behaviour i.e. randomly flipped in bootcamp/racing rooms (nil).
  • The new function tfm.exec.giveConsumables now allows event modules to give some consumables as a reward (in addition to titles).
  • The function tfm.exec.moveObject now has two more arguments, to be able to change (or keep) the object's angle.
  • There are 4 new functions to disable some functionnalities : tfm.exec.disableMortCommand, tfm.exec.disableWatchCommand, tfm.exec.disableDebugCommand, and tfm.exec.disableMinimalistMode. Use them only if it /mort, /watch, etc. give an unfair advantage in your module.
    (Edit: tfm.exec.disableWatchCommand and tfm.exec.disableDebugCommand are buggy, they'll get fixed on the next reboot)


Bugfixes:

  • Players with colored nicknames now (re)spawn with the right color
  • There were some positioning and gameplay issues with some maps in mirror mode (mostly vanillas)
  • When the system.loadFile function was used with a non-existent file id, the eventFileSaved was triggered instead of the eventFileLoaded one.
  • The implementation of the os.time function was buggy, for some dates it returned different results when the function was called before or after noon.
  • During the first round of a module, images displayed on a fixed layer were displayed under textareas, whereas they were always displayed above afterwards. Now, fixed layer images will always be displayed above textareas.


Miscellaneous:

  • The debug.disableTimerLog function, which never worked and whose functionnality is included in the debug.disableEventLog one, has been removed from the documentation (but still exists to prevent scripts which call it from breaking)

Dernière modification le 1480694880000
Pikashu
« Consul »
1486468020000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#8
  88

07/02/2017 changes (version 0.24)



NEW:

  • There is a new function tfm.exec.disablePhysicalConsumables which allows to disable physical consumables like in bootcamp and racing rooms.
  • The Lua debug chat (where errors are logged and print'ed messages are displayed) is now linked to the prompt of the room chat, which means that messages sent there will be sent as if you had the room chat opened


Bugfixes:

  • When there were multiple shaman objects in a loaded map XML, only the last one was registered in tfm.get.room.objectList, and with the id 0. Now they're correctly registered, and their have their real ids (starting from 1000)
Pikashu
« Consul »
1499090340000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#9
  96

30/06/2017 changes (version 0.25)



NEW:

  • When a Lua script finishes normally (via the system.exit function, for example), it doesn't throw an error anymore.
Pikashu
« Consul »
1503065760000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#10
  94

28/07/2017 changes (version 0.26)



BUGFIXES:

  • The function tfm.exec.newGame didn't work when the parameter was a category (ex : tfm.exec.newGame("#0")).
Pikashu
« Consul »
1538059020000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#11
  122

27/09/2018 changes (version 0.27)




NEW FUNCTIONS

  • tfm.exec.setShamanMode ( playerName, mode ) allows you to specify the shaman mode that a player will have as shaman (even if they haven't unlocked it yet)
  • tfm.exec.removeCheese ( playerName ) allows you to take away the cheese from a player
  • tfm.exec.disablePrespawnPreview ( display ) allows you to disable the prespawn preview when a shaman is gonna invoke an object
  • tfm.exec.giveTransformations ( playerName, canTransform ) allows players to use the mouse transformations
  • tfm.exec.linkMice ( playerName1, playerName2, linked ) allows you to link mice (like soulmates maps)
  • tfm.exec.changePlayerSize ( playerName, size ) allows you to change the size of the players


NEW EVENTS

  • eventPlayerMeep ( playerName, xPosition, yPosition ) is fired when a player meeps


OTHER NOVELTIES

  • New attributes in the players Lua tree:
    • isInvoking (boolean)
    • tribeId (int)
    • spouseName (string)
    • spouseId (int)
    • gender (int)
  • In maps loaded via the XML, you can now :
    • use the images hosted by the Lua devs (on atelier801.com) in grounds descriptions to change their appearance (attribute i)
    • use the global APS attribute to specify foreground images that can disappear (like in the room 801/village map)
  • The Lua module events created by the official Lua developers can now give specific badges and orbs



CHANGES

  • tfm.exec.addImage can now target a fixed layer (with the new prefix :) behind the Lua interfaces layer
  • system.disableChatCommandDisplay now accepts nil as the first parameter. Using nil allows to display/hide all the chat commands.
  • tfm.exec.setVampirePlayer and tfm.exec.setShaman now accept a second argument (boolean) to transform a vampire/shaman back to a regular mouse
  • the eventPlayerVampire event now includes a second argument, which is the nickname of the vampire who contamined the player (or nil if it hasn't been contamined by another player)
  • tfm.exec.giveMeep now accepts a second argument (boolean) to be able to remove the ability to meep from a player


BUGFIXES

  • Water and spider web grounds added with tfm.exec.addPhysicObject did not have their special behaviour (note: it still won't is you spawn the ground as dynamic)
  • Water and spider web grounds removed with tfm.exec.removePhysicObject still had an effect on the mouse/objects
  • The event eventSummoningCancel was triggered when shamans started to spawn a new object after successfully spawning a previous one

Dernière modification le 1550568300000
Pikashu
« Consul »
1550568300000
    • Pikashu#0095
    • Profil
    • Derniers messages
    • Tribu
#12
  100

18/02/2019 changes (version 0.28)




NEW FUNCTIONS

  • The native method debug.traceback ( message, level ) is now available, and should help debugging your scripts. The official documentation about it is here: http://www.lua.org/manual/5.2/manual.html#pdf-debug.traceback
    Note: for obvious reasons, the first argument of the original function, which specifies a Lua thread, isn't available.



BUGFIXES

  • table.unpack now returns all the values from a given table as expected, instead of stopping when encountering a nil value.
Jordy
« Consul »
1604356440000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#13
  69

Changes (version 0.28)




NOTES

  • Some of these changes have been there for more than a month. Sorry for the late announcement.
  • The Lua API version did not change.
  • We are aware that community and language are room-dependant in the player's lua tree. We are waiting for tig to fix it.


NEW FUNCTIONS

  • tfm.exec.addBonus ( type, x, y, id, angle, visible, targetPlayer ) adds a defilante bonus to the map, and if it is of type 0 (point), it will trigger eventPlayerBonusGrabbed when someone grabs it
  • tfm.exec.freezePlayer ( playerName, freeze ) freezes or unfreezes someone
  • tfm.exec.removeBonus ( id, targetPlayer ) removes a bonus previously spawned with tfm.exec.addBonus
  • tfm.exec.setWorldGravity ( x, y ) allows you to change the world forces on the x axis (wind) and on the y axis (gravity)


NEW EVENTS

  • eventPlayerBonusGrabbed ( playerName, bonusId ) is triggered when a player grabs a bonus of type 0 (point). If the bonus belongs to the map, bonusId will be 0.


OTHER NOVELTIES

  • A new command has been added ingame: /luahelp
  • New attributes in the players Lua tree:
    • cheeses (int)
    • language (string) : the language of the player (slightly different from community)
  • New attributes in the room Lua tree:
    • isTribeHouse (boolean)
    • language (string) : the language of the room (slightly different from community)
  • New enums:
    • bonus (table) :
      • point : 0
      • speed : 1
      • death : 2
      • spring : 3
      • booster : 5
      • electricArc : 6
    • on the grounds enums:
      • yellowGrass : 17
      • pinkGrass : 18
      • acid : 19
Jordy
« Consul »
1611267720000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#14
  37
http://www.transformice.com/share/api.pngHello everyone, we have exciting news for you!

Players can now use the functions tfm.exec.addImage and tfm.exec.removeImage!
# Image codes (aka image hosting)

Images that break the Rules of the game or that are just inappropriate in any sense will not be hosted.

Members of the Module Team can host images, which means that if you would like to use an image, you can request them in this thread or ask one of them privately. Remember that hosting images are not our duty, so not everyone will be willing to host your images.
# Documentation

tfm.exec.addImage(imageName, target, xPosition, yPosition,targetPlayer)

Effect: Displays an image. Returns the ID of the image.

http://i.imgur.com/AeLSILk.png

Arguments:
  • imageName (string) - The file name of the image, including the extension. If your image is given as http://images.atelier801.com/174042eda4f.png, the code you need to use should be 174042eda4f.png
  • target (string) - The part of the map, or dynamic object that the image will be attached to. Each target has a special character that's used as a prefix for the ID or name attached to.

    • #mobileID - A shaman object. The ID can be obtained through eventSummoningEnd(), tfm.get.room.objectList, or returned from tfm.exec.addShamanObject().
    • $playerName - A player in the room, their mouse graphic will stay and this image will be appended relative to it.
    • %playerName - A player in the room, their mouse graphic will be removed and this image will replace it completely.
    • ?backgroundLayerDepth - This image will appear in background and is not fixed to the mouse's camera
    • :fixedLayerDepthBehindInterface - This image will appear behind all interfaces and is fixed to the mouse's camera
    • !foregroundLayerDepth - This image will appear in foreground and is not fixed to the mouse's camera
    • &fixedLayerDepthFrontInterface - This image will appear in front of all interfaces and is fixed to the mouse's camera
    • _groundLayerDepth - This image will appear on the specified Z layer depth of a ground and is not fixed to the mouse's camera
  • xPosition (integer) - The X coordinate that the top-left of the image will be displayed at relative to the target.
  • yPosition (integer) - The Y coordinate that the top-left of the image will be displayed at relative to the target.
  • targetPlayer (string) - The player to display the image to. If this argument is nil, the image will be displayed to all players in the room.


Example:
Code Lua

1
tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)


tfm.exec.removeImage(imageID)

Effect: Removes an image.

Arguments:
  • imageID (integer) - The ID of the image to removed. The ID to use here is returned from tfm.exec.addImage().


Example:
Code Lua

1
2
imageID = tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)
tfm.exec.removeImage(imageID)


How to, by Extremq
http://www.transformice.com/share/api.pngOlá pessoal, nós temos ótimas notícias para anunciar!

Jogadores agora podem utilizar as funções tfm.exec.addImage e tfm.exec.removeImage!
# Hospedagem de Imagens

Imagens inapropiadas ou que violarem as Regras do jogo não serão hospedadas.

Membros da Module Team podem hospedar imagens, o que significa que se você deseja utilizar uma imagem específica, você poderá solicitar nesse tópico ou pedí-los privadamente. Lembre-se que eles não são obrigados a hospedá-las, então nem todos podem estar dispostos a fazê-lo.
# Documentação

tfm.exec.addImage(códigoDaImagem, alvo, posiçãoX, posiçãoY, jogadorAlvo)

Efeito: Mostra uma imagem e retorna o seu ID junto.

http://i.imgur.com/AeLSILk.png

Argumentos:
  • códigoDaImagem (string) - O código da imagem, incluindo o formato (.jpg, .png). Se o link da sua imagem é http://images.atelier801.com/174042eda4f.png, o código que você precisa usar será 174042eda4f.png
  • alvo (string) - A parte do mapa, ou objeto dinâmico que a imagem será associada. Cada tipo de alvo possui um caractere especial que é usado como prefixo juntamente com um ID (ou um nome, caso um alvo seja um jogador).

    • #IdObjetoShaman - Um objeto shaman. O ID pode ser obtido por meio das funções eventSummoningEnd(), tfm.get.room.objectList, ou pelo tfm.exec.addShamanObject().
    • $nomeDoJogador - Um jogador. A imagem do ratinho irá continuar visível e a imagem será anexada em uma posição relativa a ele.
    • %nomeDoJogador - Um jogador. A imagem do ratinho será removida completamente e a imagem será anexada em uma posição relativa a ele.
    • ?segundoPlano - A imagem irá aparecer no fundo do mapa e não moverá junto com a câmera do jogador.
    • :atrásDaInterface - A imagem irá aparecer atrás de todas as interfaces e será fixa à câmera do jogador.
    • !primeiroPlano - A imagem irá aparecer na frente de decorações do mapa e não moverá junto com a câmera do jogador.
    • &naFrenteDaInterface - A imagem irá aparecer na frente de todas as interfaces e será fixa à câmera do jogador.
    • _camadaDoPiso - A imagem aparecerá na camada Z de um piso e não moverá junto com a câmera do jogador.
  • posiçãoX (inteiro) - A coordenada X que o canto superior esquerdo da imagem será alinhada em relação ao alvo.
  • posiçãoY (inteiro) - A coordenada Y que o canto superior esquerdo da imagem será alinhada em relação ao alvo.
  • jogadorAlvo (string) - O jogador que verá a imagem. Se o valor for nulo, a imagem será mostrada para todos os jogadores da sala.


Exemplo:
Code Lua

1
tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)


tfm.exec.removeImage(IdDaImagem)

Efeito: Remove uma imagem.

Argumentos:
  • IdDaImagem (inteiro) - O ID da imagem a ser removida. O ID é o retorno da função tfm.exec.addImage().


Exemplo:
Code Lua

1
2
IdDaImagem = tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)
tfm.exec.removeImage(IdDaImagem)


Tutorial, por Extremq

http://images.atelier801.com/177267945b6.png


http://www.transformice.com/share/api.png
¡Ahora los jugadores pueden usar las funciones tfm.exec.addImage y tfm.exec.removeImage!
# Alojamiento de imágenes

Las imágenes que rompan las Reglas del juego o que simplemente son inapropriadas en cualquier sentido no serán alojadas.

Los miembros del Module Team pueden alojar imágenes, lo que significa que si te gustaría usar una imágen, las podés pedir en este hilo o pedirle a un miembro de forma privada. Recuerda que alojar imágenes no es nuestro trabajo, por lo que no todos los miembros estarán dispuestos a subir tus imágenes
# Documentación

tfm.exec.addImage(imágen, objetivo, posiciónX, posiciónY, jugador)

Efecto: Muestra una imágen. Devuelve la ID de la imágen.

http://i.imgur.com/AeLSILk.png

Parámetros:
  • imágen (string) - El código de la imágen, incluyendo el formato (.png, .jpg). Si tu imágen es http://images.atelier801.com/174042eda4f.png, el código que debes usar es 174042eda4f.png
  • objetivo (string) - La parte del mapa, u objeto dinámico a la cual la imágen será adjuntada. Cada objetivo tiene un carácter especial el cual se usa como un prefijo de la ID (o de un nombre, en el caso de que el objetivo sea un jugador).

    • #idDeObjeto - La imágen va a aparecer relativa a un objeto de chamán. La imágen del objeto desaparecerá. La ID se puede obtener a través de eventSummoningEnd(), tfm.get.room.objectList, o devuelta de tfm.exec.addShamanObject().
    • $jugador - Un jugador en la sala, su ratón va a seguir siendo visible y la imágen será añadida relativa al ratón.
    • %jugador - Un jugador en la sala, su ratón va a desaparecer y esta imágen lo reemplazará. Relativa al ratón (el cual ahora es invisible)
    • ?segundoPlano - La imágen va a aparecer en segundo plano y relativa al mapa
    • :atrásDeLaInterfaz - La imágen va a aparecer en segundo plano y relativa a la cámara del jugador
    • !primerPlano - La imágen va a aparecer en primer plano y relativa al mapa
    • &delanteDeLaInterfaz - La imágen va a aparecer en frente de todas las interfaces (textareas, popups) y relativa a la cámara del jugador
    • _capaDeSuelo - La imágen va a aparecer en la capa Z de un suelo y relativa al mapa
  • posiciónX (entero) - La coordenada X en la cual aparecerá la parte superior izquierda de la imágen relativa al objetivo.
  • posiciónY (entero) - La coordenada Y en la cual aparecerá la parte superior izquierda de la imágen relativa al objetivo.
  • jugador (string) - El jugador que verá la imágen. Si el valor dado es nil, la imágen se mostrará a todos los jugadores en la sala.


Ejemplo:
Code Lua

1
tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)


tfm.exec.removeImage(idDeImagen)

Efecto: Elimina una imágen.

Parámetros:
  • idDeImagen (entero) - La ID de la imágen a eliminar. El valor usado aquí es el que devuelve la función tfm.exec.addImage().


Ejemplo:
Code Lua

1
2
idDeImagen = tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)
tfm.exec.removeImage(idDeImagen)


Tutorial, por Extremq
http://www.transformice.com/share/api.pngCiao a tutti, abbiamo delle nuovissime notizie per voi!

Ora i giocatori possono utilizzare le funzioni tfm.exec.addImage e tfm.exec.removeImage!
# Codici Immagini (anche conosciuto come "Hosting delle Immagini")

Le immagini che non sono conformi alle Regole del Gioco o che non sono pertinenti non verranno caricate.

I membri del Module Team possono caricare immagini, ciò significa che se volessi usare un'immagine, puoi richiederla a loro in questa discussione o privatamente ad uno di loro. Ricorda che caricare le immagini non è il nostro dovere, quindi non tutti saranno disponibili nel caricare le tue immagini.
# Documentazione

tfm.exec.addImage(nomeImmagine, destinazione, Asse X, Asse Y,giocatore)

Effetti: Mostra un'immagine. Restituisce l'ID dell'immagine.

http://i.imgur.com/AeLSILk.png

Parametri:
  • nomeImmagine (string) - Il nome del file dell'immagine, includendo l'estensione. Se il nome dell'immagine è http://images.atelier801.com/174042eda4f.png, il codice che dovrai usare sarà 174042eda4f.png
  • destinazione (string) - La parte della mappa, o l'oggetto dinamico a cui l'immagine verrà attaccata. Ogni destinazione ha uno speciale carattere che verrà usato come prefisso per l'ID o il nome a cui sarà attaccato.

    • #mobileID - Un oggetto da Sciamano. L'ID può essere ottenuto tramite il comando eventSummoningEnd(), tfm.get.room.objectList, o restituto dal comando tfm.exec.addShamanObject().
    • $nomeGiocatore - Un giocatore nella stanza, il suo topo verrà rimosso e l'immagine verrà attaccata vicino a lui.
    • %nomeGiocatore - Un giocatore nella stanza, il suo topo verrà rimosso e l'immagine lo rimpiazzerà completamente.
    • ?backgroundLayerDepth - L'immagine apparirà nello sfondo e non è fissata alla visuale del topo.
    • :fixedLayerDepthBehindInterface - L'immagine apparirà dietro ogni interfaccia ed è fissa alla visuale del topo.
    • !foregroundLayerDepth - L'immagine apparirà in primo piano e non è fissa sulla visuale del topo.
    • &fixedLayerDepthFrontInterface - L'immagine apparirà davanti a tutte le interfacce ed è fissa sulla visuale del topo.
    • _groundLayerDepth - L'immagine apparirà sull'asse Z specificata del terreno e non è fissa sulla camera del topo.
  • asseX (integer) - L'angolo in alto a sinistra dell'immagine verrà mostrata alla coordinata X relativa alla destinazione.
  • asseY (integer) - L'angolo in alto a sinistra dell'immagine verrà mostrata alla coordinata Y relativa alla destinazione.
  • giocatoreDestinatario (string) - Il giocatore a cui mostrare l'immagine. Se questo parametro è vuoto, l'immagine verrà mostrata a tutti i giocatori della stanza.


Esempi:
Code Lua

1
tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)


tfm.exec.removeImage(imageID)

Effetto: Rimuove un'immagine.

Parametri:
  • imageID (integer) - L'ID dell'immagine da rimuovere. L'ID usato verrà restituto dal comando tfm.exec.addImage().


Esempio:
Code Lua

1
2
imageID = tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)
tfm.exec.removeImage(imageID)


Tutorial su come fare, by Extremq
http://www.transformice.com/share/api.pngПривет всем, вот новость которая вас заинтересует!

Теперь игрокам доступны функции tfm.exec.addImage и tfm.exec.removeImage!
# Image codes (хостинг изображений)

Изображения которые нарушают правила игры или неуместные, не будут размещаться.

Но размещать изображения смогут только Module Team, поэтому для того чтобы использовать ваши картинки, для начала придется попросить в этой теме или через личные сообщения о загрузке ког-нибудь из команды. Помните что размещение ваших картинок не является их обязаностью.
# Документация

tfm.exec.addImage(imageName, target, xPosition, yPosition,targetPlayer)

Добавляет картинку, возвращает ID.

http://i.imgur.com/AeLSILk.png

Аргументы:
  • imageName (строка) - файловое имя картинки вместе с расширением. Например если вы хотите отобразить картинку http://images.atelier801.com/174042eda4f.png, то вам надо передать 174042eda4f.png
  • target (строка) - Часть карты или динамического объекта с которым будет связана картинка. Каждые цели имеют свои префиксы после которого нужно указывать идентификаторы\имена

    • #mobileID - Для прикрепления к шаманскому объекту. ID можно получить через eventSummoningEnd(), tfm.get.room.objectList или tfm.exec.addShamanObject().
    • $playerName - Для прикрепления к игроку, изображение будет поверх мыши.
    • %playerName - Для прикрепления к игроку, изображение заменяет реальное отображение мыши
    • ?backgroundLayerDepth - Для прикрепления к бекграунду и не фиксируется за вашим передвижением
    • :fixedLayerDepthBehindInterface - Для прикрепления к бекграунду и фиксируется за вашим передвижением
    • !foregroundLayerDepth - Для прикрепления к внешнему фону и не фиксируется за вашим передвижением
    • &fixedLayerDepthFrontInterface - Для прикрепления к внешнему фону и фиксируется за вашим передвижением
    • _groundLayerDepth - Для прикрепления к определенному слою платформ и не фиксируется за вашим передвижением
  • xPosition (число) - X координата относительно цели, значение по умолчанию 0
  • yPosition (число) - Y координата относительно цели, значение по умолчанию 0
  • targetPlayer (строка) - Никнейм игрока, который увидит картинку, значение по умолчанию nil, т.е. все игроки


Пример:
Code Lua

1
tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)


tfm.exec.removeImage(imageID)

Удаляет картинку по ее ID

Аргументы:
  • imageID (число) - ID изображения которое надо удалить. Идентификатор возвращает функция tfm.exec.addImage().


Пример:
Code Lua

1
2
imageID = tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30)
tfm.exec.removeImage(imageID)


Инструкция от Extremq


Спасибо за перевод Smgxxx #0000!

Dernière modification le 1611996240000
Bolodefchoco
« Sénateur »
1616687580000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#15
  13

Changes (version 0.28)




NEW:

  • tfm.exec.addImage got four new parameters:
      - scaleX (Number) : the X (width) scale of the image (default value = 1)
      - scaleY (Number) : the Y (height) scale of the image (default value = 1)
      - angle (Number) : the angle of the image (in radians degrees) (default value = 0)
      - alpha (Number) : the image opacity (default value = 1)


Dernière modification le 1617410700000
Bolodefchoco
« Sénateur »
1617411240000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#16
  12

Changes (version 0.28)




NEW:

  • tfm.exec.addImage got two new parameters:
      - anchorX (Number) : the horizontal anchor in which the image's angle will use. (from -1 to 1, 0.5 being the center) (default value = 0)
      - anchorY (Number) : the vertical anchor in which the image's angle will use. (default value = 0)
  • Use tfm.exec.getPlayerSync() to get the room's current sync player.
  • Use tfm.exec.setPlayerSync( playerName ) to set the room's sync player.

Dernière modification le 1621459860000
Bolodefchoco
« Sénateur »
1621103820000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#17
  10

Changes (version 0.28)




NEW:

  • Use tfm.exec.attachBalloon(playerName, isAttached, colorType, ghost) to attach a balloon to a player.

Dernière modification le 1624758060000
Bolodefchoco
« Sénateur »
1636041780000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#18
  10

Changes (version 0.28)




NEW:

  • tfm.exec.attachBalloon got a new parameter:
      - speed (Number) : the vertical speed of the balloon. (default value = 1)
  • tfm.exec.addShamanObject got a new parameter:
      - options (Table) : the object description
       - fixedXSpeed (Number), fixedYSpeed (Number)
  • tfm.exec.addImage got a new target:
      - +physicObjectID



Changes (version 0.28)




NEW:

  • Use ui.setBackgroundColor to set a different background color in the map.

Dernière modification le 1643407620000
Bolodefchoco
« Sénateur »
1643318040000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#19
  7

Changes (version 0.28)




NEW:

  • print now pretty-prints Lua tables.
  • tfm.exec.freezePlayer got one new parameter:
      - displayIce (Boolean) : if the ice image should be displayed on the player (default value = true)
  • The new function system.luaEventLaunchInterval now allows that Lua events have a flexible load time - some can be 40 minutes, others 60 minutes. It's now up to the module owner to choose!
  • eventContactListener(playerName, groundId, contactInfo) is triggered when a player hits a ground with a contact listener or that has been added through addPhysicObject with the contactListener property.

Dernière modification le 1643323560000
Bolodefchoco
« Sénateur »
1647123960000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#20
  8

Changes (version 0.28)




NEW:

  • Use tfm.exec.setAieMode to enable the AIE mode in the current map.
  • New function system.setLuaEventBanner to define the login banner for the current Lua event
  • New function tfm.exec.setPlayerGravityScale to change the gravity of a player.
  • Golden tickets and seashells can now be offered through tfm.exec.giveConsumables and system.eventGiveEventGift, and they share a different quantity limit that does not affect other consumables.
  • tfm.exec.addImage has got two new targets:
      - ~interfaceID : places an image into the interface container, meaning that the layer depends on the order of execution of the different UI elements.
      - =mobileID : places an image in front of a shaman object but won't hide the original object's image.
  • New function tfm.exec.setPlayerNightMode to enable the night mode for a player.
  • New function tfm.exec.addNPC to place a NPC in the map.
  • New event eventTalkToNPC triggers when a player clicks in an interactive NPC.



FIX:
  • When dodue mode is enabled, tfm.exec.removeCheese may remove the extra cheese sprites.
  • Forums
  • /
  • Atelier 801
  • /
  • Announcements
  • /
  • Documentation sur le LUA
© Atelier801 2018

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

Version 1.27