Yann's Forum Posts

  • Arima

    I'm using phonegap, because cocoonjs adds 4 to 5 Mb to the games and at work I need something around 1Mb.

    And I think on cocoonJS it doesn't happen because they run their own engine.

    Also any condition you can find isn't usefull since there's no action that say "Touch: set use mouse input to Nope"

    It's only an edit time property. Hence sensible to the configuration settings in the long forgotten configuration panel I discovered some days ago, and then I got this idea.

  • Arima

    Nope, it's just that when you set the Touch plugin's property "use mouse input" to "yes", the javascript will register events for onmousedown/onmouseup/onmousemouve as well as for the touch events.

    But some devices (well, for now I've only seen it on Xperia), catches mouse events as touch events.

    So when you touch, the "on Touch start" trigger will trigger twice.

    So if you do something like "on touch button" > change layout and you land on another UI with another button at the same place, it will also touch it.

    So I basically have to remember to disable "use mouse input" each time I do an export. And I have to admit, I forget very often...

    newt Ashley

    All properties aren't available via events (the "Use mouse input" of the Touch plugin isn't), so no, I can't always use the Is in preview condition to have various configurations. And in my opinion, it shouldn't be the role of the event sheet (it's hard to read enough as it is)

    Also my idea of setting different configurations for export or preview could be expanded to set different configurations for the various type of export you can do (html5, arcade, phonegap, cocoon, node, etc) and also the various type of preview (desktop, on LAN,...)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    I'm making a game for android and I have to set the use mouse input to Yes for testing on desktop and to No when I export to avoid double input on the phone.

    That's only an example, but there are probably other situation when we need a different configuration between preview and export.

    Also my problem is that my export take a lot of time (maybe another suggestion would be to not re-export assets already exported... sprite sheeting can take a lot of time), so I'd like to avoid configuration mistakes.

    So here is my idea:

    We already have a configuration panel that seems to keep object's configuration states.

    So maybe we could set up construct to set one of the configuration for the preview, and another for the export.

    This way, for my example I could set the use mouse input to yes in my preview config, and to no in my export and just forget about that (:

    Hope it makes sense

  • oronbz

    This capx is very old. At that time you couldn't retrieve the parallaxe value of layers at runtime, so I had to put the values somewhere.

    Now, you don't see any use of them because I reverted the capx back to no parallaxe because I wasn't able to make things work as I wanted to.

    maybe I'll give that a new try some day...

  • Ashley ok got it thanks =)

  • First I don't know if it's really a bug since I don't really know if it's expected or not.

    But at least I think it should be mentionned in the documentation.

    The problem is that if you use the touch plugin and you leave the Use mouse input to yes, in Xperia/Android 4.1.2 (and possibly others) you'll get 2 touch input for every touch:

    • one for the touch itself
    • and one from the mouse event.

    And since it's asynchronous you can't even block the second one with some variables check.

    I think that ideally the plugin should handle such thing, but if it's not possible or too ugly to do (like checking for phone/OS versions), it should be at least written in the documentation that leaving the Use mouse input to yes is bad practice.

    Maybe also it could be interesting to have three option "Use mouse input: No|Previous only|Always"

    Anyway, here's the proper report.

    Steps to reproduce:

    1. Use the touch plugin

    2. Leave the Use Mouse Input to Yes

    3. Build an APK in phonegap

    Observed result:

    One fast touch triggers two touch start and end events

    Expected result:

    Only one touch start and end events

    Browsers affected:

    APK from Phonegap

    Operating system & service pack:

    Xperia with Android 4.1.2

    Construct 2 version:

    r142

  • It's not drawn by the GPU, it's drawn by a off-DOM canvas2D element and then the resulting texture is sent to the GPU to texture the object's polygon.

    So you still get as fast as the Canvas2D is.

    I warned you in the first post that's why my 3D test is so slow (:

    But you should be able to draw one polygon and move/scale/rotate it with C2's set position/size/angle function without triggering any redraw of the polygon itself.

    You only ever redraw the polygon texture when the vertices are modified.

    So unless you're modifying the vertices of your 60 polygons every frame, it shouldn't be too slow.

  • Hey, this time, just to be original, I did mine with unity ;p

    http://www.ludumdare.com/compo/ludum-dare-27/?action=preview&uid=5046

  • rename your capx as .zip

    unzip it

    look for the missing texture and compare with any reference in the .caproj (open it with a text editor)

    the .caproj is an xml file which reference all plugins, behavior, objecttypes, and project parameters of your project.

    It is read on opening and if you read the error message it just means that you have a ressource missing.

    You can either delete the reference in the xml (if you know xml well enough) or recreate a placeholder png you would put on the texture folder and try opening the caproj with construct2

  • You can't without a plugin.

    The closest you can achieve without you events getting too complex, is to use a sprite with a circular collision polygon and do something like

    // flatten the array
    -> Array: set size to (0,1,1)
    + myObject is overlapping circularDetector
    + foreach myObject
       -> Array: push myObject.UID in X axis

    Then you have the UID of all the object whose collision polygon overlap the circularDetector's one.

    The UID is the closest thing you'll have to a "reference" in c2's event sheet system.

    Also it's an unperfect solution since your circularDetector won't have a perfect circle has a collision polygon but a... polygon (by default an octogon)

    And it's inperfect because it's not really an AABB test but a collision polygon against collision polygon.

    But if you set the collision polygon of myObject to bounding box... you'll be closer to what you asked (:

  • fullscreen mode

  • container is the closest you can get

    though you won't be able to remove parts using the destroy action because container tightly tie the objects together so they can't live without each other.

    In other terms, if you destroy one object from a container, all the other object will be destroyed and if you create one, all the other will be created.

    So to achieve your effect I would advise to remove them by setting them to invisible.

    Anyway... containers

  • Your first and second method are equivalents since cloning means creating a new objecttype but based on the properties of the instance you cloned from instead of starting from default properties.

    So in the end we're down to using multiple instances or multiple objecttypes.

    First, I don't think there's any difference in terms of performance. The text plugin uses some cache system to avoid garbage collection, but this cache system is shared by all the objecttypes created from this plugin. So performance shouldn't be considered here.

    Now in term of project management, indeed, creating instances (copy) lower the number of object type to handle.

    The catch is when you want to manage them by event: if you use one objecttype by text, you don't have to worry about filtering them using conditions (picking).

    To me, that's not really a problem though.

    I try to use instances of one objecttype when this objecttype represents the same "conceptual" idea, and I just use instance variables to tell them appart.

    For instance, for a quizz game, I could have a "question" objecttype and an "answer" objecttype and put in the layout one instance of "question" and 4 instances of "answer", put an instance variable to tell which is which, and using events pick them one by one (in a loop) and then fill them during runtime.

    (and instance variable isn't that necessary here, you could use the IID)

    So my answer would be that there's no best way. Just pick the one that makes the most sens to you at the moment

  • You can use the default Browser plugin and do something like:

    System: Browser.ExecJS("window.innerWidth") < Browser.ExecJS("window.innerHeight")
        -> display your message
  • 3D games ARE possible in construct 2

    And indeed, you need to create a plugin.

    I tried, and I achieved result, however such plugin is a real pain to use because if you want to really work with C2's picking system, you need more than one plugin.

    Why? Because for 3D rendering you need many different abstract objects.

    You need objects like lights and meshes. You need what's called a scene graph to organize your objects in the scene (add and remove them). You need a camera object to control position and direction of view as well as field of view. You need a renderer object that allows you to connect a camera to a given scene graph.

    You also need materials and texture. (I'm mostly refering to how three.js works but I've seen such design in some software as well)

    And you can't really stick everything into one big fat plugin. Well... You can, but then you wouldn't be able to pick objects since everything would be handled by the plugin. You would also have to find a way to keep some references to instances to manipulate them in the event sheet...

    So a better solution would be to have a renderer plugin, a mesh plugin, material plugin, etc, this way you could pick materials and assign them to meshes, pick light and add or remove from scene graph, etc

    But that's a big work. And as some already said, you wouldn't even have anything showing up in the viewport of construct2.

    And also you would have to learn how the plugin suite work... which would be almost the same as to learn how three.js works (and 3D rendering in general... mipmapping, geometry instancing, model view matrices, etc...)

    And well... at some point... it would be like using a chainsaw to hammer a nail.

    Use the right tool for the job.

    I know c2's event system looks so easy that you feel this need to use it for 3D games, but remember, c2's event system is really just sugar coated programming. It wouldn't take that much effort to switch (for example) to unityscript (a bit more for unrealscript :D).

    If you already have a good level in C2, you've got good basics of programming. So after probably a month or two with unity, you'll be able to make what you want.

    And if you're good enough to create a 3D plugin for C2... Yeah... By all means, use unity :D

    for curious people, my 3D tests with C2 looks like that:

    Maze (use arrow keys)

    Just a rotating object