dop2000's Forum Posts

  • Ashley

    I spent several hours yesterday trying to figure out the problem, so I don't remember exactly what I did to capx file in C3, but at one point it stopped working.

    I tried it again just now -

    capx file in C2 works fine.

    capx file in C3 works fine.

    If I create a new c3p project and copy everything over from capx file - it still works fine.

    But when I re-create the same file in C3 from scratch - it doesn't work.

    So there are definitely inconsistent results...

    Here are two files, they look identical, but if you open both in C3, one works and the other one doesn't:

    dropbox.com/s/7t7fncjm4b9efay/PF_bug_C2.capx

    dropbox.com/s/jvwwadefdy5525x/PF_Bug_C3_fromscratch.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley, It definitely works in C2. I made that project in C2, tested to make sure it works, then opened it in C3.

    Is there any workaround to use two obstacles maps? Clear and re-add obstacles between each "Find path" call?

    By the way, do I need to execute "regenerate obstacle map" after "Add obstacle" action?

    EDIT: What if I add two Pathfinding behaviors to the same sprite? They still will be using the same one map?

    EDIT2: This is a very odd limitation. Say, you are making a top-down game with many enemy types. Some enemies can't open doors, others can walk through doors, flying enemy can fly across water, ghost enemies can fly through almost everything.. How do you manage all their pathfinding needs with just one obstacle map?

  • Ashley, Thanks for the quick answer. Then why is it working in C2?

    And what should I do if I need two pathfinding objects with different obstacles?

    PS: Sorry, I logged a bug before I saw your answer here.

  • This is really weird.. I'm not sure if this is a bug or maybe there is some logic to it. See this file:

    dropbox.com/s/gwi3f4i8cerbgpu/PF_bug8.c3p

    For some reason both arrows move the same, although they have different obstacles..

    If you set "Obstacles: Solids" on the green arrow, both arrows move through both boxes! If you delete the green arrow, then the blue arrow begins to move correctly.

  • Your project is quite big and messy, it's hard to find the problem, I can't even reproduce it. Make a small test project and maybe we could help.

    If you are using charm_multiply sprite just for the multiply effect, you can make it square shape. It doesn't need to be the same shape as the original sprite, as soon as they are both on a separate layer and you set "Force own texture=Yes" on the layer.

  • You can use "loopindex" expression in all loops.

    For example:

    for each Sprite -> sprite Set ID to loopindex

    If you have 5 sprite instances, this will set their ID variable to numbers from 0 to 4.

  • oosyrag no, it doesn't.

  • Since you only have one spawner and one timer, with multiple instances of trolls they are restarting the timer all the time.

    You should probably move the Timer behavior to Troll object. When health<=0, instead of destroying this troll, hide it from the screen and start a timer on it for 2 seconds. On timer event, destroy this troll and spawn a new one. Or you can simply move it to spawner position and reset its health (make him alive again).

  • It may be something simple, like the text can not fit into the text box. Try increasing the width and height of characterName and occupyInfo_Cost objects.

    If this doesn't help, add a debug text object to the layout and print debug information into it, for example, "Debug append text array_Character.AsJSON" - you will see if the array actually contains the right data of not.

  • Did you add "Jumpthru" behavior to the table sprite? You can only add "Jumpthru" and remove "Solid".

  • What exactly have you tried? I don't see any attempts in your capx file.

    Taking screenshot is pretty easy and there are lots of examples and tutorials.

    scirra.com/tutorials/1087/using-nodewebkit-to-take-and-auto-save-screenshots-in-desktop-builds

    scirra.com/tutorials/9553/screenshot-capture-to-email

  • That 3D cube is insane!! Thank you for sharing!

  • "Tap" is a gesture, it's triggered only after the finger is lifted from the screen, and it's more suited for buttons. In your case you need "On any touch start" event, it allows much faster reaction.

    Also, your project is for C3, and you are posting in C2 forum.

  • I am not good at JS. I believe you can send multiple parameters, like this:

    c2_callFunction('UpdateOpacity', ['sprites', new_opacity]);

    And then in C2 you access these values from Function.Param(0), Function.Param(1) etc.

  • Oh, I'm terribly sorry, I read your question wrong. I thought you wanted to find this ID for form control objects.

    I'm not sure this is possible for other object types. Maybe you can work around this using C2 callback function. You can call this function from your JS, pass the object type in a parameter, and then in C2 function you pick objects of that type and do something with them (change opacity or whatever). Something like this:

    In JS:
    c2_callFunction('UpdateOpacity', ['sprites']);
    
    In C2:
    Function "UpdateOpacity" 
     Function parameter 0 ="sprites" -> AllSpritesFamily set opacity to 50