luckyrawatlucky's Forum Posts

  • R0J0hound I got 1 issue. in your example file. set viewport to 1260 x 720 and set variable path value to 841,141,812,171,783,202,754,232,725,263,696,293,668,324,639,354,610,385,581,415,552,446,523,476,494,507,465,537,436,568

    and preview it. that blue sprite should be positioned to first p but its on the 13th.

    just change path value to default value you set. and then start set position to first p object.

    what's wrong here?

  • R0J0hound there are more than 2 p.counts. its 15. I did check debug with breakpoint and I come to know that when I create all p objects. all objects were created but when I select any p object in debeug then it doesn't show its property. it showing current running loop. when all p objects are created then action for Sprite (t) and its position is set to NaN after that I can see p's property.

    and somehow if things work fine then Sprite's default position is not the first p's position.

    first time n sets -1

    Edit:

    I noticed why this issue occure. I put entire code under a variable comparision. and trigger once instead of start of layout.

    Why it causing issue putting under a variable camparision. do you know?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound I used a new object for this purpose. So instead of creating all path I'm creating only specific path which will be used. Now one issue comes here.

    clamp(((self.X-p(self.n).x)*(p(self.n+1).x-p(self.n).x)+(self.y-p(self.n).y)*(p(self.n+1).y-p(self.n).y))/((p(self.n+1).x-p(self.n).x)^2+(p(self.n+1).y-p(self.n).y)^2),0,1)
    

    this returns NaN to me, I did copy exact code from example file.

    instead of creating object start of the layout, I'm creating on triggered once.

    I did debug this code and here is the screenshot

  • R0J0hound

    yes, that what I was trying to do, my method was not working at the end. in your example.

    clamp(((self.X-p(self.n).x)*(p(self.n+1).x-p(self.n).x)+(self.y-p(self.n).y)*(p(self.n+1).y-p(self.n).y))/((p(self.n+1).x-p(self.n).x)^2+(p(self.n+1).y-p(self.n).y)^2),0,1)

    I have multiple path and all those paths are already created on runtime. by default it picks object 'p' which was first created.

    I have set variable on 'p' by comparing which I want to choose which path to be picked.

    How can I pick a spesific path to use?

  • I fixed above issue by adding min,max

    -> System: Set d to clamp(distance(ax,ay,clamp(Touch.X,min(bx,ax),max(ax,bx)),clamp(Touch.Y,min(ay,by),max(ay,by))),0,distance(ax,ay,bx,by))

  • R0J0hound I used below method.

    | Global number ax‎ = 0
    | Global number ay‎ = 0
    | Global number bx‎ = 0
    | Global number by‎ = 0
    | Global number a‎ = 0
    | Global number d‎ = 0
    + System: On start of layout
    -> System: Set ax to point1.X
    -> System: Set ay to point1.Y
    -> System: Set bx to point2.X
    -> System: Set by to point2.Y
    -> System: Set a to angle(ax,ay,bx,by)
    
    + Touch: Is in touch
    -> System: Set d to clamp(distance(ax,ay,Touch.X,Touch.Y),0,distance(ax,ay,bx,by))
    -> star: Set position to (ax+cos(a)×d, ay+sin(a)×d)
    

    I place 2 points in layout. point1 poisition (681, 268), point2 position (426, 459).

    above code is working except one issue. when mouse is touching ahead of point1 then it still moving star towards point2

  • is there a way to make a path on layout then drag sprite over that path in runtime?

    is it possible if I make a path using timeline then drag object over that path?

    Tagged:

  • if bullet has grtavity applied then it could calculate impact. but gravity is zero, so these should work same.

  • I did raycast and shoot a bullet from same point and they both collides on same spot but reflections of both are not same there is slight difference in their reflection angle. please check and let me know if its working as it should or its a bug or my fault somewhere

    myfile is attached

  • Typo on my part. It should be mid(a,loopindex,1). I wrote i instead of 1

    yes it helped.

    Thanks R0J0hound

  • R0J0hound,I tried but it returns nothing, matching is still blank

  • I know about tokenat and its not about letters matching only. its about matching then comparing then counting and then adding. I tried a lot with tokenat, tokencount but I didn't find a way

  • alextro thanks but its is not what I'm looking for

  • I need help on something I have string variables curWord & typeWord and matching I want to check if typeWord is having letters matching with curWord, but if typeWord has any letter which is repeating then I want to check if curWord also has that word repeating then I want that letter to be added in matching variable twice but if letter is repeating in typeWord only and curWord has it only once then I want to add it to matching only once.

    for example:

    Example: 1

    curWord = green

    typeWord = omega

    then matching will be = ge

    Example: 2

    curWord = green

    typeWord = dreed

    then matching will be = ree

    Example: 3

    curWord = great

    typeWord = dreed

    then matching will be = re

  • is it possible to add inner shadow on a Sprite by any effect or javascript or css any way?