Maako's Recent Forum Activity

  • Ok I think I get the difference here.

    This definitely works thanks a lot for the help!

  • No this doesn't work either.

    Even if the player has LoS to an enemy, it still technically also doesn't have LoS to a different enemy, and so the code will activate anyway.

  • Is there a Family "Enemies"?

    I think you can do:

    Object | Has Line of Sight to "Enemies" (Right click -> Invert) : Do something.

    Hey thanks for the response.

    I'm trying to make it so that if there are no enemies at all in the player's line of sight, then it does something.

    "Object | Has Line of Sight to "Enemies" (Right click -> Invert) : Do something."

    When I do this, it will still work when it has no LoS of any enemies, but it will also activate if it has no LoS of one enemy and does have LoS of another enemy.

    My current idea is to set a value to the number of enemies not in LoS, and then compare it to the total number of enemies, and if they are the same, do the thing.

    But I will have to do this with multiple different objects and I already have a lot of values and was hoping i would not have to add a bunch more

  • I want to make a condition so that if an object doesn't have Line of Sight to ANY "enemy" objects, then it does something.

    The code i tried was:

    If Player does not have LoS to enemy object -- do something

    But the player could have LoS to 99 enemies, but no LoS to 1 of them, and the code still activates.

    I feel like this should be very simple but I can't figure out how to get around it.

    Am I missing something?

    Thanks for any help

  • Hey guys thanks for the help!

    I didn't know about the PickedCount function, that does exactly what I was trying to do

    thanks again

  • I'm trying to make a condition that says:

    If all of the objects' value = 1, do something

    I need the event to trigger only when all of the referenced objects value are 1

    The only thing I can think of is:

    Set value "count" to (number of objects)

    Set value "count2" to (number of objects with value 1)

    If "count" = "count2" - do the thing

    Is there a simpler way?

    Thanks for any help

  • Yes thank you this is exactly how I want the objects to behave

    I think I understand how to do what I want now and will try to do it.

    Thanks a lot for the help

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • here's a capx

    https://ufile.io/joh49

    I would like to make it so that I could change the position of the blue object to be closer or farther away, but still behave as though it was attached in this way.

  • I think what you need is Pin behavior.

    Set Object2 position, then pin it to Object1 as "Position and Angle".

    Hey thanks for the response

    This would work if it allowed me to change the distance between the 2 objects.

    So far I don't see any options with the pin behavior that would allow me to do that.

  • It's kind of hard to explain but what I want to do is basically: Set Object1 to Object2's X position + 50. But if Object 2 rotates, I want Object1 to rotate as if it was attached to Object2.

    I can't just move an image point either because the distance will vary a lot.

    I also can't use the "Move at angle" command either for other reasons. It has to be Set Position.

    I remember back when I used MMF2 I found an equation online that used tan(?) or something like that. I know very little about math when it comes to angles but I'm sure it is possible.

    Can anybody help me out?

    Thanks for any input

  • Ok I see. I'm pretty sure I understand that now.

    Programming has never been my strong suit so things like this aren't always easy for me.

    I very much appreciate the help though. The solution is working perfectly

  • Ok I see, thanks, both these solutions will work fine.

    I was trying to use the "else" condition earlier but couldn't figure out how to implement it, this makes sense though.

    I don't understand how the second solution works though. Setting a value to (itself=0) ? It works but I don't understand how lol.

    Thanks again for the help

Maako's avatar

Maako

Member since 14 Feb, 2015

None one is following Maako yet!

Trophy Case

  • 9-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies