lionz's Forum Posts

  • Guizmus yep! understanding the logic and calculating distance between objects has its own merits though

  • There is also a system condition 'Pick nearest instance'. You can use this to pick the nearest instance of Y to X and aim at it. Some calculations with distance are good to know though.

  • Well I was saying that the function was the problem and if you move it out of the function then it works, but you can still use one if you pass the item data through it correctly. They are powerful if you want to send through a bunch of data for an action that you will be doing over and over such as collecting an item. Since you're using a family for the items it should be efficient enough without the function though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Imagepoint shouldn't affect anything except where the object spawns, it will appear to shift over, but it shouldn't be moving as bullet at a different angle.

  • That will be because your score is still 2 when the next layout loads. Should it be reset to 0? I don't know 100% how your game works but this is kinda simple gameplay logic which is totally possible to do.

  • What is the fire logic? Shoot bullet from turret? If this is the case it will shoot from the origin of the object, which could've been moved. If you haven't set up the angle of the bullet it will just fire at its own angle instead of towards the player position. Many things could be wrong, easy to work out with a shared capx.

  • If you move the Set text to event 50 you'll see it is working. You should only really have that set text event in a function if you're passing the item name through it, which I would prefer to do. On the YouGotItem function call event, add a parameter 'collectibles.itemname'. Then on the text event inside the function instead of collectibles.itemname use function.param(0). This sends the name of the item you are overlapping through the function so it can be used correctly. The reason it's broken is because you call the function but then collectibles.itemname does not relate to anything or the item that was overlapped, so it picks the collectible with lowest UID which is the scented note.

  • Add a 'trigger once' condition to it. Yeah at the moment it's choosing a new animation while score is >= 2 which is constantly.

  • Don't choose a random animation on start of layout. Set the animation frame in the same event as you set the sprite visible if you don't see it until that point. So your bottom event looks like if score >= to 2 set animation frame to choose(0,1,2,3,4) and then set visible.

  • Probably some issue with picking, probably picking itself since a car is trying to detect a car. When the car is detecting if it is in sight of the player the picking logic is much easier, to determine whether a car can see a car you may have to add in some variables or IDs to ensure that it is not picking itself and that it is not applying the logic to all cars when one is in LOS.

  • Trigger the initial message once only when you overlap, like this https://www.dropbox.com/s/nkr9pgnq9fvqh ... .capx?dl=0

  • That's why I said to look at the turret tutorial level provided, all the logic is there for turrets detecting the player and then aiming and shooting at it. To get an object to move towards another object position you can use the Pathfinding behaviour to set destination to an object, find path and move along path to it.

  • Well the answer is it's not going to be a problem with choose animation if they are definitely the same object. You must be setting the angle with some other logic.

  • Firstly detect that LOS is working and they are indeed seeing each other, you can set up so the object is destroyed to confirm this. If they are not seeing each other, be aware that the LOS has a cone of view which may not be pointing towards the other object and so they are not in the detection area. With the turret just looking at the enemy and not moving at all you may be triggering events once only instead of constantly checking so look into this. Take a look at the tutorial level for turrets to see how they are set up.

  • Set animation frame to choose(0,1,2,3,4) or you can have floor(random(5)) which does the same thing.