MessMess's Forum Posts

  • That's not bad either! You just need to remove the Else and bring the second event out of a sub event on its own. With the two separate events I think you should see it working.

    Thanks for that suggestion, it tightened the code and works perfectly.

  • ObjectTypeName is an expression. You need to use a condition like "System Compare Two Values" to check it:

    Compare Two Values Family.ObjectTypeName="SpriteName"

    Make sure to pick the family instance first.

    That didi it! Thank you so much!

  • Links?

  • Not sure if this is the best solution, but I created an Instance Variable for the family "Icons"and filled it with the Tower Name for each Icon. Then I was able to reference that Instance Variable in the condition.

    It works, it just feels like an unnecessary trick, and I can't figure out a better way to do it.

  • It think you are looking for ObjectTypeName

    That is what I want to get, but it doesn't seem to exist as an option for a Family.

    When I go to add the condition and I select "Icons" (which is my family), there is no option after that for any ObjectTypeName.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a Tower Defense game and a family of objects called "Icons" (there are 5 different tower icons inside this family).

    The "Icons" family has the behavior DragDrop on it.

    When I drag an object in this family, I need to kick off an event and that event needs to know which of the 5 tower types I am dragging, so I can place the correct TowerType at the drop location.

    In pseudocode, if these conditions are met:

    Icons -> On DragDrop

    Icons.ObjectType = "Tower1-Icon"

    Then is should do this action:

    Icons Spawn Tower1

    The problem is that second condition "Icons.ObjectType" doesn't seem to exist.

    When I have the "Icons" family selected, how do I know which of the objects inside it I am actually working with - what is the test for this?

    Tagged:

  • Thanks for the raycasting tip!

  • I just found the answer, if anyone else runs into the same thing.

    You have to use Bullet Stepping - which you can read about it here:

    construct.net/en/make-games/manuals/construct-3/behavior-reference/bullet

  • I have a tower defense game and I want to have towers that shoot different speed bullets.

    But, if I make the bullets too fast, they sometimes pass through the targets, as if they are before the target on one frame and then the next frame they are after it, so it never registers the hit (On collision).

    Is there a way to deal with this?

  • Thank you so much for your excellent suggestion. I'm sure that would work and it actually gave me some ideas for how I could solve some other upcoming issues.

    I've been trying to find a solution for the past hour and just came up with this solution below (I just had to add an Instance Variable on Bullet called "Live" by default set to False).

  • I'm working on a tower defense game and it has an object "Bullet" that is fired from a turret object "Tower".

    I want to destroy the Bullet if it collides with another Tower (instead of the enemy).

    So, I wrote this:

    Bullet On Collision with Tower -> Bullet Destroy

    But, since the Bullet is being created on top of a Tower, it is destroying the Bullet before it can even move away from the tower that created it.

    Is there a simple way to prevent this from happening?

    Thanks in advance,

    Chris

    p.s. In my game, these bullets bounce, so it's possible the bullet would hit the original tower and that should destroy it as well (just not as soon as it appears).

  • You do not have permission to view this post

  • I just played your game and it was a lot of fun!

    It looks great too - one of the best I've seen done in C3 (excellent work on the UI elements too)!

  • "System -> Pick overlapping point" works great.

    Thanks so much!

  • I have objects called "Obstacle" that are all over my layout and I need to be able to check certain coordinates to see if they are in that specific location.

    I know the X and Y coordinates I need to check, but I don't know how to do the test.

    In pseudocode it would be this:

    If Obstacle exists at position Layout.X , Layout.Y Then ...

    Else ...

    Any help would be much appreciated.

    Tagged: