Magistross's Forum Posts

  • The SOL isn't propagated through function calls. The only way to do that is to pass UIDs to function (in a loop if multiple instances are to be expected).

  • Off the top of my head, I'd say try reversing the second and third conditions in the TargetSet function.

  • I usually prefer mindfaQ method of using a start value and end value, interpolated with an ever increasing factor that goes from 0 to 1 based on elapsed time / duration.

    Here's a capx demo.

  • Have your angle change in 22.5° increment only, and set your initial angle to multiples or 22.5°.

  • Actually, you should always have double-quotes around XML attributes. So the query should look like this :

    XML.StringValue("/story/line[@id="""&Line&"""][@name="""&Name&"""]/text()")[/code:1xgrz275]
  • It's indeed pretty fast. At first I did the "every tick" part just as a quick way to test the plugin... but then I saw how it did not even lower the fps one bit, so I kept it !

    However, it's still not a good idea to do pathfinding on an "every tick" event, mind you !

  • Bummer, I used the web version of Dropbox and it seems it didn't correctly "copy to clipboard" those links. I'll correct them immediately.

  • Hi ! I recently stumbled upon this neat little API for pathfinding and thought it would be cool to wrap it up inside a plugin/behavior for C2. I thought a behavior extending the official tilemap made the most sense for this so here goes :

    live example (Drag and drop the blue/green square, and right-click to add/remove obstacle.)

    example capx

    behavior files

    easystar demo done in C2 (need moveTo behavior)

    live version

    The behavior is rather straightforward, just hook it up to a tilemap, define walkables tiles with the appropriate actions and you're set. It uses a tag system so you can make multiple find path calls simultaneously, and EasyStar.js allows for asynchronous calculation if need be. Just try it out !

    edit: corrected links, added another demo

    Behavior files v1.01

    v1.01 has an updated core (now using EasyStar.js 0.2.3, slightly modified to accommodate C2)

    Key features are an optimized algorithm, possibility to add specific costs at tile coordinates, option to enable/disable corner cutting when moving diagonally

    Behavior files v1.02

    Yet another update to the core, now using EasyStar.js v0.4.1. Now featuring directional conditions and an even more optimized algorithm.

    Behavior files v1.03

    Small update to correct a bug with the "SetTileAt" override. Also added a condition to test if a tile is walkable and an expression to get the cost from a particular tile.

    **New**

    Behavior files v1.04

    C3 version - automatic conversion (seems to work perfectly but use at own risk)

    I stumbled upon a nasty bug that made the plugin rebuild its array representation of the tilemap every tick instead of only on the first tick. This could have caused quite a bit of slowdown when working with large tilemaps.

    Added a new condition : "Is tile walkable from". Basically the same as "Is tile walkable" but this one take into consideration directional conditions and thus need another coordinates pair. It will always return false if the two pairs of coordinates aren't neighbours.

    Also removed the jQuery dependency by removing the jquery.map() call and using array.map() instead. All modern browsers should now support this.

  • Here's a method to emulate the first Zelda game scrolling system on the NES.

    https://dl.dropboxusercontent.com/u/700 ... daNES.capx

  • Praised be my insightfulness !

  • Are you trying to do something like this ?

    https://dl.dropboxusercontent.com/u/700 ... ickup.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The & operator is a bit touchy. Used with numbers, it acts as a logical AND. You probably should convert your array entry to strings using the str() function so & actually acts as a concatenation operator again.

    str(array.at(0)) & str(array.at(1))

  • Quite simply, you're setting up a loop inside the main loop (which the event sheet is). Every tick, the loop is executed and 10 block objects are created. You need to restrain the execution one way or another if that is not what you want. The simplest method is adding a "start of layout" condition to the loop event.

  • You simply can't have two containers with the same objects, that'd be impossible to accomplish. The only thing you could try is having all your "troops" in a single sprite object with multiples animations.

  • Download Chrome, and try again !

    Seriously, I think the "Download as JSON" action doesn't work properly in IE10... might have something to do with Data URI limitation.