mikeadamski26's Forum Posts

  • >

    > Text pops up (just once) at 21 hours and 30 minutes

    >

    > OR

    > Anytime after that (just once) up to 2am

    I hope I understood the task correctly, you need to check it because I haven't tested it.

    I suggest first optimizing and adding the frequency of checks so that it does not happen every tick, for example, 3 times per second.

    Then we check the mandatory conditions for the text to appear.

    -Is there already such a text?

    -Is there a pause?

    -Is it too late, less than 2 hours after midnight?

    -Is the time greater than or equal to 21?

    In the next block, we specify whether we have more than 22 hours or more than 30 minutes.

    This way, our block should work once, and the check will not overload the entire game.

    Thank you for the help with this. I have tried what's shown in both of the images here, but the text is not popping up at.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • >

    >

    The conditions of step 183 will never be met, because if they are reached, the variable HoursPM = 21.

    And why duplicate the condition from the ClockPause variable? Let it only be in step 183.

    Yes, I am trying to use an OR block here for 183 but get super confused on how to set it up. I want the text to pop up basically anytime after 9:30pm, but I can't just set as greater than 21 Hours and 30 Minutes because then it wouldn't go off at, for example, 10pm (and 0 minutes) as the minutes are reset for each new hour.

    So in short, Construct 3 confuses me when trying to setup OR blocks properly. What I'm trying to achieve is:

    Text pops up (just once) at 21 hours and 30 minutes

    OR

    Anytime after that (just once) up to 2am

  • I continue to really struggle with how to use AND/OR events in conjunction with one another. I understand the concept in areas outside of Construct, even as someone who only tinkers with development as a hobby. I am a newbie novice, so I appreciate the help.

    My question is: Shouldn't this OR block that's nested underneath my AND block still fire off these actions (when the AND block is not satisfied) or am I not understanding it correctly? If I need to duplicate the actions for the OR block, why even bother using an OR block when I'm basically just duplicating another AND block and just adjusting a few things?

    Thank you!

  • Your project lacks a lot of organization, that's sure. I tried taking a look, but changing something seems to generate other bugs, which is often a sign of a deeper issue.

    Here your main problem is that you are checking conditions at every tick. When you have a condition in the event sheet without a green arrow next to it, that condition is checked every tick. That means that, if the condition is met, the associated actions keep running as long as the condition is met. In your case that's a problem. You can use a condition called "Trigger Once" that changes the behavior of the attached conditions by firing the actions only the first time the conditions are met.

    Try the code in the image.

    Also, note that on line 111 you have On "Players Array" completed -> set player text. Removing that line seems to solve the issue of the text changing briefly before the players appear.

    I see that you don't use families, actions, functions and much more. There are a lot of things in Construct which can help you avoid unnecessary work (notice that most of your events repeat things over and over). I made a small example of a basic prototype of your app (only virus) that uses these things.

    https://www.dropbox.com/scl/fi/nkytxmktzjv6g5q6xvjnm/DemoImproved-1.c3p?rlkey=httgahlyhgcvc4dua71rn7z2y&st=wt6mydz3&dl=0

    The button/family changes you made make sense and are great. My question on them is, how did you go about creating the family?

  • Your project lacks a lot of organization, that's sure. I tried taking a look, but changing something seems to generate other bugs, which is often a sign of a deeper issue.

    Here your main problem is that you are checking conditions at every tick. When you have a condition in the event sheet without a green arrow next to it, that condition is checked every tick. That means that, if the condition is met, the associated actions keep running as long as the condition is met. In your case that's a problem. You can use a condition called "Trigger Once" that changes the behavior of the attached conditions by firing the actions only the first time the conditions are met.

    Try the code in the image.

    Also, note that on line 111 you have On "Players Array" completed -> set player text. Removing that line seems to solve the issue of the text changing briefly before the players appear.

    I see that you don't use families, actions, functions and much more. There are a lot of things in Construct which can help you avoid unnecessary work (notice that most of your events repeat things over and over). I made a small example of a basic prototype of your app (only virus) that uses these things.

    https://www.dropbox.com/scl/fi/nkytxmktzjv6g5q6xvjnm/DemoImproved-1.c3p?rlkey=httgahlyhgcvc4dua71rn7z2y&st=wt6mydz3&dl=0

    Thank you for all of this! I am eager to learn more as a total novice, so I appreciate you taking the time to show me an example. I will be sure to check this all out over the weekend.

  • The timings shouldn't impact what I'm trying to do, but I understand. The timings are because of some other reasons. I'm sure it's not ideal design, so I'd love to learn a better way to organize my project. Happy to share if you're interested. I want to learn! I will take a look again at the demo. Thank you!

  • I feel as though I'm at this stage, but I hardly understand Construct 3 code let alone psuedo Construct 3 code.

    For "n" from 0 to tokencount(AJAX.LastData, newline)

    .. Array push back tokenat(AJAX.LastData, loopindex, newline)

    The screenshots have been super helpful. I'm also worried about using AJAX.LastData as I'm using that now in this project for a few different things, like team names (this situation we're discussing) but then also for a collection of player positions.

  • Getting close...If I want to replace my existing [choose("Team1", "Team2", etc.)] with this list from the "teams" tag or (which I've set to the TeamsData variable as well), is that possible. I know the choose command isn't going to work with this, so trying to find the best workaround.

  • I got it working! Long story short, it was that AJAX was pulling in the name too early, and not with the Event-Virus which was then replacing it (hence the weird quick/cycle change you'd see for a split microsecond.

    I put another condition on that first AJAX (Virus_Toggle no) and copied the AJAX down to the Event_Virus section.

    Phew!

  • When I deactivate all of the waits in Event-Virus, the same issue persists (plus more from removing the waits, obviously).

    You had a good idea in that maybe I just try its own text box versus sharing it for this event.

  • That makes sense, but it did not fix the issue still. I'm still seeing those positions appear when I either generate a new virus right away, or if the non-event triggers--those positions still hang there.

    I'm also not sure why, when running it the first time, the positions seem to do a super fast scramble before settling.

    This is all so strange! I'm obviously missing something easy here, but I just cannot find it.

  • Newbie here who has linked my project. I will try and point out where to navigate to and what issue I am having.

    https://1drv.ms/u/c/e4589a411e9a6ecf/EXIfNEeMHQtPg7oV13jzPcABiEmPhHGWIPeKx3PGOYxgBA?e=cKQZgJ

    Screenshot 1: You will see a lockerroom virus incident generated correctly in this little football simulator thing I'm making.

    Screenshot 2: For the life of me--and I've been trying for 3 days--I cannot get the player_text box to disappear like all of the other text boxes by clicking on Simulate again. I'm clearly missing something obvious here, but I'm pulling my hair out figuring it out. The other issue, it seems the player text REALLY QUICKLY loads some other text before loading the correct text. It just looks off.

    I'm sure for most of you, my organization and code lines are going to seem nuts, and I'm open to feedback, for sure. I've had a lot of fun building this so far as my first project, but I'm really stressing over this seemingly super easy fix.

    The parts at the very top, you can ignore. That's my next struggle (getting the load button to let a user load their own team names in).

    For now, all I'm trying to figure out is why the player_text doesn't disappear!

    Important: You'll want to have Virus (the actual button in the game) activated.

  • Still hoping to get some help on getting this setup.

    Right now, I made a pop-up that gives the user two options

    Load default teams (which I will just store in a variable string)

    Load list

    If they select load list, the filechooser pops open for them. Then I'm just not sure how to bring in their list.txt and have it come in as an option to use instead of the default teams.

  • Yeah, this should work. I'm having trouble following which plugins would contain these parts to get it up and running. I like what you laid out though.

  • Thank you so much! I have this working now how I want. :)