mikeadamski26's Forum Posts

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

  • Try Construct 3

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

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

  • Ok, I have this all set but am stuck at the "do your own thing part" haha. That's precisely my issue! I'm so close, but while I have it setup to allow a user to load in their own teams.txt file, it doesn't seem to be connecting/replacing the existing teams.txt as when I run the simulator again after loading the teams.txt, the names are not changing.

  • I've been reading a lot about arrays and have learned a lot (newb) here. As you can see in this little demo (that I have set to only generate a virus for players on a football team for testing), I'm trying to pull five positions without any of them repeating.

    To get the demo to the spot I'm struggling with, Click "Virus Possible" and 50%, then click Simulate. Click it until you get it to run a virus (I have it set to ignore everything else for now).

    You'll see that it's pulling in five names, but while demos/literature have helped me get this going, I'm certain my copying/pasting/reshuffling is not setup right.

    All I'm trying to get at this point is to pull 5 random names from my array without repeating any of them.

    Thank you for taking a look! Screenshots below:

    Tagged:

  • howtoconstructdemos.com/using-a-sprite-to-invoke-open-file-dialog-and-a-workaround-for-filechooser-bug-c3p

    Use "AJAX Request URL" action. Also I really recommend studying the documentation and a few tutorials. Many of the questions you ask are pretty basic.

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/ajax

    Thank you. I have been reading and looking through the tutorials. Here is where I currently stand:

    The current live activity (for an idea of what I'm building...load button still does not work yet): simsportsgaming.com/collegefootballscenariosimulator/index.html

    I'm trying to replace the "teams.txt" with the user's own custom version of "teams.txt" that they'd upload using the Load Teams button. That file has my *current* list of teams located here: simsportsgaming.com/collegefootballscenariosimulator/teams.txt

    My event sheet currently looks like this, however I still cannot get any new "Teams.txt" to replace the existing one. I must be missing a command, but I wasn't sure which AJAX command to use. I have tried via the version published for web and also on a desktop version.