R0J0hound's Forum Posts

  • I found the angle here based on the closest edge or point on the collision polygon, but then if you have that then shooting a ray is excessive. In short even though I thought it over casting rays isn't useful to solve the problem. The most I can think of is to shoot a bunch of rays out and picking the closest one, but that is imperfect.

    The sliding is done by correcting the overlap oppiset the angle chosen and the canceling the velocity going in the direction of the angle. That can be done by utilizing a dot product.

    The algorithm I used can be made faster by not checking far away objects and/or implementing it in JavaScript. A plugin may be ideal but to me that's a pain to make and maintain.

  • C2 internally recycles objects so that creating/destroying objects creates a minimal amount of garbage. That said have you measured if you get better performance with what you're doing? I've done stuff that creates/destroys hundreds of sprites every tick without causing more gc pauses.

  • Closer to what you want look at xlsx files. They are zip files of xml files and other things like images.

    You could use something like this to manipulate the zip file from js

    https://stuk.github.io/jszip/

    Then either by looking at the file format spec or disecting some simple xlsx files it should be possible to see how it's done. You could also look at some xlsx JavaScript library but I'm not sure images work with them.

  • Yes, I mentioned a blend mode way in my last post that should work. I'll try to make an example this weekend. Besides that all the other methods can be done without third party plugins with varying levels of difficulty. The ray caster can be replicated with events but it will be mathy. The drawing of the shape itself either requires custom js injected with the browser plugin or clever positioning of sprites.

  • ultrafop

    I can't open your capx right now but if you made the variables local you also need to make them static. With just local the variables will not save their changes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As far as automatically converting the project over there is nothing that does that. I had something that did that with very early versions of C2 but I never updated it. I did make a python library, capreader.py, that can be used to access everything in a cap file. It could be useful for making a conversion program but I never got around to it because a perfect conversion is hard.

  • If you install construct classic you can open the cap file and look at the events. It should look much like c2 events so you usually can copy everything over. I don't have access to either software right now so I'm unable to do it or even see what I did.

    On the other hand this is a pretty old solution and you'd probably get better solutions by posting in the c2 section of the forum instead. There's a lot of creative c2 users that may just not read topics in the construction classic section.

  • Have you tried a reset? Alternatively open the task manager and see if any of the previews are still running. Eg temp.exe temp2.exe etc...

    Otherwise I have no ideas about the issue

  • This topic may be useful

    You may also be able to do it with the light object and blend modes.

    Make a layer not transparent and put the light object on it.

    Give the light object the destination out blend. Then add a Sprite for the view cone to that layer and give it the destination in blend.

    I could be confusing the blends but that's the general idea.

  • Modifying c2runtime.js isn't really feasible. When the project is exported the JavaScript of the runtime and plugins are minified so they aren't readable, but on top of that the events or logic of the capx is probably in data.js and that is only readable by the JavaScript portion. In short it's not worth the effort to reverse engineer the export to be able to make changes.

    The most I've seen someone do is change a setting after an export.

  • You could, but the trouble here is it switches between how C2's renderer is set up and a different set up that has a z-buffer. In a nutshell each object will be 3d but come out as 2d sprites that you'd have to sort in the same way as you currently do in C2.

    But yeah it should be possible. You'll probably want to utilize some 3d library to simplify the amount of rendering code.

  • Here is an experiment of using the browser object to run javascript in a few interesting ways. You can do anything you can do with a plugin with this, but it's all done in C2 which makes it quicker to test changes.

    First off it's used to load js files and interact with C2's runtime. This isn't minifier friendly, but it should be possible to wrap it in a plugin so it will be.

    The main thing done in this capx is to change the rendering of one instance of an object in an interesting way.

    With webgl off: some arbitrary canvas drawing is done.

    With webgl on: a 3d cube is drawn inline with the rest of the other objects (as opposed to only on the very top or bottom).

    https://www.dropbox.com/s/oge5lmjwm5wpp ... .capx?dl=1

    /examples35/js_test2.capx

    Maybe this will be interesting/useful to someone.

  • frozenen

    The light's blend mode seems to be most of the issue. I can't come up with an easy fix but you probably can get it to work by being specific as possible.

    When it's single screen the light layer is black and you erase the lights from it.

    When it's split screen you need to replicate the layer with another paster to get it to work. As it is now it's drawing the light as if it's on the same layer.

  • In a nutshell the paster object only has limited support for effects as I recall. It works fine if the object uses only one effect, but it ignores alpha and blendmodes apparently. Also multiple effects are not chained correctly. There are also issues with effects relying on screen position. It uses a heavily modified version of the code C2's renderer uses to apply effects. The goal was to make results identical but there were a number of things that needed to be reworked to make it work, and I lost interest before working out solutions to many of them. In the end I don't use webgl since it performs worse on my PC than with it disabled so I haven't had any reason to persue it further. Not to mention it is a very time consuming thing to work on, and unfortunately I don't have that kind of time anymore.

    The blend modes are built in and don't use effects. A solution could be to only do one step at a time and use multiple paster objects to store each step:

    paster1: paste sprite //sprite has effect1

    paster2: paste paster1 //paster1 has blend mode

    paster3: paste paster2.

    Another idea is maybe just using the canvas snapshot system action?

  • Ah, it's probably an issue with pasting with effects and blend modes then. I won't be fixing any part of the plugin that involves applying effects any time soon.

    A possible solution could be to paste the object to another paster first, then apply a blendmode to that.