lionz's Forum Posts

  • Use the cell border property. It's all here https://www.scirra.com/manual/154/pathfinding

  • To pick in this scenario you need to add a system 'For Each' House condition, otherwise the picked House is always the first instance. What it's doing is moving you in front of the first instance of House every time, even if you are positioned over a different House and won't see it.

  • This is why I rarely make example capx for people because it's better to do and understand what is going on. Assuming that in this game you know where you are going to appear on each layout, you set up buddy portals. So Foyer portal that leads to Foyer A has the same curPortal ID. When you collide with Foyer portal where ID=2, you spawn in Foyer A at portal where ID=2. In terms of the exact positioning of the player then yes you could do what you were doing with the direction variable. If it's a door where the player appears on the right, you set the portal up with variable that positions the player at portal.x+25. If it's a door where you appear below then you set it up with the variable that positions player at portal.y+25.

  • Yeah I checked the simple one before I posted. The simple game ensures that there is always a portal on screen that is equal to curPortal. Your game does not. You are setting curPortal to either 2, -2, 1 or -1. Maybe you are trying to add and subtract from curPortal instead of setting it? I dunno, but the point is your game looks more like a buddy system. You can only set the position of the player if a portal ID = curPortal. So in Foyer A it is looking for a portal where the Id = curPortal, however curPortal is 2, and the ID of the only portal in the level is 4. The simple game does not have these declarations for setting curPortal to one of 4 values so it's really about what you were trying to achieve with those events.

  • There is nothing in Foyer A or Foyer B that matches the ID so it doesn't really set a position for the player. When you go to Foyer A, the ID of the portal is 4, but the one in Foyer is 2. The way the picking works in this is that the portal you exit from in Foyer has the same ID as the one you arrive in in Foyer A.

    To call me btw you use like Milanbaudelaire, then I get a notification, thanks.

  • Edit: I just had a proper look, I see the names in the game don't correspond with the names in the post. Your problem is that you asked it to go to FoyerB when it has a space as Foyer B. Same for the other one. FoyerA instead of Foyer A.

  • That's a caproj, you'll have to make it a capx.

  • It's because of Construct's top down structure so every event becomes true for one click if they have enough money. You can add a short wait of 0.1 seconds in, before you set the upgrade variable.

  • You can use the choose command where you pick a number and that number relates to a sprite. So choose(1,2,3,4) picks a number either 1,2,3,4 which then would relate to if 1 > create this, if 2 > create that etc. Maybe that will help you.

  • I'm interested to know what you tried because it seems quite simple and I'm not sure which method could go wrong! You can say, when not being dragged, move the sprite every tick a number of pixels forward, and set the angle of the object to 90 if it's above the Y of start co-ords and set angle to 270 if it's below the start position.

  • There is an obstacle map, which all pathfinding objects can see. If you destroy an object, it does not change the path in their eyes, they can still see the object there. You need to regenerate the obstacle map whenever you change something, it's one of the pathfinding actions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This resets ALL persist objects to their initial states, is that something you want?

  • You can't. You can probably achieve what you are trying to do through normal events though.

  • Yeah you could do something like that. On click or drag start, create a new instance that stays there for next time, essentially becoming the new clickable icon.

  • Yeah my advice was to make the clicked object a different object, because I couldn't see why it needs to do be a drag/drop bowling ball if it is simply an icon you click in a menu? You can alter values when something is spawned, using the On Created condition, where you can say something like On Created > Enable drag/drop behaviour, where the clickable version has the drag/drop behaviour disabled by default.

    To answer your question in a more general sense, Construct is all about picking. When you use 'on created' it picks the created instance and applies only to this. If you say change such a variable on bowling ball without picking a specific one with a condition then it will apply this to all bowling ball instances. It's really up to you to define in some way which of the bowling ball instances will change.