R0J0hound's Forum Posts

  • Have you seen the ask manual?

    construct.net/en

    It has more details about most of that.

  • I’d imagine there are no downsides. It’s just a form control so it’s simple enough to do. In the history of scirra though, they usually defer to third party plugins instead of making it themselves. No idea if they’d want to add it though. It’s usually easier and faster to implement it myself with js. That’s completely against the no programming required mantra, but it gets me going with something before I lose interest.

  • Thanks!

    I added a cheap perspective ability to the 3d rotate capx as a test. Ended up working decently.

  • Decided to have a go at it and it came out fairly simple. Well, it does touch on many different concepts. The language I came up with has an assembly/zzt feel to it.

    construct.net/en/forum/construct-2/your-construct-2-creations-23/more-rojo-tests-138761

  • Pandy

    I got carried away with some ideas and I posted an example here:

    construct.net/en/forum/construct-2/your-construct-2-creations-23/more-rojo-tests-138761

    Came out pretty clean. The idea is you generate the cube image any way you want, then only once per frame load an animation frame.

  • I'm going to start posting miscellaneous capx projects I have here from time to time.

    Here is simple way to rotate a bunch of 3d points. It also utilizes the paster object to generate a cube image.

    uc61e28ffd9c45105984477e2c56.dl.dropboxusercontent.com/cd/0/get/Ch7rT_NL_0FqXMHC1vulSlB-BF-yPKtR1eN1ktaw8kPXvF3cH0di5irbTjbeL9BbP5_ygK6QPvma2pa1N4K8VGk-QT8ow5mDS_cVAMBYyQu2CKDxTHc3q73rwery2wu8yik/file

    This is a simple programming language and interpreter test. It has boolean variables, if's and goto. Kind of has an assembly like feel to it. I kind of fudged on error checking but it works well.

    uc7ae2c071507add2db940bad361.dl.dropboxusercontent.com/cd/0/get/Ch5hooeOySCwsf8DRBQc1Ljd9r8C9kiCGFNLBBZjGE0vVCxwQYB_xpJwB7wVSnFRDAieF4jYuaqoKcK1fYkORm4yf8Zm0PT8tiT17RAilCv5l6nnwPVDgpK7Idlr0_tpfN4/file

    Example script that moves from wall to wall:

    forward
    if angry forward
    ifnot wall goto end
    log ouch
    set angry
    right
    right
    :end
  • I have a discord I haven’t used in ages. I probably should install it again.

    Edit:

    My discord name is reddog

    Had a look in your capx. Didn’t have “Rex function” or “polygon” installed so I removed them. Looks like one wasn’t used and the other, polygon was just another option from paster.

    I will say the polygon plugin is probably your biggest bottleneck. It has the same issue the canvas plugin had. It draws to a hidden canvas first and is copied to a webgl texture. This is slow and uses a lot of memory when drawing many polygons.

    I noticed you’re using some JavaScript. I usually define the functions once in a start of layout. To make the functions accessible later you’d define them as

    window.myfunction = function(){};

    Instead of

    var myfunction = function(){};

    Or

    function myfunction(){}

    And the beauty of it is you’d still be able to call the function as myfunction().

    Window is the global object.

    You can do it with just events as well. Might look more readable.

    One thing I do to make my expressions more readable is to avoid using tokenat or even array.at as much. Probably just a personal preference.

    For max performance you could do almost everything in JavaScript and only do minimal stuff in events like add cubes, set the view rotation, and request it to be drawn. Kind of loses the fun of using construct though if you run into js errors.

  • Last I looked you can get at the runtime parts of the plugins when you are previewing. Open up the browser’s debugger and in the source code section there is a list of js files. Some of them are the runtimes of the plugins. It was that way when I looked last at least, which was around when c3 first came out.

    Edittime is inaccessible as I recall. It’s all minified.

  • I don’t know about that, but if he has a particular language he wanted to make in mind, things can be simpler/easier.

    Simplest would to not do a parser at all and just add a list of commands to an array, loop over the array and depending on the command do something. Of course you can get a lot more deluxe.

  • If you pick the object you want to duplicate and store sprite.asJson in a variable, you can then create a new sprite and use the “load from json” action to make the new instance identical. You’d then manipulate the new instance as you see fit.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The process of making a programming language is basically the same as in any other programming language.

    Design the language and all its features on paper.

    Write a parser to take some text and convert it to tokens and then error check that there are no syntax errors.

    As you parse it you’d want the result to be formatted in a AST or RPN stack. Basically some kind of structure to be able to refer to.

    Then you’d need to run it piece by piece. The whole time you’ll be changing a program state.

    Finally there’s a high amount of tweaks and polish you can add.

    Do to the limited features of the event sheet you’ll have a bit more work to Add some features.

    Basically there’s a lot to it. And how you do it varies greatly depending on what you want your language to be and do.

    It’s interesting though, just not too trivial a project in many cases.

  • So I explored further the feasibility of doing this within the running game. Here's the current test:

    ucd7cca956b9bc75de9ee752f09b.dl.dropboxusercontent.com/cd/0/get/CiA3nMPoSPbwBh4a9QQJjV2lMO_PAIhe1IJ4rBDZeXh92aKIyt82Brs5fiPHp55vYhLRsG6GZ47-jGzyC0uwFUfQ-r85x0c3OQ40paWPhop6OtG45KJrwLC6SPA5hi7aT5E/file

    It's piecing together the necessary parts and very wip atm so it's a bit messy. Mostly a lot of asynchronous calls. A final step if I works well will be to simplify everything best I can.

    What it does?

    It can show a open file dialog, load a capx file as a zip and access files inside.

    I also was able to make it save the zip again. It's not possible to show a SaveAs dialog from JavaScript so it just invokes a download of the file. Maybe if I decide to go the nwjs route...

    The file I decided to open was the .caproj file since it has a list of the layouts, and I wanted to see how easy it was to get info from a xml file. First snag was there was three garbage characters at the start of the xml that prevented it from parsing. Fixed that and found out navigating xml is a pain. I tried doing it with the xml plugin and in javascript. Also the xml plugin doesn't let me modify data, only read it.

    So I made a converter to convert the xml to json so it's easier to navigate, copy and modify in various ways. The plan it to also convert it back to xml when done if I want to save changes.

    What is left to do?

    * Convert the json back to xml for saving.

    * Do some manipulation of instances on a layout. Initial things I had in mind were changing positions, duplicating instances, and destroying instances. Probably will make a simple ui for that purpose.

    * Save a completed new capx file with the modifications.

    It's mostly all done in js, and doing it in a plugin would be too restrictive, and doing it in straight events would take too long and be slow and hard to reuse.

    Anyways cheers.

  • That would still minify in your plugin and not work.

    The way c2_callFunction is defined it's name will not be minified. That doesn't stop the minifier from minifying the name as you're calling it in your plugin though. Basically you use object["name"] instead of object.name to keep "name" from being minified.

  • It's defined in c2 as window["c2_callFunction"]. C3 is probably defined the same way.

    So if you're calling it from a plugin and want it to be minify safe use:

    window["c2_callFunction"]("my function",[])

    instead of

    c2_callFunction("my function",[])

  • In c2 here is the flow

    construct.net/en/forum/extending-construct-2/javascript-sdk-32/order-of-update-calls-91514

    So as said above when a plugin/behavior runs depends how things are implimented.

    However as a rule of thumb I go by a simplified flow:

    1. Run plugins and behaviors

    2. Run events

    3. Run certain plugins and behaviors

    4. Draw

    5. Repeat

    For the most part most plugins and behaviors run in 1, but a few (such as drag drop as well as part of the platform behavior) run in 3.

    I guess over time I’ve created a mental list about the exceptions or I just recreate the behavior with events so I know exactly when it runs.

    Guess I should also read your big report.

    -cheers

    Edit:

    Read your bug report. That’s a bit different. Most actions are immediate in that they change things there and then. Some actions, probably for performance reasons, delay actually updating till that plugin is run or drawn.

    Anyways with the tiledbackground offset being delayed I can’t say I’ll use it much. I do my best to avoid off by one frame things like that.