dop2000's Recent Forum Activity

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • That's probably because of this event:

    + System: On start of layout
    -> System: Wait 1.0 seconds
    -> gun: Set position to (slot1.X, slot1.Y)
    -> System: Wait 1.0 seconds
    

    If you need to move guns to their corresponding slots, you need to pick the correct slot instance for each gun instance.

    For each Gun
    Slot compare slotID=Gun.slot : Gun Set position to (slot1.X, slot1.Y)
    
  • Look at the instance properties on the left panel - you need to fill in the values for slotID and slot instance variables. 1 for the first slot, 2 for the second etc. And the same for weapons.

    You can do this manually in the editor, or you can do this with events, for example, when a new weapon is picked up, find an empty slot and assign the weapon to that slotID

  • Did you set the correct values in slotID and slot variables for all sprites?

    If this doesn't help, please share your project file.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies