dop2000's Forum Posts

  • Ok, so the first problem is that "Wait 4 seconds, Go to next layout" is triggered twice, you should probably fix it.

    But the reason why Level4 is skipped is event #31 in "Screen 4 Game Levels". When you return to Level4 the second time, Level variable is already 4, so this event immediately changes layout back to "Screen 5".

  • Thanks!

    It's hard to understand the logic behind your events, but I believe the problem is in "Screen 5 ES Q3" at event #6.

    It's triggered two times (probably because the collision happens twice).

    So this code is executed twice: "Wait 4 seconds, Go to next layout"

    As a result, your "Level 4" layout is loaded very briefly and then next layout is loaded, which for some reason is "Screen 5".

    If you open console in your browser you will see it:

    Go to layout: Screen 5

    Go to layout: Screen 5 Q2

    Go to layout: Screen 5 Q3

    Go to layout: Game Level4

    Go to layout: Screen 5

    I suggest you use "Go to layout Game Level 4" instead of "Go to next layout".

    Also, you can add Browser object to your project and use Browser->Log to output debug messages. This is how I found out that event #6 is triggered twice.

    EDIT: no, wait, "Go to layout Game Level 4" doesn't fix it.. I need more time.

  • What I do not understand is why when I refer to an instance variable it doesn't take into account for each individual instance's unique variables. I am under the impression that there is a universal solution for getting the system to make instances behave independently based on their uniquely different variables.

    When you refer to instance variable, the system actually does this "for each picked instance".

    Say, if you do "Gun set var to random(10)", a different random number will be set for each instance of the Gun.

    And if you do "Gun set scale to var", they will all become different sizes.

    As for the Timer - this is not a workaround. This is the right way to do things in C2 when you are dealing with multiple instances and delayed actions.

    If you only have 1 gun, you can use "Every x seconds" or "Wait", no problem.

    If you have multiple instances of gun and they are firing/reloading at different times, it may be really difficult to get them working correctly with all these "Every x seconds", "Trigger once" and "Wait" events.

    In your last capx the problem is with the "Trigger once" condition.

    After one gun has fired, event #5 is triggered, all good. Then a second gun fires, but the first gun still has Cycling=1, so this event will not be triggered, because it's still true and it has already triggered once.

    And then the first gun fires again, but event #5 is still true, so it's still not triggered and now both guns are stuck with Cycling=1.

    Here is a simple solution:

  • Your event "Every gun.interval seconds" only makes sense if there is 1 gun instance.

    When there are many guns, this event will not work as you expect. I believe it compares "interval" for the first instance only, but it doesn't do picking, that's why all your guns fire at the same time.

    Here is the way to do what you want without the timer:

    This event will pick one or several instances of the gun, only those that satisfy the condition (nextShot<time). Picked guns will fire and a new value will be set to their nextShot variable.

    Most events of the Gun object will pick Gun instances. For example "Gun->Compare instance variable", or "Gun->Is visible".

    Any sub-events or actions under this event will only apply to picked instances.

    Most events of the System object don't do picking (except for those that start with "For each" or "Pick").

    For example "System->Compare two values Gun.NextShot<time" will compare values, but it will not pick gun instances. So if you do Gun->Spawn bullet in this event, all guns will fire.

  • Add a couple of variables (global or instance) LastKillTime, MultiKillCount.

  • Use Timer behavior, it's perfect for this task:

    You can add a sub-event to "On timer" to check if the gun is reloading and only spawn bullet if not reloading.

  • Create a variable "StartTime", set it to "time" on start of the layout.

    Then change your event to this:

    System-> Compare two values -> (time-StartTime)<=10

  • Try this:

    set resultText To replace(sourceText, """", """""")
    [/code:3dtd6n4y]
    
    If you are copy-pasting these strings manually, why don't you simply replace " with "" in Notepad or Word?
  • Have you tried restarting your PC?

    I think somehow ports 50000-50001 remain open even after you close all copies of C2. That's why when you launch C2 again, it uses the next available port 50002. Reboot should fix this.

    You can check the list of open ports in Windows - start Resource Monitor and click Network->Listening ports.

  • I'm not a beginner but even I had troubles following what's going on in your video because it's happening so fast. So yeah, you should definitely make pauses and add explanations of what are you doing.

  • Don't get me wrong, it's great that you are creating these tutorials, but I think you should try to make them look more like tutorials, and not just a screen capture videos.

    Say, before doing something in the editor, add a static frame for a few seconds explaining what are you going to do.

    For example: "And now I will add an instance variable MusicalNote to piano keys and assign each key its own musical note".

    This will make a huge difference!

    Also, if your tutorial is in several parts, add a description to each part:

    Part 1 - In this part I'm creating graphics and visuals

    Part 2 - In this part I'm adding a title screen

    etc.

    And since you are doing this for the viewers who are mostly beginners, try not to do everything in a hurry and record the whole project in one go. Your don't make pauses, mouse movement often look chaotic, windows are opening-closing too fast etc. I almost got a headache after a couple of minutes watching your videos.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • msha91 I've read your post many times but still don't understand your issue. You have lots of layouts and lots of event sheets in your project..

    Could you explain it once again? What is the problem and how is it supposed to work?

  • YoHoho

    There is "LayoutName" expression.

    System- Compare two Values -> LayoutName equals "Level1" : Go to layout Level2

    You can also create a variable "NextLayoutName".

    When level 1 starts, set NextLayoutName="Level2"

    When level 2 starts, set NextLayoutName="Level3"

    etc.

    At the end of each level use event "Go to layout (by name) NextLayoutName"

  • This usually happens when there are several copies of C2 running on PC. Check task manager, try turning it off and on again

  • Litetween is already ported to C3, and rexrainbow is working on all of his. Many of these are convenience plugins that can be done with events. The big one for me is Q3D, a comprehensive set of 3D plugins and behaviors that turn Construct 2 into a 3D game engine. It is the reason that I can’t port or recreate my largest projects in Construct 3.

    What I mean is that some add-ons like MoveTo or LiteTween are so popular, Scirra should have included them into C3 as standard behaviors and plugins.

    There are literally hundreds of useful and interesting ideas implemented in third-party plugins, many of which could be added to C3 as new features.