MessMess's Forum Posts

  • 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.

  • 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!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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:

  • Played your game and it was really fun. Loved the bee animations!

  • The reason you are having the problem is because it creates the object on a click, then immediately runs the next event which is to rotate on click. A better fix would be to lock out the rotate event on towers that were recently created, perhaps with a 'state' variable. When you release mouse click you can set the variable to allow the tower to be rotated.

    lionzThis seems like great advice.

    Is a "state" variable the same a global variable?

    Also, where in the order would the release mouse click code go?

  • Like this:

    That did it!

    You made my day. Thank you so much.

    Edited: Just wanted to add, thank you for teaching me about families and sub-events. I think I understand both concepts now and I was able to use that new knowledge to enhance and streamline my code. Very cool!

  • Really appreciate your patience (I'm used to more traditional programming and I guess I haven't fully grasped events yet).

    Anyway, I think I added the check for the ObjectTypeName correctly (see image):

    But, where the heck does the Else go? I can't even find an else statement in the events sheet.