dop2000's Recent Forum Activity

  • From what I've learnt the picking algorithms vary depening what you do in you function and if you use "for each" loops.

    I don't think that's true. As I wrote in my previous comment - picking the array instance should be the first condition!

    Pick, then loop through the array. It doesn't matter if you use "for each X" or a system "for" loop. And you don't need to pick the array again inside the loop.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to provide some details and/or share your project file.

  • The entry condition for the loop are "for each X element" and "ArrayName" = passed name argument from function

    ArrayName check should be the first condition!

    Did you set the ArrayName value correctly for each array? You can check this in the Debug Mode.

    Since every array object has only one instance, you don't really need the instance variable. You can just pick by array UID:

  • What?? That's incorrect. You need to delete records in a loop, in reverse order.

    For "n" from array.width-1 to 0
    Array.at(loopindex)=""
     ----> Array delete index loopindex from X axis
    
  • You can open the project in the LTS version - it will support SDK1 addons for another year.

    construct.net/en/make-games/releases/lts/r449-3

  • Also will this trigger once?

    + TextTime: Text is "00:00:00" (Ignore case)

    No, if someone runs your app on a 240 Hz monitor, this event will trigger 240 times per second and send 240 requests to the server.

    Also, comparing the time to "00:00:00" to detect the start of a new day is a bad idea, because the app might not be active at that exact second. Instead, save the current day in a variable and compare it every few seconds. If the day has changed - update the variable and send a new request to the server.

    As for comparing the time to sunrise - the server returns it in "HH:MM" format, you can use tokenat to extract the hours and minutes from the string.

    Local string sunriseTime‎ = 07:25
    Local string currentTime‎ = 04:07
    Local number minutesToSunrise‎ = 0
    
    -----> System: Set minutesToSunrise to (int(tokenat(sunriseTime, 0, ":"))-int(tokenat(currentTime, 0, ":")))×60 + (int(tokenat(sunriseTime, 1, ":"))-int(tokenat(currentTime, 1, ":"))) 
    
    --------+ If minutesToSunrise ≥ 0
    ---------> Text: Set text to int(minutesToSunrise÷60) & " hours " & zeropad(minutesToSunrise%60, 2) & " minutes to sunrise"
    
    --------+ Else
    ---------> Text: Set text to "Past the sunrise time"
    

    You can copy/paste this into your event sheet:

    {"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[],"actions":[],"children":[{"eventType":"variable","name":"sunriseTime","type":"string","initialValue":"07:25","comment":"","isStatic":false,"isConstant":false},{"eventType":"variable","name":"currentTime","type":"string","initialValue":"04:07","comment":"","isStatic":false,"isConstant":false},{"eventType":"variable","name":"minutesToSunrise","type":"number","initialValue":"0","comment":"","isStatic":false,"isConstant":false},{"eventType":"block","conditions":[],"actions":[{"id":"set-eventvar-value","objectClass":"System","parameters":{"variable":"minutesToSunrise","value":"(int(tokenat(sunriseTime, 0, \":\"))-int(tokenat(currentTime, 0, \":\")))*60 +\r\n(int(tokenat(sunriseTime, 1, \":\"))-int(tokenat(currentTime, 1, \":\")))\r\n"}}],"children":[{"eventType":"block","conditions":[{"id":"compare-eventvar","objectClass":"System","parameters":{"variable":"minutesToSunrise","comparison":5,"value":"0"}}],"actions":[{"id":"set-text","objectClass":"Text","parameters":{"text":"int(minutesToSunrise/60) & \" hours \" & zeropad(minutesToSunrise%60, 2) & \" minutes to sunrise\""}}]},{"eventType":"block","conditions":[{"id":"else","objectClass":"System"}],"actions":[{"id":"set-text","objectClass":"Text","parameters":{"text":"\"Past the sunrise time\""}}]}]}]}]}
    
  • You need to pick the right enemy instance, which is pinned to the collision box.

    The easiest solution is to add both objects to the same container. They will be logically connected and will be picked automatically.

    construct.net/en/make-games/manuals/construct-3/project-primitives/objects/containers

    You should also use the hierarchy feature instead of the Pin behavior. Then you will be able to use "Pick child/parent" conditions to easily pick objects in the hierarchy. For example:

    Bullet on collision with EnemyCollisionBox
    EnemyCollisionBox pick parent Enemy : Enemy subtract 1 from health
    
  • I need them to all hold individual variables and dictionary info per item, so I'd have no idea how to do that with individual frames.

    You should store all that info in one or several arrays/jsons. It's MUCH easier than manually enter it into instance variables. That's what we do in our game - the array holds about 300 cards:

    Also sorry, was that you saying how to do it? I'd understand a lot easier with the event sheet, I'm more of a visual learner.

    Which option? Creating from the list of objects, or using scripting?

  • 15k object in the family

    That's a bit insane. I would definitely combine these objects into sprites (as separate animations).

    Your best bet is to make a list of all family objects - you can get it from the family.json file if you save the project as a folder. Then create each object from the list using "Create by name" action.

    Or you can do this with Javascript:

    const f = runtime.objects.FamilyName;
    for (const t of f.getAllObjectTypes()) {
     runtime.objects[t.name].createInstance(layer,x,y);
    }
    
  • You can try outline effects instead, but they don't work well with some fonts.

    Or create a spritefont with the embedded outline:

    construct.net/en/forum/game-development/tools-and-resources-27/sprite-font-generator-v3-64038

  • You can use a global variable SafeZone. Set it to true (or 1) when the player enters the safe zone, stop all enemies. Set the variable to false (or 0) on exit. In all enemy events add a condition checking that the variable is false.

    Another option is to put enemy events in a group and disable that group when the player is in the safe zone.

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