Magistross's Forum Posts

  • You can "make" your customers occupy tiles by adding an obstacle to the tilemap at the customers position. If customers move, you will have to make sure the custom obstacle is removed and then added again at the new position. Don't forget that paths must be recalculated as the obstacle map changes.

    rexrainbow's MoveTo is particularly useful to move sprite from one point to another. Check out this demo for inspiration on how you could use it.

  • Even if it's not tile based per say, you could use the behavior with an invisible tilemap so you don't have to overhaul everything.

    You're free to use my plugin however you see fit, I simply wrapped the excellent EasyStarJS library in a C2 behavior. That library itself is under the permissive MIT license, so go ahead and use it!

  • Given the fact that your game looks tile based, you might to take a look at my EasyStar behavior. It might be easier to implement in your particular case.

  • SnapX/Y and TileToPositionX/Y return the position in the middle of a particular tile. Depending on where your sprite origin is, you might have to shift the position a bit. e.g. Tilemap.SnapX(Touch.X) - 16

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are also expressions that combines both so the final expression doesn't become monstrous.

    On Touch -> Create object at x = Tilemap.SnapX(Touch.X), y = Tilemap.SnapY(Touch.Y)

  • Optimally, HEALTH <= 0 (and any condition filtering the For Each) should go above the For Each.

    If you don't destroy the enemy right away, your only resort would be to use a boolean or another state variable (using AI_STATE <> 11 could be ok too if an AI_STATE doesn't change once dead). "Trigger once" in that context doesn't make much sense, in fact, using a "Trigger once" in a loop is one sure way to get unwanted behavior. As soon as it loops more than once, "Trigger once" get mixed up and make each iteration a "new trigger", thus explaining your problem.

    Also, the "Trigger once" in the collision event is redundant, and you might as well remove it altogether.

  • "Health" has to be a family instance variable. Next, the simplest method would be to add "On created" trigger for each of your enemy.

    Enemy 1 -> On created -> Set Enemy 1 "Health" variable to 10

    Enemy 2 -> On created -> Set Enemy 2 "Health" variable to 20

    ...

    The collision event will now have to look like this :

    Enemies -> On collision with bullet -> Subtract 1 from "Health"

  • mindfaQ pretty much nailed it! I'm not sure if it's an intended behavior or not... however when you know about it, you can combine two RegexMatchAt to fetch capture groups even with the global flag set.

  • Nice addition !

  • It's worth noting that RegexMatchAt behaves differently if the global flag is on or off. If on, the index argument will fetch the n-th match, if off, the index will fetch the n-th capture group (with index 0 being the whole match, index 1 the first capture group, and so on so forth). Haven't found a way to get capture groups yet when using the global flag, except by nesting two RegexMatchAt function calls...

  • This won't quite cut it. The stretching needs to occur on the rotated image, which I believe is impossible to do in vanilla C2. One way to do it would be to use a paster object (plugin by R0J0hound).

    Here, I put the galaxy sprite in a container with a paster. Every frame I refresh the paster sprite by first re-positioning and expanding the drawable area back to the original state, paste the galaxy with a newly rotated state, and then stretch the paster object by an arbitrary factor (< 1 to retract, >1 to expand). Then I position the paster in a manner that it seems to share the sprite origin. Seems to work pretty well !

  • Just updated ! Check out the first post.

  • Sorry for the delay, I was away quite a while on a holiday.

    The first thing that comes to mind is the Layer. The system create objects on the "HUD" layout by default. If it doesn't exist, it won't create anything. You can either change the constant "DIALOGUE_LAYER" to an existing layer name or add a new empty "HUD" layer.

    Let me know if this helped !

  • I believe you are loading the Dictionary and not a single dialogue array, so you should use Call "Dialogue_StartDialogue" ("DictionaryKey") to call the correct dialogue.

    You could indeed add a fade in effect, but once again, you might have to adapt the code a bit, depending on how you want the fade to behave. The simplest would be to add a fade in behavior to the 9-patch (window), SpriteFont and portait sprite, and be done with it. However, it might not quite be what you want. You could set the behavior disabled on start, and enable it conditionally on object creation. You could also delay the "typewriting" to occur by setting the "Dialogue_Timer" to an arbitrary value (most likely the fade in duration in ms) instead of 0 in the "Dialogue_StartSequence" function (event 10).

    Don't be afraid to experiment, the system should be robust enough to work even though you fiddle a bit with it.