Page 2 of 8 FirstFirst 1234 ... LastLast
Results 26 to 50 of 188

Thread: Atom Text Editor Plugin Feedback

  1. #26
    I've just created my first steam workshop item for TTS using Atom and I've got crazy. At the end I hated it very hard.

    The problem is triggering "Save and Play" in Atom makes my LUA script re-load and my cursor jump at the beginning.

    So, for example, I need to modify some variable in the middle of the script. I press "save and play", alt-tab to TTS, look at the scene, alt-tab back to Atom and my cursor is at the beginning of the file. I need to scroll to that place again and again.

  2. #27
    Join Date
    May 2016
    Posts
    1,072
    Small thing to help: code map. Saves you a ton of scrolling

  3. #28
    Join Date
    Sep 2016
    Posts
    216
    Quote Originally Posted by soulburner View Post
    I've just created my first steam workshop item for TTS using Atom and I've got crazy. At the end I hated it very hard.

    The problem is triggering "Save and Play" in Atom makes my LUA script re-load and my cursor jump at the beginning.

    So, for example, I need to modify some variable in the middle of the script. I press "save and play", alt-tab to TTS, look at the scene, alt-tab back to Atom and my cursor is at the beginning of the file. I need to scroll to that place again and again.
    I imagine this was done to fix the previous bug with the code being out of sync with the game. I agree that it is extremely annoying, though. Also, when you have 50+ scripts open for various objects, it can take a really long time to "play and run" scripts.

    Quote Originally Posted by MrStump View Post
    Small thing to help: code map. Saves you a ton of scrolling
    That'd help. +1

  4. #29
    Join Date
    May 2016
    Posts
    1,072
    Oh and to be clear, the code map exists. Its called "minimap". Search for that in Atom's packages (the same play you went to search for tabletopsimulatorapi). It makes my life a lot easier.

  5. #30
    Join Date
    Sep 2016
    Posts
    216
    Quote Originally Posted by MrStump View Post
    Oh and to be clear, the code map exists. Its called "minimap". Search for that in Atom's packages (the same play you went to search for tabletopsimulatorapi). It makes my life a lot easier.
    Oh I completely misunderstood your meaning. Thanks for the tip!

  6. #31
    I've created a pull request with some snippets added/updated.

    While the plugin seems to be set up to intercept any game finishing loading and to pull scripts from there, please give us an option to ONLY pull scripts with the menu button. Once because re-loading all scripts in Atom resets the file and position you had open (that's annoying like hell with small changes and I just saved these changes, I don't want to reload it all!), second because sometimes it's useful to load another table for a second - to pull an item, check something or just take a break. Aaaand of course Atom loads it all again.

    Thanks!

  7. #32
    Join Date
    Sep 2016
    Posts
    216
    This isn't necessarily an Atom problem, since it happens with the built-in editor as well, but the following scenario is super annoying:

    Code:
    1) game is saved
    2) pull an object out of a container or stack
    3) edit that object's script
    4) save and play
    Game is reverted to previous save state
    5) pull out the same object again, script is unchanged
    This cost me more than an hour's work one time when i edited many objects' scripts. Even understanding how it works now, I occasionally forget and end up losing some changes. Please come up with a solution to this.

  8. #33
    @Sancho, you have to save (as in menu -> save game) any time you create a new object on the table in order to save script changes on it. Creating new object includes pulling from bags or chest, changing states etc.

    While this is annoying if you forget to save before changing, it is a godsend if you create many objects while testing and just have then automatically cleaned up every save-and-play. And I also lost lots of work cause of it, this functionality made me Ctrl-A Ctrl-C whole script before any save-and-play months ago heh.

  9. #34
    Join Date
    Sep 2016
    Posts
    216
    Quote Originally Posted by dzikakulka View Post
    @Sancho, you have to save (as in menu -> save game) any time you create a new object on the table in order to save script changes on it. Creating new object includes pulling from bags or chest, changing states etc.

    While this is annoying if you forget to save before changing, it is a godsend if you create many objects while testing and just have then automatically cleaned up every save-and-play. And I also lost lots of work cause of it, this functionality made me Ctrl-A Ctrl-C whole script before any save-and-play months ago heh.
    I agree that having objects cleaned up is very nice. I just want to have my cake and eat it too. Maybe the best solution would be to make scripts for objects that were not present in the last save un-editable.

  10. #35
    Join Date
    Sep 2016
    Posts
    216
    Here's a bit of a rant from an unfortunate event yesterday, but I'll tie it into many of the problems I've experienced with the scripting experience recently.

    I was working on the script for an object. After making many changes I did a ctrl-a + ctrl-c, which I have gotten into the habit of doing since it isn't exactly clear if my changes will save or not.

    Issue #1: It is not clear from the editor when the script file you are working on will be successfully saved or not. Code which is not saved is not backed up in any way

    I save and run my code, quickly realizing that I had forgotten that I switched the object to another state, thereby losing the original object I was working on. Whew, good thing I did that ctrl-c. I switch back to the editor and see that, yes, my changes to the script weren't saved. I ctrl-a + ctrl-v, then save and run the code. As it turns out, the global script hadn't finished loading, and in that instant that I ctrl-a + ctrl-v, my global script finally finished loading and the tab had switched to it. I had pasted over the entirety of my global script without noticing.

    Issue #2: running the script causes a reshuffle of tabs and scroll position

    Oh crap, why am I getting weird errors?? Oh god, I just saved over my entire global script. Ctrl-Z!!

    Issue #3: running the script erases all undo data

    Fortunately, I had routinely backed up my scripts. Unfortunately, it had been 4 hours earlier. On the bright side, it's surprising how quickly you can rewrite code.

    Bonus:

    Issue #4: Atom crashes, on average, about once per day.

    I don't think I've used a text editor that crashes so often, though I realize this probably has nothing to do with the plugin.


    I don't know the best solution for these problems, but here are some ideas:
    • Save an object's script even if it is destroyed, but restore all other aspects of that object back to the previous save.
    • Create a backup folder for the last scripts edited.
    • Automatically backup a save before scripts are imported from atom.
    • Only reload scripts when the user initiates a load. Not when scripts are run.
    • When an object is destroyed in the game, remove the object's script from the editor if it is unedited.

  11. #36
    It’s pretty neat, but it turns any non-Latin Unicode characters into “???????????” whenever I use Get Lua Scripts or Save and Play (e.g. Cyrillic letters, Spanish letters like etc). This includes characters entered in Atom (which appear as they should until I press Save and Play) and in the in-game editor. Looking forward for a fix. Should I report this as an issue on GitHub?
    Last edited by Savv; 01-20-2017 at 11:50 PM.

  12. #37
    You can use utf8 code inside your strings as a fix. It's not pretty, it's not easy but it works.
    -> '' = '\u{e9}'
    -> '' = '\u{d1}'

  13. #38
    Quote Originally Posted by olih View Post
    You can use utf8 code inside your strings as a fix. It's not pretty, it's not easy but it works.
    -> '' = '\u{e9}'
    -> '' = '\u{d1}'
    Thanks, olih. I already use that trick. It’s just a bit painful that I can’t read my own strings, they all look like this: '\u{0422}\u{0435}\u{0439}\u{0431}\u{043B}\u{0442}\ u{043E}\u{043F}'. I’ve resorted to adding a comment in English to each one.

    At least you can convert any text to this format with this tool: https://r12a.github.io/apps/conversion/

  14. #39
    I've forked the atom plugin to fix some of the stuff I've been most annoyed about, the fork is here:

    https://github.com/onelivesleft/atom...psimulator-lua

    Changes:

    • When you Get Lua Scripts or Save And Play the cursor is restored to its previous position.
    • No longer autocompletes nonsense when you type “do” at the end of a line (at a for loop for instance)
    • Built in functions now only autocomplete at the point you've typed "function " (not after you've typed your own function name)


    • Updated Object and Player autocompletes to reflect current docs. I didn't remove any autocompletes already in the plugin which aren't in the current docs because I don't know if they are removed/deprecated or simply undocumented.


    Code:
    Members added:
    
    grid_projection
    host
    broadcast( string message )
    broadcast( string message, Color )
    print( string message )
    print( string message, Color )
    setHandTransform( Table Transform)
    getPlayers()
    getSpectators()
    getStates()
    getTransformForward()
    getTransformRight()
    getTransformUp()
    highlightOff()
    highlightOn( color, duration)
    isSmoothMoving()
    positionToLocal( Vector )
    positionToWorld( Vector )
    putObject( Object put_object )
    randomize()
    reload()
    setAngularVelocity( Vector )
    setLock( bool lock )
    setVelocity( Vector )
    
    • Fixed typo: displayText: 'wrap(funtion f)'

  15. #40
    @onelivesleft

    Holy, pull request that stuff ASAP!

  16. #41
    Join Date
    Sep 2016
    Posts
    216
    Great work!

  17. #42
    Join Date
    May 2016
    Posts
    1,072
    Very nice, thank you for doing this.

    If someone is capable, there are some other new functions that could be added to the auto-complete system that weren't in this update. If they were added, it would also be great. If needed, I could assemble a list

    But either way, the basic quality of life stuff (like the destroyObject trying to autocomplete after "do") is just fantastic

  18. #43
    @dzikakulka
    I was wanting to test it a bit before that, but none of the changes were at all volatile so sure

    @MrStump
    If you've got a list then sure, I can have a look tonight.

    I feel like there was one other really annoying autocompete similar to the 'do' one, but I can't remember exactly what it is. If anyone has something then post it.

    Members I left in which are not present in the docs were:
    Code:
    Object:
    getStatesCount()
    lock()
    unlock()
    
    Player:
    blind()
    unblind()
    changeTeam()
    Should they be removed?
    Last edited by onelivesleft; 07-05-2017 at 03:41 AM.

  19. #44
    @Sancho
    I'm gonna have a look at using this atom package to mitigate a lot of the problems you've described above (which I've experienced as well):

    https://github.com/Nicolab/atom-local-history

  20. #45
    Join Date
    May 2016
    Posts
    1,072
    Those members were depreciated and replaced (Player[color].blindfolded = true/false replaced Player[color].blind() and Player[color].unblind() for example). They still work but aren't meant to be used anymore. I think you can take them out.

    I also noticed that now I am not getting auto-complete options for API Default events. If I type "function onObject..." I am getting nothing. If that was intentional, it is a feature I will miss.

    Code:
    Player[color]
        getHandTransform()
    
    http://berserk-games.com/knowledgebase/scripting-physics/
    New static global class: Physics
        Ex: Physics.cast(table)
        cast(table)
        getGravity()
        setGravity(table_vector)
    
    http://berserk-games.com/knowledgebase/scripting-lighting/
    New static global class: Lighting
        EX: Lighting.getAmbientEquatorColor()
        Everything on this page would have to be added X/ sorry
    That's everything I could find. I saw you made some improvements I didn't see listed so you got almost everything. I only found 1 you missed besides the 2 new classes that got added, you do damn fine work

  21. #46
    I changed the function calls so that they appear when you type "function " but not anything more; I'll make it a bit smarter than that. Will add the ones you've listed.

  22. #47
    OK, have updated:

    Restored API Event autocompletes - now suggests function names until you type "("

    Automatically insert end of control blocks:
    • do...end
    • then...end
    • repeat...until
    • function...end (need to disable bracket matching for parenthesis in atom for this one)

    Removed deprecated members: blind(), unblind(), lock(), unlock(), changeTeam().
    -- Left getStateCount() in as it doesn't seem to have a direct replacement.

    Added autocompletes for Physics & Lighting classes, and Player[color].getHandTransform()

    ---

    The local-history package for atom I mentioned above (you can find it in atom's built-in package installer) seems to work well as a safety net for your code getting blitzed.
    Last edited by onelivesleft; 07-05-2017 at 04:13 PM.

  23. #48
    Join Date
    May 2016
    Posts
    1,072
    The "replacement" for getStateCount() is #getStates()+1

    But I think its a good idea to leave it. Looks great!

  24. #49
    I may be biased in that I think that Lua is the ass-end of awful, but I have zero faith in the # operator returning the value I expect, so I never use it :P

  25. #50
    Join Date
    Jan 2014
    Posts
    986
    Thanks a bunch for that pull I merged and pushed the update to Atom.

Page 2 of 8 FirstFirst 1234 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •