johndim's Recent Forum Activity

  • can you try with myNewInst.instVars.myId = i;

    i tried it and it works !!!

    THANK YOU VERY MUCH

  • Maybe it's a bug but i am not sure.

    I create 2 instances of the same text object (myText) in design time.

    I also create an instance variable for that object called myId with different for each intance etc. (value 1 for the first instance and 2 for the second instance).

    I put a mouse left click event for the object with the following

    action myText set text to myText.myId.

    When i test this it works good as expected and changes the text of the object every time i click in different instance.

    The problem happens if i decide to create the two instances of myText object not in design time but at runtime with javascript code inside a loop like this for instance

    let myX = 30;

    let myY = 100;

    for (let i=1;i<3;i++){

    let myNewInst = myTxt.createInstance(0,myX,myY,false);

    myNewInst.myId = i;

    myY += 30;

    }

    The two instances are created and and all seems well but if i left click

    with the mouse on each of them the text does not get the myId value of the current instance but the value of the first instance wich is already there from design time and its 0.

    It seems to ignore the fact that the variable is an instance variable and must have different values for each instance.

    Any ideas ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You'll have to regenerate the obstacle map. This is cost intensive and thus not done automatically.

    https://www.construct.net/en/make-games/manuals/construct-3/behavior-reference/pathfinding

    You have "Regenerate obstacle map" which is probably not needed for your case since it regenerates the entire map.

    So you probably wanna use "Regenerate region" and just select a region around the deleted tile.

    Thank you very much. That's what i missed. I finally managed to make it work as i expect.

    Thanks again

  • Hi everyone.

    I am new in construct 3 and i cannot figure how to acieve this.

    I have a tilemap object with solid behavior enabled. And i have created a level with a path like a labyrinth.

    I have another object with pathfinding behavior and it works good. It finds the path and walks as i expect.

    But... i also have a mouse click event on the tilemap object in order to delete the tile in the clicked area. The problem is although the tile is deleted the object with the pathfinding behavior seems to ignore that and continues to avoid the specific area as if the tile has not been deleted.

    Thanksin advance for your time

    John

johndim's avatar

johndim

Member since 23 Sep, 2018

None one is following johndim yet!

Trophy Case

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

Progress

8/44
How to earn trophies