mrtumbles's Recent Forum Activity

  • WOW! R0j0hound to the rescue. I'll check those out now.

    Yeah I find myself using large text files more and more. It started just for populating arrays and dictionaries using CSV-formatted files. Then I started using a grammar system for use with my procedural generation, and that required some quite complex data structures, so I wrote a sort-of scripting language to fill multiple structures at once.

    The project that this will make the most impact on is my take on http://www.puzzlescript.net/. C2 is a beautiful environment, and I've always had a real fondness for middleware in general (Klik&Play4Lyfe). So now I'm making my own! It's still early days yet - I've been working on it in-between a related project (a Berlin roguelike) and trying to adult. Your plugin will speed things up dramatically though.

    I'm aiming to add some extra functionality to the PS system by adding things like player inventory support, better support for real-time games, maybe an entity-component system to handle variables on objects. The rough idea is to extend Puzzlescript to be able to make something a little closer to an early Zelda game, or similar.

  • I find myself writing a lot of projects which use either a home-brew scripting language or some sort of complex grammar. As I build the projects I pass around increasingly large text files to parse, and the error handling gets more and more complicated. Although I can always text out to an editor like Notepad++ to read line numbers, this becomes laborious - particularly with long scripts. More importantly, I would like to enable users of my projects to access these input methods themselves.

    My request is for a plugin that will display text with line numbers. Other projects exist (details below) which satisfy this function and many more, such as syntax highlighting etc - although I personally am only really here for the line numbers. If porting an existing system is not an option, perhaps there is some way of 'faking' this in C2 with a custom textbox plugin?

    Projects like https://codemirror.net/ or http://codepress.sourceforge.net are far more complex than I strictly need, but if anyone else can see the added value in making a C2 plugin for one of those (or their alternatives) that would suit. Less daunting and just as suited to my purposes (although not as useful to others who might seek a similar plugin) is http://alan.blog-city.com/jquerylinedtextarea.htm , which is a simple text area with lines written using jQuery.

  • Oh! The white-space is significant, thank you for the heads-up! After I solved the problem yesterday my scripts started to get a little longer, and I'd like to add line numbers proper now. Any ideas?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've added a scripting language to a project, so naturally dropped a Text area in for debugging and quickly throwing scripts around. The parser can output errors, and give me line numbers for those errors in the script. However, with wrapping on it's awkward to work out line numbers. I think I've exhausted styling options with CSS, as wrapping is traditionally handled from the HTML end of things apparently.

    So there we have it: does anyone know how to disable wrapping on a Textarea?

    [ Edit: An alternative question, as this is the longer way I see of getting line numbers: How can I specify a width for a textarea in characters, ie: columns? I know this can be specified in HTML, and should be specifyable by setting the CSS 'width' property to '40em' or whatever. Setting the width works, but even with all padding etc specifically set to 0, the width is waaaay over the specified value. ]

    [Edit 2: Solved. It turns out if you set the CSS 'white-space' to 'nowrap' it works. I actually discovered this by being told it didn't work, and trying it anyway - which just goes to show... something.]

  • The harder you blow, the louder the noise coming into the mic. If you can detect the db-level somehow, you could use that as an input - although it probably wouldn't be very accurate

  • If you use the 'Sort' action on the array, it will sort by whatever is in the first column - so you should be able to go ahead and use 'Sort'

  • (Do check out 'Paster' though - it's a really neat plugin. I uninstall almost every plugin I download pretty much instantly (not a fan of clutter) but Paster has been with me a while)

  • Oooooh! Noted, thanks!

  • This is an issue I've butted heads with. Instead of using snapshots, try using a plugin called 'Paster' by r0j0hound. It's free, and really easy to use And it has a lot of different applications, this being just one.

  • Array.AsJSON is a string of text in JSON format that described the data in an array. You can download a JSON of an array using the Array's action 'Download'. You can store the JSON by storing Array.AsJSON. You can load data into an array by using the Array's 'Load' action, in which you must specify a string of data in JSON format.

    So to save data simply set a localstorage value to Array.AsJSON

    And to load data, get the localstorage value, and pass it to Array>Load

    No sample capx as no upload capability, sorry <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">

    https://www.scirra.com/manual/108/array

  • If the JSON is stored as a project file and loaded on start, the file will be saved locally, yes.

  • Store values that represent the line on an array, store the Array.AsJSON in a localstorage value. When you re-load the data into the array, draw the line

mrtumbles's avatar

mrtumbles

Member since 1 Jan, 2013

Twitter
mrtumbles has 8 followers

Connect with mrtumbles

Trophy Case

  • 11-Year Club
  • x5
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Email Verified

Progress

14/44
How to earn trophies