Nabu's Forum Posts

  • I need helpppp

  • Thanks for the reply. It works in the little example project but I still got the lag on my big projet. Do you think many events can make the lag when the positions are updated ?

  • Hi,

    Maybe you can use a function to store character data into a global array when a character leaves the layout. And when you go to that layout, re spawn a character with the data you stored, to reproduce the previous one, and make it go where you want or spawn at a specified location.

  • Try Construct 3

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

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

    I have a character with a base and multiple parts. Some are pinned to the base or the one another, and some others have their position set every tick at image point cause the Pin behavior can't do this. The problem is that it creates a lag in the movement. Positions seems to not be moved at the same time. Is there any way to prevent this ?

    Here's a capx for example. I commented the line where the part 2 is pinned to the part one, cause I'd like it to be set every tick at an image point. So every tick, the part 2 is set at part 1 position and angle.

    https://www.dropbox.com/s/2nrkrxxxf9welm7/pinMoToPosition.capx?dl=0

  • Not so easy ^^

    RayKi is right, if you want your npcs look at the player, when you're talking to them, you have to check and compare the position of your player and your npc. Depending on your game, the npc will change animation (4 directions, or 8) or make a rotation (so rotate toward position or set angle toward position). You have to implement a way to know when to trigger the effect and change the npc state.

    Pseudo logic :

    • when talk key pressed (or any other way)
    • check and compare player's position and npcs position to get the nearest one
    • pick it and make it change state and animation to start diaglogue

    For the npc stay in an area, I assume you already have a behavior or them to wander (you talked about make them stop wandering). There are several ways to do this. You can simply set a zone with an invisible sprite stretched to the desired dimension. When sprite are overlapping that zone, they get wander position inside it, or don't move, if they aren't overlapping that zone, they tend to reach it. For performance reason, you can check overlapping every 0.1 or 0.2 seconds, and not every tick as it's not necessary or this.

  • Hi,

    You have the option to change it at runtime. Chek for Z-Order => Move to top/bottom of layer, Move to layer (you specify), and move to Object which let you choose in front or behind.

  • Hello,

    I tried to implement a multiple Shadow Lights system with Ashley's advices from these two topics :

    https://www.scirra.com/forum/concerns-with-the-light-shadow-so-far_t106486

    https://www.scirra.com/forum/light-and-shadows-drawing_t106379

    When I set the Shadow Light opacity to less than 100, you can see that the Shadow Light cast multiple polygons from a Tilemap object with Shadow Caster behavior, that overlap and so cumulate alpha (surely to avoid having a big concave polygon). This make a multiple lights system (with Alpha threshold as Ashley mentionned) impossible. I made a little project to illustrate the problem : https://www.dropbox.com/s/2d5gmgwxes129ua/MultipeLightsShadows.capx?dl=0 Just mouse click to apply or remove alpha threshold.

    I manage to get close to the desired result by setting each Shadow Light at 100% opacity on a dedicated layer with 50% opacity, to get the "wrong" shadow into a flatten one. The superposition of the two layers give a good result but then I don't kwow how to apply a alpha threshold effect on the sum of the two layers. Here is the second example :

    https://www.dropbox.com/s/xwj876hv3hbhoh6/MultipeLightsShadows2.capx?dl=0

    Any idea ? I find no soluton.

  • Thanks a lot for your time and the feedback !

  • Sorry, finally this probably a bug, so I posted it here :

  • Problem Description

    Sprite with pathfinder won't find path in Chrome and NW.js if some musics are played

    Attach a Capx

    https://www.dropbox.com/s/wre9txx3t7zfhq9/Test.capx?dl=0

    Description of Capx

    Layout with a Tilemap. Spawn player with right click, make it find path with left click.

    Steps to Reproduce Bug

    • Step 1 : Make a layout with tilemap, and another layout with player sprite. Make a spawn function to create player at mouse coordinates. Make a music plays at first layout start. (not all music make the bug appears, only the first one in the given .capx)
    • Step 2 : Spawn player (right click). Left click to make the it find a path, at a location hidden with obstacle. Observed Result Sprite with Pathfinding behavior won't find path if there's an obstacle between his position and destination. Else it works. If the player sprite is already in the first layout nd not spawned via a function, and the path obstacle is added at ayout start, problem won't appear. Expected Result Sprite find path. Affected Browsers
      • Chrome: (YES)
      • NW.js: (YES)
      • FireFox: (NO)
      • Internet Explorer: (NO)

    Operating System and Service Pack

    Windows 7 SP1

    Construct 2 Version ID

    Release 200 64bit

  • I did some tests, trying to reproduce the problem but failed. The only thing I discovered is it works under Firefox, but no under Chrome or NodeWebkit. I would like to make a desktop game, so export to NW.js...

    The special things in my project are :

    • two tilemaps (only one is given as obstacle to pathfinder)
    • tilemaps randomly generated (obstacle given to pathfinder after map is generated)

    Don't know if it's the cause.

    Any idea ?

  • Hey,

    I've never done that but just thought about it. You can retrieve the waypoints from a given path and use the physics to reach them. Once unit arrive (don't know if there's an ever built in condition, or just compare unit position and path's current node) go to the next. The physic movement implementation should be the difficult part, because you will have to tweak forces (in construct itself or from a movement plugin) for you unit move nicely towards a direction to a given point.

  • Hello,

    I'm having issues with the Pathfinding behavior. First I'm sorry to have nothing to show because I can't reproduce the problem in a small simple project and mine is way too large for asking other people to work on it or find a mistake in it.

    The problem I have is that sprites with Pathfinding behavior achieve to find path if the path is a straight line, but not if it needs to avoid obstacles. I have already verified the map (tilemap) and checked the pathfinding obstacle map and everything is ok. The sprites are stuck in "calculating" path. The behavior is set to custom and I add the tilemap at sprite creation, after tilemap is created. Changing to solid do not solve the problem.

    I tested everything and tried to reproduce the error without success. I'm lost.

    Anyone has ever encounter the same ?

  • Ok, thank yo all for the tip. Grateful