Powder Toy Multiplayer Script

  • cracker64
    22nd Dec 2013 Developer 49 Permalink
    This script is exactly what it sounds like, it adds fully working multiplayer in TPT. It is MUCH different from my previous one, there is now a master server, where clients connect and can chat. You can create channels and invite friends into your channel name for private sessions.

    To get started, run '/connect' in the main chat window, you'll be connected into the lobby room. To join a more private room, type '/join [name]' . Simply give that channel name to anyone you want to play privately with and have them join.

    To Install, open the console (~ key) and enter tpt.getscript(2, "autorun.lua", 1)
    Alternate Script server link (v1.0)
    TPTMP does not work on the Android port, and you will not be able to connect to any servers even if installed

    I highly recommend also using my Script Manager, which makes loading and updating scripts WAY easier. To get the script manager, enter tpt.getscript(1, "autorun.lua", 1) into the console. Then simply open it, go to the Online tab, and download "TPTMulti". It will be downloaded and then automatically run every time you open TPT. If there is ever an update to tptmp, simply open the online tab again and there will be an "Update" button next to the script.

    You can see the entire source and follow progress on my github: https://github.com/The-Powder-Toy/tptmp

    Version 1.0.3:
    Compatibility with the snapshots and TPT 96.0
    Fix issue in jacob1's mod where the F1 and ctrl+h hotkeys were disabled

    Version 1.0.2:
    Update user authentication process to integrate better with the website. This update is required to join the server

    Version 1.0.1:
    Fix issue in the authentication protocol that allowed for token re-use

    V1.0:
    Jacob1 finally accepted that it's ok to release TPTMP 1.0
    TPTMP logins are now authenticated - your username will be verified by the TPT server
    If an incorrect username is given, it will be automatically changed to the correct one
    If you don't have an account or are banned from TPT, you will be moved to the guest lobby
    The guest lobby is the room named 'guest'
    Guests are unable to join the authenticated lobby, but may join any other channels
    Channel name now shown in upper left
    Add /clear command to show chat history
    Add /lobby command to join lobby
    Add ctrl+c, ctrl+v, and ctrl+x support to the textbox
    Right click a line in history to copy it
    Fix error when trying to disable or replace TPTMP
    QoL updates were contributed by Geniusz1
    Authentication updates were contributed by LBPHacker

    V.101:
     Fix debug print spam when using zoom window
     Fix mouseclicks being sent when creating or loading stamps
     Fix error when creating stamps
     Fix pause state not syncing when loading a stamp pauses the game

    V.100:
     Upgrade to 94.0 event api
     Fix '/' not working on some keyboard layouts
     Fix negative mouse coordinates error
     More aggressively send syncs when using the reload button, using local saves, or using undo / redo
     Fix pause state not being synced properly in rare cases involving the reload button
     Fix GoL elements and stasis wall
     Fix ctrl/shift/alt getting stuck down for others when entering other interfaces
     Fix some issues that could cause mouse to get stuck in the drawing state for others
     Fix lines / boxes not being drawn for others when the mouse is released outside of the simulation area
     Fix some other obscure syncing issues with drawing
     Wall / flood fill cursors shown properly for others

    V.9:
     Support TPT 91.4
     Fix walls
     Other fixes which make this not compatible with TPT 91.3 or TPTMP .87

    V.87: Support TPT 91.0
    V.86 Fix jacob1's mod being very broken
    V.85 Fix AIR and VAC being reversed

    V.84:
     Update server address to eventually point to new location, tptmp.starcatcher.us
     Rate limit messages sent to the server
     Better line wrapping
     Support AIRBLOCK wall
     Support Lua 5.2

    v.83 save /size info if script manager >= 3.2 is loaded, fix some window defocusing issues, fix /kick and /send
    v.82 add /size, support CAPS LOCK, and fix legacy heat syncing issue
    v.81 Fix error when sending stamps
    v0.8 Support replace mode and specific delete

    v0.72 Chat history with up/down arrows. Various other fixes
    v0.71 New server location, update needed
    v0.7 More fixes to ensure the best experience.

    v0.6 Fixes from Jacob1, ESC key closes chat window, Change a few message colors

    v0.52 Various Fixes
    v0.5 Initial Release


    Bugs:
    Stickmen can't be controlled
    Signs don't sync either
    Maybe some other syncing issues, /sync can fix these

    [[screenshots here]]
    Album with some more pictures: https://imgur.com/a/WYUDd
    Edited 45 times by cracker64, jacob1. Last: 4th Jun 2021
  • boxmein
    23rd Dec 2013 Former Staff 3 Permalink
  • Schicko
    23rd Dec 2013 Member 0 Permalink

    Many thanks cracker! I'm pretty sure you hear this a lot, but you are osum.

     

    Unfortunately, I can't test this out till 6 hours later as my internet has been automatically disabled :L

    Stupid Kaspesky!

     

    Edit: @mniip (View Post) OK, didn't know you worked on it as well, sorry. You're osum too ^_^

    Edited 2 times by Schicko. Last: 23rd Dec 2013
  • mniip
    23rd Dec 2013 Developer 0 Permalink
    @Schicko (View Post)
    that [REDACTED] never even credited me for the server :(

    EDIT: i'm working on the ui :\
    Edited 2 times by mniip, jacob1. Last: 2nd Sep 2014
  • jacob1
    23rd Dec 2013 Developer 0 Permalink
    very fun, a lot of people from irc like me, @cracker64, @wolfy1339, @4722202468, @cj646464 were all on (not all at once, but up to 4 at once which is much better than the original)

    And it doesn't even require port forwarding :) you just download the script and the server is always on.

    @mniip (View Post)
    lol. The UI got many last minute improvements that would be hard to live without. But an entire redo would be nice if it looks good. Keep in mind that the chatbox gets in the way often, figure out some way to fix that.
    Edited once by jacob1. Last: 23rd Dec 2013
  • Box-Poorsoft
    23rd Dec 2013 Banned 2 Permalink
    This post is hidden because the user is banned
  • mniip
    23rd Dec 2013 Developer 0 Permalink
    @jacob1 (View Post)
    he was talking more about the whole ui lib, i.e a set of OOP-based components, not just the location and look of buttons
  • jacob2
    23rd Dec 2013 Member 2 Permalink
    Yes, I did say 'redo', I know it was going to be a separate lib usable for anything. It just needs the features to make this specific script work well.
  • Schneumer
    23rd Dec 2013 Member 0 Permalink

    Heck yeah! So beta multiplayer? Gotta get one! WOOOOT

    Edit: I downloaded both and put them in the folder of all my tpt stuff (the game and whatever comes with it) now what?

    Edit: Wait, i downloaded as notepad....and i not supposed to? I don't have a autorun.lua thing......

    Edited 2 times by Schneumer. Last: 23rd Dec 2013
  • Cacophony
    23rd Dec 2013 Member 0 Permalink

    @Schneumer (View Post)

    Save the file as autorun.lua and put it in the same folder as TPT.

    or if you've the manager:

    Save it as (anyname).lua and put it in the scripts folder (make one if you don't have one) Click on the Lua button on the right side.

    or:

    Save as (anyname).lua and load the console.Type in dofile("(nameofscript).lua")

    Edited once by Cacophony. Last: 23rd Dec 2013
Locked by jacob1: legacy, v2 is now released - https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=25400