zedissimo's Forum Posts

  • That's a very good point about every tick. I was thinking that "System / Compare Variable" initiate only on variable change. Now all of them and "for each" are replaced with functions and called after they are triggered. Everything finally works, thank you so much, Sensei!

  • dop2000 Hello, in case we are using for each. That means for each instance of the object, the same action will be done, right?

    Looks like I didn't understand that topic enough. If we have a global variable "gold=0" and an enemy with an instance variable "goldReward", let's say "5" and after picking that instance we make an action like adding "goldReward" to "gold" that will work, but we are doing the same thing with for each. It's working only once even if there were 10 instances of the object picked before for each... I hope you understand my bad explanation... 

    C3P https://www.dropbox.com/scl/fi/4jfi56rjic4my2m5qwqj3/Choose-Enemy-5-copy.c3p?rlkey=iuaa4ya4gayeap0yq5vsa5f78&st=77pkq2il&dl=0

  • dop2000 Awesome! Now I understand. So first was picked enemy that was on collision and thats why we need to "reset it" to pick all and after that pick some enemies within all and than do actions, nice!

  • dop2000 When I'm triggering mine with a keyboard key, it's working like expected. What I was trying to do is: after the first enemy triggers mine, all enemies in the LOT radius are taking damage. Why it's not working if the first check is on collision; that will change the state to true, right? Plus, there is one more check to see if there are more enemies in the range, and only after that should they get damage. Where am I making a mistake?

    .c3p https://www.dropbox.com/scl/fi/xwdtdss75wrn89sjzk1xz/Choose-Enemy-4-copy.c3p?rlkey=cwwpf4xgmrcpaatqjmdbt60td&st=fvvn197q&dl=0

  • dop2000You saved me so much time, thank you!

  • dop2000

    Your advice about pick enemy first worked and solved all my problems about picking and damaging one enemy, Thank you!

    After many tries I can't find solution for multiple picked enemies. I don't understand how to damage picked enemies using function. (maybe secret in taking parameters for function? But it can be only variables...) I don't know...

    Now it's picking multiple enemies but killing them only one by one... Why its not working for all enemies in the range and how can I fix that?

    Idea is:

    1) First enemy steps on the mine

    2) Mine check all enemies in range

    3) Damage them simultaneously (ideal version will damage enemy with coefficient of range: first enemy takes 100% or damage x 1, the last one of the mine blast radius gets 10% or damage x 0.1)

    updated c3p https://www.dropbox.com/scl/fi/mnkvc391xrmvnzxfsj206/Choose-Enemy-3-copy.c3p?rlkey=9y7k3raphqwaqye433glk501g&st=tja0kyh0&dl=0

  • Hello friends! First of all sorry for my bad english...

    I'm trying to find a way to choose enemies in range by "line of sight" and damage them using there UID.

    I made a project with all mechanics that I can and can't fix.

    1) Check Distance. How to check distance to closest enemy?

    2) Choose closest enemy after distance check (works fine with LOT, but it's interesting to know where I'm making mistake without it)

    3) Choose all enemies after distance check (here is a lot of problems that I could't fix

    4) Land mine

    Here is a "c3p" https://www.dropbox.com/scl/fi/rs8zz7jnfkprt1allmoy3/Choose-Enemy-2.c3p?rlkey=agvoupl51yntnc5ued5ftn27u&st=bm7y45o8&dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound Thank you very much

  • I understand what was the problem with (p1.velocityx) it's (p1.8Direction.VectorX), but i still don't understand why sprite is shaking if we are setting angle here (angle(p1.x,p1.y,p2.x,p2.y)) ?

  • Example #1

    I made this in construct 3 and if P1 line is active he is drugging, of P2 he is active and if both lines, than then both are drugging. (interesting)

    Dist = distance(p1.x,p1.y,p2.x,p2.y)

    Ang = angle(p1.x,p1.y,p2.x,p2.y)

    P1: move max(0, dist-radius) at angle ang

    Or

    P2: move -max(0, dist-radius) at angle ang

    Example #2

    I can't find the way to add "velocityx" to P1 or P2 there is no such expression (or I can't find it?)

    W1 = max(0,p1.velocityx*cos(ang+180)+p1.velocityY*sin(ang+180))

    W2 = max(0,p2.velocityx*cos(ang)+p2.velocityY*sin(ang))

    Example #3 same thing with "velocityx"

    R0J0hound, wow thank you for your time explaining to me how that works. That much detailed information will help me understand how to handle it in future (I hope so)

    I also checked both files:

    #1 tetherObjects.capx works perfectly

    #2 tetherObjects_noDragging.capx have a strange bug: when any of the players are moving at 45° angle (keys A+W, S+D, LeftArrow+UpArrow, or DownArrow+RightArrow sprite starts shaking in some degree to left and to the right

  • R0J0hound I also appreciate you trying to help me. Before I even try to add it to the construct and test it, I need some time to understand what's happening with those formulas.. I wish there would be the way to turn off drugging for Pin behavior...

  • igortyhon I appreciate you trying to assist me, but there is a problem with that "code".

    Example #1: if player 1 is moving to the left and at that time player 2 start moving to the right, than player 2 will drug player 1 to the right

    Example #2: if player 2 moving to the right and player 1 starts moving to the left than they both are moving to the right

  • Hello! The best way to explain what im trying to do is. Imagine two sprites "Pined by Rope style" to each other... so both of them are limited by distance and can slide at the radius after that range limit reached. They can turn back to each other with no speed limitation

    In the examples below you can see Version 1 and Version 2, and they work almost perfect. The problem with them is that one of the players is drugging the second one, and I don't want that. In version 7, it is almost what I want to achieve...

    https://www.dropbox.com/scl/fi/fn83oweqyru8fukdsvgxd/My-Movement.c3p?rlkey=86utyf9ng2ppjfnj9tb0bgbkv&st=0kx1gkun&dl=0

  • Thank you! That finally works as I imagined. I will check an example and learn more about (dt)