Module FAQ & Documentation |
Shamousey « Consul » 1411071240000
| 12 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Modules are mini-games build in Transformice with a variety of different gameplay options, the developers of them have complete control. They are coded in the lightweight Lua scripting Language. What are the different types of modules? Official Modules • Official modules are mini-games or utilities that have been approved by an Administrator. • They show up on the in-game mini-game rooms list. • You can earn 1 shop cheese every 2 minutes when you enter the hole. • You can load these modules in the tribe house. • These modules must be hosted by someone of the Module Team. Semi-official Modules • Semi-official modules are mini-games or utilities that have been approved by an Administrator. • You can load these modules in the tribe house. • These modules must be hosted by someone of the Module Team. Unofficial Modules • Unofficial modules are usually just scripts ran in tribe houses and other rooms without being previously approved by an Administrator. What is the different about modules compared to normal rooms? Other than modules each having their own unique game-play and features, there's a few other things to note. • In official modules you can earn 1 shop cheese every 2 minutes when you enter the hole. • In unofficial modules there is no "Your last message is the same" warning. • Stats are disabled. • /mort is disabled. How can I play a module? You can play any (semi-)official module by going to its room, for example "/room #ModuleName", or running it in your tribe house with the command "/module #ModuleName" if you have the power to load maps there. You can play unofficial modules by loading the script yourself, or having someone else load it for you. How do I Run a script? In order to execute your own script, you need to fit a couple of requirements; be in your tribe house, have the appropriate permissions to use the "/np" command, have over 100 cheese, and never be banned for hacking. You can then type the command "/lua" and a window will pop up with an area to type in or paste code. Pressing the "Submit" button will launch the script in your room Where can I suggest something or report a bug? If you've come up with an idea you'd like to see implemented in either the Module API itself or an individual module, you can post it in the Module Suggestions Thread. If you've noticed a bug with the Module API or a specific module, you can report it in the Module Bugs Thread I've developed a module, how can it be made official? Only members of the Module Team can manage an official module. You should consider applying for the team yourself (see the "Module Team" section of this thread for instructions on how to do that), or alternatively ask an existing member of the team to look at it on your behalf. All official modules need to be approved by an administrator, and these modules should have several things such as; fun gameplay, replay value, clear help/rules, translations to the most popular languages in the communities, and efficient coding that won't use too many server resources or crash. I ran a script and a #lua chat tab opened, what is this? The #lua chat tab is used to house all information about your currently running scripts. Any printed strings will display here, as well as any errors, warnings for high runtime, or anything else of the sort. Where can I get help coding a module? If you need help in developing something, there are several places you can go. If you're experiencing an error, you can visit the errors thread for information on how to fix it, or post your code for someone else to fix for you. If you need a function or some code written for you, the Script Requests thread is the place to ask. If you need to talk to someone one-on-one, you can talk to any of the members listed in the "Module Team" section of this thread, join "/chat Lua" ingame, or use the #modules Discord channel A validated account is required to get access to the #lua channel, see #rules-and-roles. Is there anything else I should take note of when developing a module? There are a few quirks and useful bits of information that will help you out when developing with the Module API. • Flash supports some HTML tags that can be used in chat messages, popups, textareas, and other places that display strings. You can read more about which HTML tags can be used here. • tfm.exec.newGame() can't be executed less than 3 seconds since the last time it was ran. • "<" and ">" characters can't be displayed in strings, however by using the HTML entities for them, they can be. • "http", "://" words can't be displayed in textareas. • Some variables in tfm.get.room.playerList and tfm.get.room.objectList rely on the room's sync to stay updated. This means that several things such as player's and object's coordinates, player's direction, and several other things can be incorrect at times as they only update roughly once every 500 milliseconds. • Function names all use camelCase, meaning that the first word starts with a lowercase character and all subsequent ones start with an uppercase character. A good example of this is tfm.exec.disableAllShamanSkills() • Scripts can only be successfully executed if their size is less than 1mb. The Module Team is a group of developers who create minigames for the community to enjoy playing, by using the Module API. Members of the team have access to a few additional functions to create modules, some of which are more resource intensive on the server than other functions so are limited - these functions are marked in the documentation in this thread. Some of the features available to the module team exclusively are:
The full list of team members is kept private as some members wish to remain anonymous or not handle whispers, however the following people listed are public members of the team, you may contact them for help developing your module, getting your module made official, or ask them any other questions you may have. • Bodykudo#0000 • Heniyengui#0000 • Massi#0095 • Noooooooorr#0000 • Turkitutu#0000 • Bolodefchoco#0015 • Brenower#0000 • Esh#0095 • Fofinhoppp#0000 • Laagaadoo#0000 • Nettoork#0000 • Ninguem#0095 • Rufflesdqjo#0095 • Thanos#1306 • Drgenius#0000 • Frozenjord#0656 • Gekkeiju#0000 • King_seniru#5890 • Moepl#0095 • Onkei#0000 • Papero#9240 • Sebaisseba#0095 • Shamousey#0015 • Sharpiepoops#0020 • Tat#0095 • Saintgio#0000 • Tocutoeltuco#0000 • Warfenix#0095 • Athesdrake#0000 • Thewav#0095 • Tortuegreen#0000 • Jordy#0095 • Makinit#0095 • Rkubi#0000 • Sebafrancuz#0000 • Extremq#0000 • Zigwin#0000 The Module Team is looking for dedicated members of the community with bright ideas for games that know Lua well and are willing to create fantastic modules for the whole community to enjoy. Before considering applying for this position, there are several things that you should take note of: • All applicants must speak some level of English in order to communicate with the rest of the team. • This is not a staff position, there is no age limit or additional benefits. • After your application, you will get a notification when you are accepted. • Maturity is required from all members of the team, even if they're not public members. • All members of the team must know Lua and how to use the Module API. Practising in the tribe house is a good way to ensure you know how it works. If you are ready to apply, feel free to fill out the following form in English. Apply Here What are all of the semi-official and official modules? You can find a list of official modules ingame by typing "/module" or going to the "Game Mode" window from the menu. On forums, you can check the Available Module Rooms thread. This section contains a variety of different pieces of information that can be useful when developing a module, such as enums, color codes, IDs, and more. Color Codes The color codes listed here are commonly used in Transformice, both the game and interface. For a more complete list of color codes used in the game, please visit this thread. #6A7495 Game background. #324650 Game UI. #465a6e Lighter game UI.
Emote IDs This is a list of emotes and their corresponding enums. Bare in mind that the tfm.enum.emote table has a list of all emote names and enums.
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 Shaman Object IDs While tfm.enum.shamanObject is an easy-to-access list of most shaman objects, it doesn't list every object available in Transformice. Here is a list of all shaman objects that can be spawned in with tfm.exec.addShamanObject. Note that some of them can't be spawned properly in modules, so are crossed out.
littleBox : 1 box : 2 littleBoard : 3 board : 4 Heavy Ball : 5 ball : 6 trampoline : 7 Small Rough Plank : 8 Large Rough Plank : 9 anvil : 10 Red Anchor : 11 Red Anchor Rotating Clockwise : 12 Red Anchor Rotating Counter-Clockwise : 13 Green Anchor : 14 Green Anchor Rotating Clockwise : 15 Green Anchor Rotating Counter-Clockwise : 16 cannon (Up) : 17 Cannon (Down) : 18 Cannon (Right) : 19 Cannon (Left) : 20 Sticky Ball : 21 Yellow Anchor : 22 bomb : 23 Fake Cheese : 25 orangePortal : 26 blueBalloon : 28 redBalloon : 29 greenBalloon : 30 yellowBalloon : 31 rune : 32 chicken : 33 snowBall : 34 cupidonArrow : 35 apple : 39 sheep : 40 Demolition Worker Skill : 41 Spring : 42 Speed Boost : 43 Totem : 44 littleBoardIce : 45 littleBoardChocolate : 46 Transformed Mouse Small Box : 48 Transformed Mouse Large Box : 49 Transformed Mouse Anvil : 50 Transformed Mouse Small Plank : 51 Transformed Mouse Large Plank : 52 Transformed Mouse : 53 iceCube : 54 cloud : 57 Architect Skill : 58 bubble : 59 tinyBoard : 60 companionCube : 61 stableRune : 62 balloonFish : 65 Balloon Anchor : 66 longBoard : 67 triangle : 68 sBoard : 69 Cobweb Skill : 70 Roll Skill : 71 Recycling Skill : 72 Small Mouse Skill : 73 Leaf Skill : 74 Nature's Return Skill : 75 Booster Skill : 76 Handymouse Skill : 77 Restorative Skill : 78 Stop Skill : 79 paperPlane : 80 Gravitational Anomaly Skill : 81 Antigravity Skill : 82 Meep Skill : 83 Grapnel Skill : 84 rock : 85 Campfire Skill : 86 Shameow Skill (Broken) : 87 Conjuration Anchor : 88 pumpkinBall : 89 tombstone : 90 Snowman : 91 Renewal Skill : 92 Small Cloud : 93 Shameow Skill : 94 paperBall : 95 Invisible Small Box : 100-199, 20000-29999 Custom Small Box : 101-199 Invisible Large Box : 200-299, 30000-32767 Custom Large Box : 201-299 Invisible Small Plank : 300-399 Custom Small Plank : 301-399 Invisible Large Plank : 400-499 Custom Large Plank : 401-499 Invisible Ball : 600, 602-699 Custom Ball : 601-699 Invisible Trampoline : 700-799 Custom Trampoline : 701-799 Invisible Anvil : 1000-1099 Custom Anvil : 1001-1099 Invisible Cannon (Up) : 1700-1799 Custom Cannon (Up) : 1701 Invisible Cannon (Down) : 1800-1899 Invisible Cannon (Right) : 1900-1999 Invisible Cannon (Left) : 2000-2099 Invisible Balloon : 2800-3199 Custom Balloon : 2801-2899 Invisible Rune : 3200-3299 Invisible Valentine's Arrow : 3500-3599 Invisible Apple : 3900-3999 Invisible Sheep : 4000-4099 Invisible Ice Plank : 4500-4599 Invisible Choco Plank : 4600-4699 Invisible Cloud : 5700-5799 Invisible Bubble : 5900-5999 Invisible Tiny Plank : 6000-6099 Invisible Companion Crate : 6100-6199 Invisible Stable Rune : 6200-6299 Invisible Pufferfish : 6500-6599 Arrow (repeats back from 0) : 65536 Key Codes This is a list of characters that Lua supports, and their corresponding key codes. These are the numbers that the second argument of eventKeyboard returns and bindKeyboard requires. 0 - Left Arrow + A 1 - Up Arrow + W 2 - Right Arrow + D 3 - Down Arrow + S 8 - Backspace 9 - Tab 13 - Enter 16 - Shift 17 - Control 18 - Alt 19 - Pause 20 - Caps Lock 27 - Escape 32 - Spacebar 33 - Page Up 34 - Page Down 35 - End 36 - Home 37 - Left Arrow 38 - Up Arrow 39 - Right Arrow 40 - Down Arrow 45 - Insert 46 - Delete 48 - 0 49 - 1 50 - 2 51 - 3 52 - 4 53 - 5 54 - 6 55 - 7 56 - 8 57 - 9 65 - A 66 - B 67 - C 68 - D 69 - E 70 - F 71 - G 72 - H 73 - I 74 - K 75 - J 76 - L 77 - M 78 - N 79 - O 80 - P 81 - Q 82 - R 83 - S 84 - T 85 - U 86 - V 87 - W 88 - X 89 - Y 90 - Z 91 - Windows (Left) 92 - Windows (Right) 93 - Application Key 97 - 1 (Numbpad) 98 - 2 (Numbpad) 99 - 3 (Numbpad) 100 - 4 (Numbpad) 101 - 5 (Numbpad) 102 - 6 (Numbpad) 103 - 7 (Numbpad) 104 - 8 (Numbpad) 105 - 9 (Numbpad) 106 - * Asterix (Numbpad) 107 - + Plus (Numbpad) 109 - - Minus (Numbpad) 110 - \ Forward Slash (Numbpad) 112 - F1 113 - F2 114 - F3 115 - F4 116 - F5 117 - F6 118 - F7 119 - F8 120 - F9 121 - F10 122 - F11 123 - F12 144 - Numlock 145 - Scroll Lock 186 - ; Semicolon 187 - = Equals 188 - , Comma 189 - - Hyphen 190 - . Period 191 - / Forward Slash 192 - ` Apostrophe 219 - [ Left Square Bracket 220 - \ Backslash 221 - ] Right Square Bracket Ground IDs Here is a list of grounds and their corresponding IDs that a map's XML uses. Bare in mind that the tfm.enum.ground table has a list of all ground names and enums.
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 Perm Categories This section contains a list of all perm categories, for use in tfm.exec.newGame() and returned by tfm.get.room.xmlMapInfo.permCode. You can read the Map Rotation Guidelines thread for a more thorough explanation of each category. P0 - Regular Rotation P1 - Protected P2 - Prime Perm (now redundant) P3 - Prime Bootcamp P4 - Shaman P5 - Art P6 - Mechanism & Cooperation P7 - No-Shaman P8 - Dual Shaman P9 - Miscelleneous P10 - Survivor P11 - Vampire Survivor P13 - Bootcamp P17 - Racing P18 - Defilante P19 - Music (now redundant) P21 - Vampire Survivor Testing P22 - Tribe House P23 - Bootcamp Testing P24 - Dual Shaman Survivor P32 - Dual Shaman Testing P38 - Racing Testing P41 - Module/Minigame P42 - No-shaman Testing P43 - Deleted (Inappropriate) P44 - Deleted P87 - Vanilla Decoration IDs (outdated) This is a list of decoration IDs for player-made maps from the map editor. 0 - Bush 1 - Tree 2 - Fern 3 - Blue Flower 4 - Sign 5 - Grass 6 - Coconut Tree 7 - Umbrella 8 - Sand Castle 9 - Shovel 10 - Sand Bucket 11 - Red Flower 12 - Thorns 13 - Fence 14 - Window 15 - Sofa 16 - Chair 17 - Table 1 18 - Vase of Flowers 1 19 - Sofa with 1 Place 20 - Vase of Flowers 2 21 - Roast Chicken 22 - Bookcase 23 - Poster 24 - Bed 25 - Radio 26 - Teddy 27 - Abajour 28 - Refrigerator 29 - Wardrobes 30 - TV with Stand 31 - Soda 32 - Vase of Flowers 3 33 - Nightstand 34 - Fund 1 35 - range of Halloween 1 36 - range of Halloween 2 37 - Broom 38 - Skeleton 39 - Halloween Poster 40 - Balloons Halloween 41 - Web with Spider 42 - Autumn Tree 43 - Bats 44 - Torch 45 - Fund Cemetery 46 - Torch 2 47 - About Grades 48 - Pumpkin 1 49 - Pumpkin 2 50 - Snowmouse 51 - Snowy Tree 52 - Cookies with Milk 53 - Garland 54 - Half Hanging 55 - Candle 1 56 - Band Christmas 57 - Christmas Tree 58 - Ice Stalactites 59 - Mistletoe 60 - Ball Christmas Tree 61 - Lights Natalinas 62 - Present 63 - Gifts 64 - Santa 65 - Loop 66 - Valentine's Umbrella 67 - Valentine's Chair 68 - Valentine's Table 69 - Valentine's Plate 70 - Valentine's Day Gift 71 - Candle 2 72 - Vase of Flowers 4 73 - Flower in Vase 74 - Ribbons with Hearts 75 - Balloon Heart 76 - Valentine's Window 77 - Heart Pendant 78 - Stones with Algae 79 - Algae 1 80 - Chest 81 - Starfish 82 - Shell 83 - Stones 84 - Stones with Algae 2 85 - Coral 1 86 - Coral 2 87 - Algae 2 88 - Broken Vase 89 - Big Screen 90 - Small Screen 91 - Alchemy Pot 92 - Objects of Alchemy 1 93 - Objects of Alchemy 2 94 - Bookshelf 2 95 - Piano 96 - Fireplace 97 - Candelebra 98 - Coffin 99 - Paper Holder 100 - Bottle with Substance 1 101 - Bottle with Substance 2 102 - Buff 103 - Barrel 104 - Table 2 105 - Chair 2 106 - Skull Mouse 107 - Cobweb 1 108 - Cobweb 2 109 - Cobweb 3 110 - Cobweb 4 111 - Cobweb 5 112 - Vampire Portrait 113 - Support with Fruits 114 - Mirror 115 - Tombstone of Elise 116 - Crucifix 117 - Background 2 118 - RIP Tombstone 119 - Toilet 120 - Bath & Curtains 121 - Sink/Faucet 122 - Mirror 123 - Pots & Pans 124 - Oven 125 - Rocking Chair 126 - Pot 127 - Bar Stool 128 - Kitchen Cabinet 129 - Kitchen Drawers 130 - Lava Lamp 131 - Bootcamp Checkpoint Clothing IDs (outdated) This is a list of all clothing and outfit IDs that tfm.get.room.playerList[playerName].look returns. Note that .look doesn't return the ID of a fur colour if the player is wearing one. You can also access these IDs by typing /infoshop ingame, then opening the shop window. Furs 1 - Default Fur 2 - Cow Fur 3 - Siamese Cat Fur 4 - Rabbit Fur 5 - Cow Fur v2 6 - White-Brown Fur 7 - Black-White Cat Fur 8 - Tiger Fur 9 - Fox Fur 10 - Skeleton Costume 11 - Black-Grey Fur 12 - Black-Brown Fur 13 - Racoon Fur 14 - Snow Fur 15 - Red Panda 16 - Bunny Fur 17 - Zebra Fur 18 - Panda Fur 19 - Moon Fur 20 - Sun Fur 21 - Leopard Fur 22 - Deer Fur 23 - Skeleton Suit Fur 24 - White Leopard Fur 25 - Valentines Day Fur 27 - Toucan Fur 26 - St. Patrick's Day Fur 28 - Valentines Day Fur v2 29 - Ankh Fur 30 - 2014 FIFA World Cup Brazil Fur 31 - Giraffe Fur 32 - Cloud Fur Head 0 - Nothing 1 - Helicopter Hat 2 - Straw Hat 3 - Helmet 4 - Top Hat 5 - Sun Hat 6 - Fedora 7 - Soldier Helmet 8 - Miner Hat 9 - General's Cap 10 - Beret 11 - Ninja Headband 12 - Horns 13 - Halo 14 - Viking Hat 15 - Bandit Mask 16 - Pirate Hat 17 - Witch Hat 18 - Riding Helmet 19 - Nurse Cap 20 - Police Cap 21 - Santa Hat 22 - Chef's Hat 23 - Bunny Ears 24 - Shower Cap 25 - Cow Boy Hat 26 - Lemon Hat 27 - Mandarin Hat 28 - Palm Hairstyle 29 - Uncle Sam Hat 30 - Marge Simpson Hair 31 - Mario Hat 32 - Super Sayen Hat 33 - Party Hat 34 - Asterix Hat 35 - Crown 36 - Dreadlocks 37 - Afro 38 - Pharaoh Hat 39 - Pumpkin Head 40 - Skull Mask 41 - Antlers 42 - Snowman Head 43 - Blonde Hair 44 - Campaign Hat 45 - Quiff Hair 46 - Coolie Hat 47 - Indian Headress 48 - Panama Hat 49 - Jester Hat 50 - Deadmau5 Hat 51 - Pilot Hat 52 - Megaman Hat 53 - Viewtiful Joe Hat 54 - Eggshell 55 - Cocked Hat 56 - Fish Hat 57 - Cat Hat 58 - Fish Bowl 59 - Bow 60 - Egg Basket 61 - Orange Hair Hat 62 - Luffy Hat 63 - Sonic Hair 64 - Turkish Hat 65 - Brunette Hair 66 - Link Hat 67 - Shark Hat 68 - Rainbow Dash's Mane 69 - Twillight Sparkle's Mane 70 - AppleJack's Mane 71 - Pinkie Pie's Mane 72 - Rarity's Mane 73 - Fluttershy's Mane 74 - Ushanka 75 - Coonskin Hat 76 - Paper Bag 77 - Sombrero 78 - Ash's Hat 79 - Sleep Cap 80 - Knife In Head 81 - Ghost Sheet 82 - Bat Wings 83 - Turban 84 - Christmas Tree 85 - Stocking 86 - Krissim's Cockatrice Head 87 - Banana Leaf Headdress 88 - Straw Panache 89 - Fisherman Hat 90 - Fishing Rod 91 - Shell 92 - Captain Cap 93 - Sailor Cap 94 - Chicken 95 - Cake Hat 96 - Shadow Hat 97 - Ice Hat 98 - Lion Hat 99 - Tiara 100 - Break 101 - Hokage Hat 102 - Spartan Helmet 103 - Candle Hat 104 - Ice Cube 105 - Frog Beanie 106 - Chick Hat 107 - Panda Beanie 108 - Graduate Hat 109 - Coconut Shell 110 - Underpants 111 - Ram Horns 112 - Wreath 113 - Beanie 114 - Angel Bear Hat 115 - Senhor do Bofim ribbons 116 - Comb 117 - Bell Hat 118 - Pschent 119 - Octopus Eyes 0 - Nothing 1 - Sunglasses 2 - Heart Glasses 3 - Evil Sunglasses 4 - Monocle 5 - Eyepatch 6 - Tuba 7 - 3D Glasses 8 - Glasses 9 - Make Up 10 - Shutter Glasses 11 - Cyclops Glasses 12 - Kitsune Mask 13 - Disguise 14 - Carnival Mask 15 - Creeper Mask 16 - Japanese Headband 17 - Bandages 18 - Eyes Crazy 19 - Skull Mouth 0 - Nothing 1 - Moustache 2 - Straw 3 - Bowtie 4 - Pipe 5 - Rose 6 - Green Lightsaber 7 - Red Lightsaber 8 - Knife 9 - Gas Mask 10 - Clover 11 - Fish Bones 12 - Pacifier 13 - Lollipop 14 - Surgeon Mask 15 - Pumpkin Basket 16 - Red Nose 17 - Buck Teeth 18 - Minecraft Pickaxe 19 - Strawberry 20 - Paint Brush 21 - Ice Lolly 22 - Bone 23 - Donut 24 - Vampire Teeth 25 - Chocolate 26 - Gingerbread Cookie 27 - Chocolate Box 28 - Bouquet 29 - Carrot 30 - Turkish Cake 31 - Bamboo 32 - Japanese Fan 33 - Diploma 34 - Sardine 35 - Candy 36 - Candy Cane 38 - Heart Shaped Lolipop 39 - Tambourine 40 - Beak 41 - Whistle Ear 0 - Nothing 1 - Bow 2 - Spider Earring 3 - Bauble Earring 4 - Flower in Hair 5 - Headphones 6 - Heart Earring 7 - Poisson Earring 8 - Star Earring 9 - Cheese Earring 10 - Lenneth Helm 11 - Earmuffs 12 - Candy Cane Earring 13 - Rose Headband 14 - Anglish Bunny Headband 15 - Holldine Mask 16 - Fish Earring 17 - Spy Glass 18 - Hoop Earrings 19 - Rin Kagamine Hairband 20 - Frankstein Screws 21 - Arrow in the Head 22 - Skull Earring 23 - Frozen Ear 24 - Bunny Earring 25 - Frangipani Neck 0 - Nothing 1 - Tri Coloured Scarf 2 - Bandana 3 - Beard 4 - Flowers 5 - Tie 6 - Green and Grey Scarf 7 - Bell Necklace 8 - Barrel Necklace 9 - Halloween Scarf 10 - Red Wreath 11 - Bowtie 12 - Umbrella 13 - Camera 14 - Striped Tie 15 - Medal 16 - Nazar Hair 0 - Nothing 1 - Punk Hairstyle 2 - Windswept Hairstyle 3 - Normal Male Hair 4 - Fringe 5 - Chanel 6 - Applebloom's Mane 7 - Scootaloox's Mane 8 - Sweetiebell's Mane 9 - Hatsune Miku's Hairstyle 10 - Rin Kagamine's Hairstyle 13 - Golden Curls 14 - Forelock 16 - Levi's hair Tail 0 - Nothing 1 - Diamond 2 - Star 3 - Bow 4 - Heart 5 - Easter Egg 6 - Sun 7 - Moon 8 - Some Chinese Coin Amulet 9 - Halloween Lantern 10 - Bell 11 - Rings 12 - Clover 13 - Berimbau 14 - Winged Scarab 15 - Football 16 - Seashell Particle IDs This section contains a list of particles and their associated IDs, for use in tfm.exec.displayParticle.
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 Titles For a complete and updated list of titles, you can visit this page. The updated Lua Tree can be found in this Lua Documentation topic. Where can I learn Lua? There are several places throughout the internet where Lua is well documented, and there are a lot of tutorials on learning to use it from being a total beginner. What programs can I use to write Lua code? The built in text box in the /lua window isn't particularly good for coding anything longer than a few lines. Tabs don't look right, it's not wide enough to see a lot of code and it doesn't have syntax highlighting, just to mention a few things. While any text editor will do, some external third party text editors or integrated development environments can do a good job of this.
Collaborative Text Editors If you wish to collaborate and code alongside someone else in realtime, there are several tools available to do just that.
Lua Minifiers As there is a 64k character limit imposed when running code with the Module API, any long script may have to be minified. Minification makes the code smaller through practises such as removing linebreaks, whitespace, renaming functions and local variables to shorter alternatives, and the such to help reduce the overall size.
Miscellaneous Resources
Click here to see the most updated change logs of the Lua API.
Dernière modification le 1617727860000 |
Shamousey « Consul » 1411071240000
| 4 | ||
Events are functions that are triggered when a certain thing happens ingame. This is usually when a player performs a certain action, a certain event is called by the code itself, or one of many other things. eventChatCommand(playerName, message) Trigger: This event triggers when a player types a message into the room's chat that begins with a ! character. Arguments:
Example: Code Lua 1 2 3 function eventChatCommand(playerName, message) eventChatMessage(playerName, message) Trigger: This event triggers when a player types a message into the room's chat. Arguments:
Example: Code Lua 1 2 3 function eventChatMessage(playerName, message) eventColorPicked(colorPickerId, playerName, color) Trigger: This event triggers when a player selects a color in a color picker interface. Arguments:
Example: Code Lua 1 2 3 4 function eventColorPicked(colorPickerId, playerName, color) eventEmotePlayed(playerName, emoteID, emoteParameter) Trigger: This event triggers when a player uses an emote. Arguments:
Example: Code Lua 1 2 3 4 5 6 7 function eventEmotePlayed(playerName, emoteID, emoteParameter) eventFileLoaded(fileID, fileData) Trigger: This event triggers when a file is successfully loaded from the system.loadFile() function. Arguments:
Example: Code Lua 1 2 3 4 function eventFileLoaded(fileID, fileData) eventFileSaved(fileID) Trigger: This event triggers when a file has finished saving from the system.saveFile() function. Arguments:
Example: Code Lua 1 2 3 4 function eventFileSaved(fileID) eventKeyboard(playerName, keyCode, down, xPlayerPosition, yPlayerPosition) Trigger: This event triggers when a player presses a key on their keyboard that has been bound with tfm.exec.bindKeyboard(). Arguments:
Example: Code Lua 1 2 3 4 5 6 function eventKeyboard(playerName, keyCode, down, xPlayerPosition, yPlayerPosition) eventLoop(currentTime, timeRemaining) Trigger: This event triggers every 500ms. Arguments:
Example: Code Lua 1 2 3 function eventLoop(timeRemaining, timeRemaining) eventMouse(playerName, xMousePosition, yMousePosition) Trigger: This event triggers when a player clicks on the screen. Arguments:
Example: Code Lua 1 2 3 4 function eventMouse(playerName, xMousePosition, yMousePosition) eventNewGame() Trigger: This event triggers when a new map is loaded. Arguments:
Example: Code Lua 1 2 3 function eventNewGame() eventNewPlayer(playerName) Trigger: This event triggers when a player joins the room. Arguments:
Example: Code Lua 1 2 3 function eventNewPlayer(playerName) eventPlayerDataLoaded(playerName, data) Trigger: This event triggers when a player's data is completed loading from system.loadPlayerData(). Returns "#" if the player's data is not yet loaded on the server. Arguments:
Example: Code Lua 1 2 3 function eventPlayerDataLoaded(playerName, data) eventPlayerBonusGrabbed(playerName, bonusId) Trigger: This event triggers when a player touches a defilante token of type 0 (+1 point). Arguments:
Example: Code Lua 1 2 3 4 function eventPlayerBonusGrabbed(playerName, bonusId) eventPlayerDied(playerName) Trigger: This event triggers when a player dies. It also gets ran when a player leaves the room. Arguments:
Example: Code Lua 1 2 3 function eventPlayerDied(playerName) eventPlayerGetCheese(playerName) Trigger: This event triggers when a player collects cheese. Arguments:
Example: Code Lua 1 2 3 function eventPlayerGetCheese(playerName) eventPlayerLeft(playerName) Trigger: This event triggers when a player leaves the room. Arguments:
Example: Code Lua 1 2 3 function eventPlayerLeft(playerName) eventPlayerMeep(playerName, xPosition, yPosition) Trigger: This event triggers when a player meeps. Arguments:
Example: Code Lua 1 2 3 4 function eventPlayerMeep(playerName, xPosition, yPosition) eventPlayerRespawn(playerName) Trigger: This event triggers when a player respawns, either through bootcamp respawning, the shaman ambulance skill, or tfm.exec.respawnPlayer(). Arguments:
Example: Code Lua 1 2 3 function eventPlayerRespawn(playerName) eventPlayerVampire(playerName, vampire) Trigger: This event triggers when a player becomes a vampire. Arguments:
Example: Code Lua 1 2 3 function eventPlayerVampire(playerName, vampire) eventPlayerWon(playerName, timeElapsed, timeElapsedSinceRespawn) Trigger: This event triggers when a player enters the hole with cheese. Arguments:
Example: Code Lua 1 2 3 function eventPlayerWon(playerName, timeElapsed) eventPopupAnswer(popupID, playerName, answer) Trigger: This event triggers when a player submits an answer in a popup. Arguments:
Example: Code Lua 1 2 3 function eventPopupAnswer(popupID, playerName, answer) eventSummoningCancel(playerName) Trigger: This event triggers when a shaman stops summoning an object. Arguments:
Example: Code Lua 1 2 3 function eventSummoningCancel(playerName) eventSummoningEnd(playerName, objectType, xPosition, yPosition, angle, xSpeed, ySpeed, objectData) Trigger: This event triggers when a shaman has successfully finished summoning a shaman object. Arguments:
Example: Code Lua 1 2 3 4 5 function eventSummoningEnd(playerName, objectType, xPosition, yPosition, angle, objectData) eventSummoningStart(playerName, objectType, xPosition, yPosition, angle) Trigger: This event triggers when a shaman starts summoning a shaman object. Arguments:
Example: Code Lua 1 2 3 4 5 function eventSummoningStart(playerName, objectType, xPosition, yPosition, angle) eventTextAreaCallback(textAreaID, playerName, callback) Trigger: This event triggers when a player clicks a text within a <a> </a> tag in a text area. Arguments:
Example: Code Lua 1 2 3 4 function eventTextAreaCallback(textAreaID, playerName, callback) Dernière modification le 1633655340000 |
Shamousey « Consul » 1411071300000
| 9 | ||
Functions (also known as procedures, subroutines or methods in other programming languages) are sections of code that perform a specific task. The Module API has a slew of different functions that work in Transformice, which allow modules to actually do anything. print(text) Effect: The text here will be displayed to the person that runs the script. If the "#lua" chat tab is open then it'll be displayed there. Arguments:
Example: Code Lua 1 print("This is example text.") debug.disableEventLog(disabled) Effect: Disables the event log from displaying in the chat log. Note: This function is now redundant as its primary purpose was to stop functionality that is now disabled by default. In the past, every time an event was called it'd display a line in the chat showing which event. Arguments:
Example: Code Lua 1 debug.disableEventLog(true) system.bindKeyboard(playerName, keyCode, down, bind) Effect: Binds a key to be listened for. Whenever a player presses a bound key, it will trigger eventKeyboard(). Note: Some keys (such as "A and Q") can act differently between both QWERTY and AZERTY keyboards. Arguments:
Example: Code Lua 1 system.bindKeyboard("Melibellule#0001", 32, true, true) system.bindMouse(playerName, bind) Effect: Binds a player's cursor to allow it to call eventMouse(). If a player's cursor is bound, the event will get executed when they click on the game screen. Arguments:
Example: Code Lua 1 system.bindMouse("Tigrounette#0001", true) system.disableChatCommandDisplay(command, hidden) Effect: Disables chat commands starting with the ! character from displaying in the public chat. Arguments:
Example: Code Lua 1 system.disableChatCommandDisplay("help", true) system.exit() Effect: Deactivates the currently running script. Arguments:
Example: Code Lua 1 system.exit() system.giveEventGift(playerName, gift) Effect: If this function is executed is an event approved by the administrators, this will give the player the appropriate reward for completing it. This was previously seen in the Lua events such as the Toy Factory, Grim's Mansion and Children's Day, where you could unlock a special title for completing a certain task on each of the maps. For more information about Lua events, see this post. This function is only available to members on the Module Team. Arguments:
Example: Code Lua 1 system.giveEventGift("Tigrounette#0001", "titre_enfant_2014") system.loadFile(fileNumber) Effect: Loads a file associated with the account that executed the script. Triggers the eventFileLoaded() function. Usage is limited to once every 1 minute. This function is only available to members on the Module Team. Arguments:
Example: Code Lua 1 system.loadFile(1) system.loadPlayerData(playerName) Effect: Loads a string with custom information about a player that was previously saved. Troggers the eventPlayerDataLoaded() function. This function is only available to members on the Module Team. Arguments:
Example: Code Lua 1 system.loadPlayerData("Tigrounette#0001") system.newTimer(callback, time, loop, arg1, arg2, arg3, arg4) Effect: Creates a timer that will run for a specific amount of time before executing a function or rerunning itself. Returns the timer's ID. This function is only available to members on the Module Team. This is due to the fact timers are very intensive on server resources and need to be used in moderation. Arguments:
Example: Code Lua 1 2 3 system.newTimer(function() system.removeTimer(timerID) Effect: Removes a timer. This function is only available to members on the Module Team. Arguments:
Example: Code Lua 1 2 3 4 5 6 7 8 9 counter = 0 system.saveFile(data, fileNumber) Effect: Save a file associated with the account of the player who executed the script. Usage is limited to once every 1 minute. This function is only available to members on the Module Team. This is due to the fact that files can take up a lot of storage space on the server very quickly. Arguments:
Example: Code Lua 1 system.saveFile("Example string to save.", 1) system.savePlayerData(playerName, data) Effect: Saves custom information about a player. Will only work if the player is in the room. This function is only available to members on the Module Team. This is due to the fact that saving a lot of strings for different people can take up a lot of storage space on the server very quickly. Arguments:
Example: Code Lua 1 system.savePlayerData("Tigrounette#0001", "Example string to save.") tfm.exec.addBonus(type, xPosition, yPosition, id, angle, visible, targetPlayer) Effect: Adds a defilante token to the map. Triggers the eventPlayerBonusGrabbed() function when someone grabs it and it's type is 0 (+1 point). Arguments:
Example: Code Lua 1 tfm.exec.addBonus(0, 100, 350, 10, 45, true, "Tigrounette#0001") tfm.exec.addConjuration(xPosition, yPosition, time) Effect: Spawns a block of conjuration, which is a 10 by 10 pixel grey object fixed in place, seen in some vanilla maps as the shaman can spawn it. Note that the coordinates used in this function are 1/10th the size of a regular map due to their size. They do not spawn offscreen or past X:800 on scrolling maps. Arguments:
Example: Code Lua 1 tfm.exec.addConjuration(40, 20, 10000) tfm.exec.addImage(imageName, target, xPosition, yPosition, targetPlayer, scaleX, scaleY, angle, alpha, anchorX, anchorY) Effect: Displays an image. Returns the ID of the image. Arguments:
Example: Code Lua 1 tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30, 0.9, 0.9, 45, 0.8, 0.5, 0.5) tfm.exec.addJoint(id, ground1, ground2, jointDefinition) Effect: Creates a map editor joint, linking two grounds/physic objects together with special properties or creating a colored line. For more information about joints, see this post. Arguments:
Note: On the map editor, players can also add a 'lua="id"' property in a joint definition in the XML code to be able to interact with it with Lua code. Example: Code Lua 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 --As a physic object is needed for the joint to connect to, this will ensure there's one by creating it. tfm.exec.addPhysicObject(id, xPosition, yPosition, groundDefinition) Effect: Creates a physic object with custom properties. In the map editor, this is known as a ground. Arguments:
Example: Code Lua 1 2 3 4 5 6 7 8 tfm.exec.addPhysicObject(1, 800, 400, { tfm.exec.addShamanObject(id, xPosition, yPosition, angle, xSpeed, ySpeed, ghost) Effect: Spawns a shaman object on the map. Returns the ID of the shaman object spawned, for use in tfm.exec.addImage(), tfm.exec.moveObject() and tfm.exec.removeObject() Note: While anchors are usually considered shaman objects, they can't be spawned with this function. Similarly, some other shaman objects may not spawn correctly and will just display a graphic at coordinates 0, 0. Cannons cannot have their default spawning velocity changed by this function. Arguments:
Example: Code Lua 1 tfm.exec.addShamanObject(10, 400, 200, 45, 50, -20, false) tfm.exec.attachBalloon(playerName, isAttached, colorType, ghost) Effect: Attaches a balloon to player. Arguments:
Example: Code Lua 1 tfm.exec.attachBalloon("Tigrounette#0001", true, 3, true) tfm.exec.changePlayerSize(playerName, size) Effect: Changes the size of a player. Arguments:
Example: Code Lua 1 tfm.exec.changePlayerSize("Tigrounette#0001", 0.5) tfm.exec.chatMessage(message, playerName) Effect: Displays a custom message in the chat to users. This function is only available to members on the Module Team. This is to prevent possible impersonation, spamming, breaking people's chat, and other similar things from happening. Arguments:
Example: Code Lua 1 tfm.exec.chatMessage("<ROSE>[~Moderation] I'm a duck.") tfm.exec.disableAfkDeath(disable) Effect: Disables AFK death, where normally players automatically die if they haven't moved 30 seconds after a round's start. Arguments:
Example: Code Lua 1 tfm.exec.disableAfkDeath(true) tfm.exec.disableAllShamanSkills(disable) Effect: Disables shaman skills, shamans will just have the regular skill set available. Arguments:
Example: Code Lua 1 tfm.exec.disableAllShamanSkills(true) tfm.exec.disableAutoNewGame(disable) Effect: Disables Transformice's automatic new round system. When the timer hits 0 seconds remaining, the current round will continue playing. Arguments:
Example: Code Lua 1 tfm.exec.disableAutoNewGame(true) tfm.exec.disableAutoScore(disable) Effect: Disables Transformice's automatic scoring system so that people don't earn points. Players usually get 16 points for getting in the hole first, 14 points for coming second, 12 points for coming third, 10 points for getting in the hole any other way, or 1 points for dying. Arguments:
Example: Code Lua 1 tfm.exec.disableAutoScore(true) tfm.exec.disableAutoShaman(disable) Effect: Disables the automatic selection of a shaman when a new round starts. Arguments:
Example: Code Lua 1 tfm.exec.disableAutoShaman(true) tfm.exec.disableAutoTimeLeft(disable) Effect: Disables the automatic timer changes that occur when only 2 mice are left alive, or when all mice are dead. Arguments:
Example: Code Lua 1 tfm.exec.disableAutoTimeLeft(true) tfm.exec.disableDebugCommand(disable) Effect: Disables the /debug command and all players that were using it will get it disabled while they are in the room. Arguments:
Example: Code Lua 1 tfm.exec.disableDebugCommand(true) tfm.exec.disableMinimalistMode(disable) Effect: Disables the minimalist mode and all players that were using it will get it disabled while they are in the room. Arguments:
Example: Code Lua 1 tfm.exec.disableMinimalistMode(true) tfm.exec.disableMortCommand(disable) Effect: Disables the /mort command. Arguments:
Example: Code Lua 1 tfm.exec.disableMortCommand(true) tfm.exec.disablePhysicalConsumables(disable) Effect: Disables all physical consumables, meaning that players will no longer be allowed to use them in the map. Arguments:
Example: Code Lua 1 tfm.exec.disableMortCommand(true) tfm.exec.disablePrespawnPreview(disable) Effect: Disables the prespawn preview from shamans in the map, meaning that players will no longer know where the shaman will be summoning an object until it begins the invocation. Arguments:
Example: Code Lua 1 tfm.exec.disablePrespawnPreview(true) tfm.exec.disableWatchCommand(disable) Effect: Disables the /watch command and all players that were using it will get it disabled while they are in the room. Arguments:
Example: Code Lua 1 tfm.exec.disableWatchCommand(true) tfm.exec.displayParticle(id, xPosition, yPosition, xSpeed, ySpeed, xAcceleration, yAcceleration, targetPlayer) Effect: Displays a temporary particle effect to a player or all players. Arguments:
Example: Code Lua 1 tfm.exec.displayParticle(1, 400, 200, 0, 0, 0, 0, "Tigrounette#0001") tfm.exec.explosion(xPosition, yPosition, power, distance, miceOnly) Effect: Creates an explosion that forces nearby objects and mice away, similarly to how a spirit works. Arguments:
Example: Code Lua 1 tfm.exec.explosion(400, 200, 100, 50, false) tfm.exec.freezePlayer(playerName, freeze) Effect: Freezes a player, as in the Stop! shaman skill. Arguments:
Example: Code Lua 1 tfm.exec.freezePlayer("Melibellule#0001", true) tfm.exec.getPlayerSync( ) Effect: Gets the room's sync player. This function is only available to members on the Module Team. Example: Code Lua 1 tfm.exec.getPlayerSync() tfm.exec.giveCheese(playerName) Effect: Gives cheese to a player, if they don't already have it. Triggers the eventPlayerGetCheese() function. Arguments:
Example: Code Lua 1 tfm.exec.giveCheese("Melibellule#0001") tfm.exec.giveConsumables(playerName, consumableId, amount) Effect: If this function is executed is an event approved by the administrators, this will give the player the specified inventory consumable. This was previously seen in the Lua events such as The Unkonwn and Day of the Dead. For more information about Lua events, see this post. This function is only available to members on the Module Team. Arguments:
Example: Code Lua 1 tfm.exec.giveConsumables("Tigrounette#0001", 24, 10) tfm.exec.giveMeep(playerName, canMeep) Effect: Gives a player the ability to "meep", as found in the Vampire Survivor minigame. Players with this ability can press the spacebar every few seconds to make a small explosion, pushing nearby mice away. Arguments:
Example: Code Lua 1 tfm.exec.giveMeep("Tigrounette#0001", true) tfm.exec.giveTransformations(playerName, canTransform) Effect: Gives a player the ability to transform into objects, as found in a few vanilla maps. Players with this ability can choose an object in the board where shaman objects are displayed. Once clicked, they will become a mouse-object. Then, they can press again in the mouse object to become a mouse. Arguments:
Example: Code Lua 1 tfm.exec.giveTransformations("Tigrounette#0001", true) tfm.exec.killPlayer(playerName) Effect: Kills a player instantly, removing them from the current round and making the bubble particle effect in their place. Arguments:
Example: Code Lua 1 tfm.exec.killPlayer("Tigrounette#0001") tfm.exec.linkMice(playerName1, playerName2, linked) Effect: Links two players, as in soulmate maps. Arguments:
Example: Code Lua 1 tfm.exec.linkMice("Tigrounette#0001", "Melibellule#0001", true) tfm.exec.lowerSyncDelay(playerName) Effect: Lowers the synchronization delay between the game and the Lua api for a specificied player, making the update every 400ms (max) instead of the default 500ms. This function is only available to members on the Module Team. This is due to the fact it is very intensive on server and client resources and need to be used in moderation. Arguments:
Example: Code Lua 1 tfm.exec.lowerSyncDelay("Tigrounette#0001") tfm.exec.moveObject(id, xPosition, yPosition, xOffset, xSpeed, ySpeed, yOffset) Effect: Sets the position and velocity of a shaman object on the map. Arguments:
Example: Code Lua 1 2 3 -- As a shaman object is required to move in the first place, one will be spawned here for example. tfm.exec.movePlayer(playerName, xPosition, yPosition, positionOffset, xSpeed, ySpeed, speedOffset) Effect: Sets the position and velocity of a player on the map. Arguments:
Example: Code Lua 1 tfm.exec.movePlayer("Tigrounette#0001", 400, 200, false, 0, 50, false) tfm.exec.newGame(mapCode, flipped) Effect: Starts a new round with a selected map. Arguments:
Example: Code Lua 1 tfm.exec.newGame(3000000) tfm.exec.playEmote(playerName, emoteId, emoteArg) Effect: Forces a player to perform a specific emote. Arguments:
Example: Code Lua 1 tfm.exec.playEmote("Tigrounette#0001", tfm.enum.emote.flag, "fr") tfm.exec.playerVictory(playerName) Effect: Makes a player simulate going to the hole, if they have cheese they will go in and if they don't they will continue as if nothing happened. Arguments:
Example: Code Lua 1 tfm.exec.playerVictory("Tigrounette#0001") tfm.exec.removeBonus(id, targetPlayer) Effect: Removes a defilante token that's been placed in the map. Arguments:
Example: Code Lua 1 2 tfm.exec.addBonus(0, 100, 100, 1) tfm.exec.removeCheese(playerName) Effect: Takes away the cheese from a player. Arguments:
Example: Code Lua 1 2 tfm.exec.giveCheese("Melibellule#0001") tfm.exec.removeImage(imageID) Effect: Removes an image. Arguments:
Example: Code Lua 1 2 imageID = tfm.exec.addImage("1771d446c03.png", "%Tigrounette#0001", -21, -30) tfm.exec.removeJoint(id) Effect: Removes a joint from the map. Arguments:
Example: Code Lua 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 local x1, y1 = 200, 200 tfm.exec.removeObject(id) Effect: Deletes a shaman object from the map. Arguments:
Example: Code Lua 1 2 id = tfm.exec.addShamanObject(10, 400, 200) tfm.exec.removePhysicObject(id) Effect: Removes a physic object from the map. Arguments:
Example: Code Lua 1 2 tfm.exec.addPhysicObject(1, 400, -600, {type=0, width=10, height=10, foreground=true, friction=0.3, restitution=0, dynamic=false, miceCollision=true, groundCollision=true}) tfm.exec.respawnPlayer(playerName) Effect: Respawns a player if they're dead. Triggers the eventPlayerRespawn() function. Arguments:
Example: Code Lua 1 tfm.exec.respawnPlayer("Tigrounette#0001") tfm.exec.setAutoMapFlipMode(flipped) Effect: Sets whether the following maps should be flipped (always, never, or TFM's default behaviour). Arguments:
Example: Code Lua 1 tfm.exec.setAutoMapFlipMode(true) tfm.exec.setGameTime(seconds, init) Effect: Sets the time left on the current round. Arguments:
Example: Code Lua 1 tfm.exec.setGameTime(600, true) tfm.exec.setNameColor(playerName, color) Effect: Sets the color of the name that appears above a player's mouse, overwriting any previous color they may have (for example, friends' names are green). Arguments:
Example: Code Lua 1 tfm.exec.setNameColor("Tigrounette#0001", 0xFFFFFF) tfm.exec.setPlayerScore(playerName, score, add) Effect: Changes the score a player has. This score is found in the tfm.get.room.playerList table, and can be seen on the scoreboard next to the chat. Arguments:
Example: Code Lua 1 tfm.exec.setPlayerScore("Tigrounette#0001", 25) tfm.exec.setPlayerSync(playerName) Effect: Defines the new room's sync player. This function is only available to members on the Module Team. Arguments:
Example: Code Lua 1 tfm.exec.setPlayerSync("Tigrounette#0001") tfm.exec.setRoomMaxPlayers(maxPlayers) Effect: Sets the maximum amount of players allowed in the room. If the room is full of players up until this amount, anyone trying to join will be redirected to another room, for example room "#module" would redirect them to room "#module1". This function is only available to members on the Module Team. This is so that people can still access their own tribe house regardless of what script is ran inside. Arguments:
Example: Code Lua 1 tfm.exec.setRoomMaxPlayers(5) tfm.exec.setRoomPassword(password) Effect: Sets the room password. If the room is protected by a password, whoever tries to join it will need to know the pass to enter the room. This function is only available to members on the Module Team. This is so that people can still access their own tribe house regardless of what script is ran inside. Arguments:
Example: Code Lua 1 tfm.exec.setRoomPassword("lua") tfm.exec.setShaman(playerName, makeAShaman) Effect: Makes a player a shaman. Arguments:
Example: Code Lua 1 tfm.exec.setShaman("Tigrounette#0001", true) tfm.exec.setShamanMode(playerName, mode) Effect: Changes the shaman mode of a player while they are in the room. Arguments:
Example: Code Lua 1 tfm.exec.setShamanMode("Tigrounette#0001", 2) tfm.exec.setVampirePlayer(playerName, makeAVampire) Effect: Turns a player into a vampire, as seen in the Vampire Survivor minigame. Vampires have red names and will randomly infect nearby mice, turning them into vampires too. Arguments:
Example: Code Lua 1 tfm.exec.setVampirePlayer("Tigrounette#0001", true) tfm.exec.setWorldGravity(wind, gravity) Effect: Sets the wind and the gravity of the current map. Arguments:
Example: Code Lua 1 tfm.exec.setWorldGravity(-5, 5) tfm.exec.snow(time, power) Effect: Makes snow fall onto the screen, as used in Christmas events. Arguments:
Example: Code Lua 1 tfm.exec.snow(60, 10) ui.addPopup(id, type, text, targetPlayer, xPosition, yPosition, width, fixedPosition) Effect: Creates a popup on a player's screen with custom text. The popup's height will automatically adjust to fit the text displayed on it. Arguments:
Example: Code Lua 1 ui.addPopup(1, 0, "Example text to display.", nil, 180, 300, 200, true) ui.addTextArea(id, text, targetPlayer, xPosition, yPosition, width, height, backgroundColor, borderColor, backgroundAlpha, fixedPosition) Effect: Creates an area on the screen with custom color, size, and text displayed on it that can be clicked on. Arguments:
Example: Code Lua 1 ui.addTextArea(1, "Example text to display.", nil, 350, 180, 100, 40, 0x324650, 0x212F36, 0.8, true) ui.removeTextArea(id, targetPlayer) Effect: Removes a text area completely, stopping it from displaying and not allowing it to be clicked on. Arguments:
Example: Code Lua 1 ui.removeTextArea(1, nil) ui.setMapName(text) Effect: Sets the text at the top-left of the UI that displays the current map's code and author by default. The map's perm icon is kept the same. Arguments:
Example: Code Lua 1 ui.setMapName("Tigrounette is smelly") Dernière modification le 1641482760000 |
Shamousey « Consul » 1411071300000
| 2 | ||
ui.setShamanName(text) Effect: Changes the text in the top bar where the shaman's name is usually displayed. The text "Shaman:" is kept there. Arguments:
Example: Code Lua 1 ui.setShamanName("Melibellule is a kangaroo") ui.showColorPicker(id, targetPlayer, defaultColor, title) Effect: Displays a color picker where a player can select a color. Arguments:
Example: Code Lua 1 ui.showColorPicker(1, nil, 0x3A81A0, "Color for moderators") ui.updateTextArea(id, text, targetPlayer) Effect: Replaces the text on a text area with something else. Arguments:
Example: Code Lua 1 ui.updateTextArea(1, "This is some different text.", nil) Dernière modification le 1621104600000 |
Shamousey « Consul » 1411071300000
| 1 | ||
You can find the previous Module API FAQ here. http://atelier801.com/topic?f=6&t=365251 Dernière modification le 1617410400000 |
Safwanrockz « Censeur » 1411071540000
| 0 | ||
Beautiful remake, gj Liam. o/ |
Haruhitastic « Censeur » 1411071600000
| 0 | ||
very fancy even though i've still no clue whats going on that list of who runs what game is very helpful thaaaank |
Makinit « Citoyen » 1411072200000
| 1 | ||
how lua pls |
Shamousey « Consul » 1411073220000
| 0 | ||
I hope this thread is useful for people! *-* Now there's the full list of shaman object IDs now (it's probably the biggest list of object IDs you've seen, thanks Ykr for telling me a large number of those newer ones), examples of what each function does and descriptions of each argument, much clearer styling and formatting, and generally something I know I'll be referring to myself. |
Cheetahkitty « Citoyen » 1411081920000
| 0 | ||
Wow Gj shamousey ^^ |
Shenato « Citoyen » 1411083600000
| 0 | ||
I'm impressed... |
0 | ||
I'd have loved to have this thread like this back when I started with the API and Lua. I'm sure the changes will be of much help to some people. Great work! |
0 | ||
Pretty useful, thanks! \o |
Oguzhandkr « Citoyen » 1411143180000
| 0 | ||
Thanks Shamo! *-* |
Hotspotower « Citoyen » 1411143180000
| 0 | ||
Thanks. |
Neonstrayzer « Citoyen » 1411143240000
| 0 | ||
Thanks. |
Drgenius « Citoyen » 1411147560000
| 0 | ||
Sweet! Finally the full documentation with IDs and all is actually on the forums! Thanks Shamo! This is going to be very useful I'm sure. ^_^ |
Leafileaf « Citoyen » 1411182060000
| 0 | ||
Liam just a few things 2600-2699 spawns blue portal too, but it still has art. 2700-2799 spawns orange portal Invisible apples don't work (I think it should be noted) |
Drgenius « Citoyen » 1411185600000
| 0 | ||
May I suggest formatting the method names to indicate whether or not they are for use by everyone or just the Module Team? On the wiki it's underlined. I think it will save newbies a lot of time. Also something that would be neat is coloring for each type of argument required (or sent in events), for example, green for string, white for int, blue for float, orange for bool, etc. Just a thought. |
Benbirkralm « Citoyen » 1411198800000
| 0 | ||
Perfect thread. Thanks! |