6bf85f30-2578-4227-841b-41a0007077df's Forum Posts

  • Success!!! Thank you very much!

  • well the problem is that the loop keeps running while the conditions are true, creating a huge amount of sprites (tbh I would assume the game to crash).

    Absolutely spot on! I noticed this when testing the game play but wasn't sure how to fix it so it remained on my bug list.

    I'm testing what you provided and will report back pronto. Thank you for the guidance!

  • add event

    select green boox

    search for on created

    (make sure there is no other trigger in your event already bc that makes it so you can't add other triggers unless it's an or block)

    Found it! Thanks. I was looking under "Actions". I believe it's working, however...

    I agree with your observation on the other point about it continuously being created. How would I prevent that? Controlling that has been my latest hurdle.

  • I'm not sure I fully understand...

    I would use:

    green box ->on created: wait 2 seconds destroy

    Hey fedca! I don't see that option but it sounds like what I want. How would I add that?

  • Hey all. Hope you're doing well!

    For the below code snippet, I'm trying to:

    1. Destroy the red sprite and error text box (this works)
    2. Wait 1 second and create systemgreen text box (this works)
    3. Wait 2 seconds (this works)
    4. Then I need the code to decide if the instance variable "BuildComplete" equals 1 or 0. If 1, Set "BuildComplete" to 0 and if that value is 0, destroy the systemgreen text box. The variable is being reset to 0 but not getting destroyed.

    There may be a better way (I'm sure there is) to accomplishing #4 and I'm open to suggestions. I only want systemgreen text box to exist for 2 seconds and then be destroyed. See below for ways I've tested this. Thanks for your help and time!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So when a second one is built and the conditions are met, will that run again or how does that work? I saw the trigger once while true but it didn't seem to be the solution for future conditions that would need to be met. Again, only asking as you may see something I don't.

  • Hey C3 world.

    Essentially, I'd like to see the global value (NumberofPowerPlants) to increase once when the conditions are met. However, I suck at this and the global value increases to a very large number.

    Or if you recommend a different approach, I'm all game.

    I just want the NumberofPowerPlants to increase one when it has the POW_WorkerAssigned instance variable = 3 which is manually assigned in a different part (POW is the 3 letter abbrevation for powerplant). There could be additional power plants built which will require 3 more workers assigned it each of them.

    Any help/guidance/time would be greatly appreciated!

  • Hey everyone! Thank you for your insight and suggestions. Ended up being two problems that made me facepalm when I saw them. You all pointed me in the right direction.

    First was that on the events, one of the conditions was set for Variable (equal to or greater than 0) and the other condition was set for Variable (equal to or greater than 1). Well, when the condition was 1, both matched. Ugh. Changed that.

    The other was later down in the coding for which instance was being updated. I didn't have that code in the snapshot so you couldn't have known about it.

    But you're involvement saved me hours and hours of frustration and allowed me instead to fix the coding and move forward.

    Thank you!!!

  • Hey C3 world.

    When I click on the destroy button, it is supposed to do several things including destroying the sprite.

    The sprite, which is a member of the minerals family, has a couple of instance variables that I need before it is deleted. In the screenshot of the code snippet below, what I'm struggling to accomplish is:

    • take the value of Minerals.WorkerAssigned from the sprite and subtract it from a Global Variable "WorkersAssigned"
    • take the value of Minerals.WorkerAssigned from the sprite and subtract a different Global Variable "WorkerBotsAvailable"

    I need those actions to occur only if the sprite's instance variable (workerassigned) is greater than 1. I'm not sure if this is a time to use looping but I thought I would ask.

    Any help/guidance/time you can throw this way will be appreciated. Thanks all!

  • Sry I'm not here 24/7 on helper duty :) Unless Ashley starts paying me or something :V

    I do recommend finding things out yourself though. It may take an hour or two longer but those are not wasted hours by any means. You will learn significantly more doing so than when someone just fixes your project for you whenever something doesn't work. Read through the docs, do searches and good ol' trial and error, and then, if still nothing works, then go ask for pointers.

    Nah, you're fine as I never expected/assumed you to be but I also know there are others who can lend a hand as well. I donate several hours of my time a week to a forum (Experts Exchange) regarding questions about servers, networks, etc, etc. Not paid a dime and realized early what a difference helping others makes as what comes easy to me can be an extreme challenge to others. But there are also others (most are way smarter than I) on that forum who can pick up where I left off if I get tied up with family or work commitments. Again, I appreciate your time as I understand the fruitless rewards of volunteering.

    That said, there comes a point when someone can spend hours and hours and hours trying to figure out how to accomplish X. If you sat me in front of a SQL server and told me to accomplish 10 tasks, you better not pay me by the hour because I'm going to be there awhile. So I know what you're saying about finding my own solution but as someone on this side of the mountain, it can be a little bit overwhelming. Few things are most frustrating to spend hours going down one path just to find out I need to spend hours trying a different path.

    I enjoy the challenge and when I finally got it, yes it was rewarding but the time I spent researching (tutorials, vids, reading) was gone. For example, I helped a new tech with an issue with group policy in Win. He spent hours trying to get a policy to apply but it just wouldn't. When I explained one part, he took it from there. I didn't do his homework, just told him how to do it. That's all I could ask for.

    Wrapping up, I posted that this site should have classes. Let us vote on what we'd like to see the experts like you and some of these other super-brains do so we can take notes. I've spent plenty of time doing that with cisco and vmware classes, no reason C3 can't offer it up too.

    Thanks for the reply and being open-minded/patient while donating your time. Sometimes it's nice to be an elevator for those stuck this far down the mountain. Until next time, friend!

  • Figured it out myself. Thanks?

  • Any hints or links?

  • As Construct has grown, there has been a tremendous amount of tutorials created and demo projects uploaded to help reduce the learning curve. The "How do I" forum is hit or miss with questions as many times a quick answer solves part of the question but some confusion/doubt in the OP may still exist. This almost usually causes more frustration and eventually leaving their project or another question to be asked. Rinse, wash, repeat.

    I've been in the tech field 20+ years, learning cisco, vmware, microsoft products, etc.. Each of those training/re-certification classes were incredibly informative and I learned so much.

    I'm curious why there isn't a class that covers a topic that we vote on as being "needed". Even a refresher would help. A brief class or one that's 30 minutes seems like it would build this community (and brand) even more. I wasn't sure if there was a reason why there hasn't been this, such as it was attempted before but with poor results.

    Either way, there are topics I have with C3 that I can't get my mind around regardless of how many tutorials, reverse-engineering demos or questions I ask. Maybe I'm alone but I would bet donuts and coffee there are many who would benefit from a class, or 5.

    Thanks.

  • i think i did it!! Maybe not the most efficient way and I'm open to advice but man...

    maybe not. coal values increase in sprite that isn't being right-clicked on. Piss!

  • Good call. Updated the script accordingly.

    This creates the box now but I can't add to the value (coal) in the box when I right click on it.