MessMess's Recent Forum Activity

  • > Just one curious question: When you first spawn "RobotsHealth" there is a toggle option for "Create hierarchy". I didn't click it, because I see you didn't click it, but what does it do?

    You can prepare the entire hierarchy (in the editor), say, a robot + two arms + two legs + head + health text. Then in runtime when you create this robot and tick "create hierarchy", it will be created with all those parts!

    That is very cool!

    I've only been working in C3 for a few months now, I'm having a great time and constantly learning new tricks.

  • Two simple and easy methods:

    METHOD 1:

    METHOD 2:

    Which of the two methods to use? Any of them. A matter of taste, I guess.

    You are amazing!

    Thanks for giving me options - I tried them both.

    I hadn't used hierarchies before and that seemed like the more elegant solution, so I settled on that one and it works perfectly!

    Just one curious question: When you first spawn "RobotsHealth" there is a toggle option for "Create hierarchy". I didn't click it, because I see you didn't click it, but what does it do?

  • I have a tower defense game where you are trying to stop robots. There are different robot enemy/object types and they are al contained in a Family called "Robots".

    When I spawn an object from Robots, I also:

    - Spawn a text object called "RobotsHealth"

    - Pin "RobotsHealth" to Robots

    - Set Text of "RobotsHealth" to the current health of that robot.

    So, far so good, this works perfectly (the starting health values move with the robots).

    However, when bullets hit "Robots", I want to update the value of "RobotsHealth" and I have this code:

    - Bullet1 On collision with "Robots" -> RobotsHealth | Set text to Robots.Health

    But this is changing the value for EVERY instance of "RobotsHealth".

    How do I change just the value for instance of "RobotsHealth" that is pinned to the "Robots" that was hit?

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

  • Try Construct 3

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

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

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

MessMess's avatar

MessMess

Member since 22 Nov, 2023

Twitter
MessMess has 1 followers

Trophy Case

  • 1-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Quick Draw First 5 people to up-vote a new Construct 3 release
  • Email Verified

Progress

6/44
How to earn trophies