Maako's Forum Posts

  • Hey thanks for the reply, I will definitely look through these.

    The throwing part wasn't too difficult to find, it was just the trajectory path I was having difficulty with. The "trajectory" keyword definitely helps, thanks for that!

  • Sorry for confusing title, but I'm having difficulty putting this into words, so also had trouble googling solution.

    I want to be able to throw an object in an arc and at different strengths. However, I want to show a curving line that will indicate the exact path the object will take.

    Also, if possible, I would like the line to stop when it collides with a solid, but this is not 100% needed.

    I was hoping there is a plugin or tutorial somewhere where someone has already done this, but I could not find it, and math was never my strong suite, so making curves with math and stuff is a little beyond me.

    Thanks for any help!

    I'm still using Construct 2 if that matters at all.

    Tagged:

  • Wow interesting.

    I think that explains my confusion. Definitely feels good to know this now.

    Thanks again for all your help

  • Ok I think I realized why I was confused.

    If you make the code:

    If Green has LOS to Red - set value to 1

    (Invert) If Green has LOS to Red - set value to 0

    This will not work if one Green has LOS to Red while a Green copy does not (at least not in my test)

    However, if you just reverse the order so it's:

    (Invert) If Green has LOS to Red - set value to 0

    If Green has LOS to Red - set value to 1

    It works correctly with all copies.

    Again I might be missing something because I'm tired but I keep running into walls with this and Ive been trying to get it figured out for days now.

    I'm going to sleep soon so sorry in advance if I don't get to respond to anyone who might help but I will check tomorrow

    thanks again

  • Ok thanks for all the help.

    I think I was misunderstanding what I was looking at in my code, and am currently too tired/brainfried to sort it all out.

    I'll look at it again later and try to figure things out

    thanks again for all the help its greatly appreciated

  • Hey thanks for the help. This works great.

    I'm a little confused though.

    Why does the code, "If green has LOS to object - set value to 1" work for multiple copies, but won't work if you invert it?

    I've been so frustrated for the past few days wrestling with this function XD It would be nice to know for the future

    thanks again

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm using the following code

    If object "Green" has LineofSight to object "Red" - Set Value to 1

    Else - Set value to 0

    This works fine until I make copies of Object"Green". If one of the green objects loses LOS to all red objects, the value still won't change if a different copy of "green" still has LOS to a red object.

    I'm pretty sure I know why this happens but I can't figure out how to get around it.

    I can't just say "If Green does not have LOS to Red, set value to 0" because it has the same problem, if a copy still has LOS, it wont change.

    I've tried using For Each but that didn't work either.

    Am I missing something?

    Thanks for any help

  • Hey thanks so much again for the help.

    I didn't know that could be done, I've never used the else function before, but it works perfectly.

    I totally forgot about the manual and if I run into any more issues I'll read that before asking here.

    You've been a great help thanks again for the patience and assistence

  • Try this:

    If player has LoS to Enemies -> (no actions here)

    Else -> Do something here

    This event may look like the same as "Player NOT had LoS" condition, but in fact it works differently.

    Sorry I just realized an issue.

    What if I need to add other conditions? Such as multiple values being certain numbers?

    Again I could just do:

    If player has LoS to Enemies -> (no actions here)

    Else -> Set value "NoLOS" to 1

    And then just use the "NoLOS" value instead of the LoS function

    But this would again mean having to add multiple values for different objects/scenarios. Which isn't the end of the world at all but I was just hoping there would be a more simple solution.

  • 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