dop2000's Forum Posts

  • You can link multiple options to the same node.

    You will need to keep track of which bread and which cheese was picked with events - for example, store them in variables, in an array or a dictionary.

  • Not sure how any of that is related to setting an angle of motion. But I'm glad it works :)

  • Strangely, I can't reproduce it. Can you post your project file?

  • The Pathfinding object doesn't move immediately upon creation. There’s no motion - and therefore no angle of motion. You can simply set the object's angle instead.

  • ... hanging by a thread ... throw all the work in the trash...

    jomego Don't be dramatic. While many of us aren't happy about the removal of SDK1, it's not the end of the world for your studio or your projects. Just switch to the LTS version.

    Also, nothing you can say here will influence Ashley's decision in any way, have a read:

    construct.net/en/forum/construct-3/plugin-sdk-10/addon-sdk-v2-182122

  • Whenever you move objects like that, always use delta time.

    Set object.x to self.x+5 is wrong

    Set object.x to self.x+300*dt is correct

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, loading dictionaries with AJAX is not different from loading arrays or any other files.

    You are probably trying to get the key before the dictionary is loaded. AJAX request is asynchronous, you need to wait for it to be completed before accessing the dictionary.

  • So does this mean I have to load in the json dictionary differently from an array?

    If you're asking about the JSON string format, then yes - the dictionary JSON format is different from the array JSON format.

    {"c2dictionary": true,"data": {"0": ""}}
    
    {"c2array":true,"size":[1,1,1],"data":[[[""]]]}
    
    

    Also, please remove the "Trigger once" condition from your events. Don’t use it until you clearly understand how it works and what it does.

  • You'll need to add Molek sprite to a family, and move instance variables from the sprite to the family level.

    Then you will be able to pick both in the same event, something like this:

    Chemic pick children Molek
    Chemic pick children MolekFamily
    
     Molek is attached
     MolekFamily is NOT attached
     Molek overlapping MolekFamily 
     ----> MolekFamily set attached to true
    
  • "Bullet on collision with Enemies" picks an instance of Enemies family. But the BulletHitZombie function doesn't know about that. So in this case you need to pass the UID of the of the picked to the function. Create a parameter enemyUID, pass it to the function, and pick an Enemies instance inside the function by UID.

    Another option is to enable "Copy picked" in function properties, then it will automatically pick instances from that main event.

    And the third option is simply move all those actions from the function into the main event - "Bullet on collision with Enemies".

    But, this is important: since your events are picking Enemies family instance, all actions should also apply to Enemies family - not to the Sprite as on your screenshot!

    EDIT: Right, there is a 4th option - use a custom action, it will work very similar to a function with "copy picked".

  • You need to pick enemy instances which you want to kill. There are many ways to do this and picking by UID is rarely necessary.

    Please provide more information of post a screenshot of your code.

  • I'm not sure I can answer your question. Your game is pretty complex, and while switching to hierarchies has probably made things a bit cleaner and more organized, it's still a complex system.

    All I can do is share how I would probably approach this task:

    1. Pick all moleks that are still in the hierarchy (i.e. children of Chemic). First, set attached = false for all of them.
    2. For each molek in the hierarchy that is directly overlapping (touching) Chemic: set attached = true.
    3. For each molek in the hierarchy with attached=false: check if it’s overlapping another molek with attached=true. If so, change its attached to true. (You might need to use a family: “Molek is overlapping MolekFamily.”)
    4. Repeat previous step until none such moleks left.
    5. Any remaining moleks in the hierarchy that still have attached=false at this point have broken off from the chain. Remove them from the hierarchy and launch them away.
  • Molek On Destroyed condition picks only one molek instance - the one being destroyed. If you need to process other instances in a sub-event, you need to add "Pick all Molek" as the top condition. Be aware, that the original instance is not completely destroyed yet at this point! So the "For each" loop will process it too, unless you exclude it somehow or wait till the end of the tick.

    So the easiest fix is this:

    + Molek: On destroyed -> Wait 0 seconds
    ----+ System: Pick all Molek
    ----+ System: For each Molek
    
    
  • I'm not sure what you mean by element? There are family members (object types), and there are instances of those objects — which are also considered family instances.

    You can certainly loop through all existing family instances using For Each.

    But if you need to iterate over all object types in a family (even if no instances of them exist on the layout), you’ll need to use JavaScript. As far as I know, that's not possible with events.

  • When you create a family instance, it should create a random member - spriteA, spriteB, or spriteC.