CGSpot's Forum Posts

  • The preview is stuck on the loading screen when I use the MoveTo behavior for a particular sprite.

    That sprite is just placed in the Construct 3 layout and doesn’t have any events or actions linked to it.

    Can anyone please explain what I might have done wrong?

    More info:

    - The sprite has animations and multiple image points.

    - The sprite is placed inside the viewport.

    - The layout that contains the sprite has no event sheet.

    - I tried disabling the MoveTo behavior and running the preview, but it still doesn’t work.

    Error video: webmshare.com/play/8PnAX

  • Fixed it using

    clamp((number + value), 0, 100)

    Thank you helping..

  • I’m adding a value to a number text field every 1.0 second. The value can range from 3 to 20, and I don’t want the number to exceed 100.

    For example, if the number is 95 and it increases by 3 per second, it could end up at 101.

    I want an event that checks if the number will go over 100 with the next increase, and if so, it should set the number to 100 instead.

  • Try these changes. Don't use "Trigger once"!

    It works great!

    Thank you very much

  • I've explained this so many times in many posts, but people keep making the same two mistakes:

    1. You should never use Trigger Once condition with objects that have multiple instances. Trigger Once doesn't work per instance!
    2. You have events that run on every tick with Wait action in them. This creates lots of delayed threads, which will continue running for several seconds. Never use "wait" in events that run on every tick! It will break the game logic.

    Instead of "Trigger once" use some condition like "is pinned" or "turret enabled". Instead of "Wait" use the Timer behavior to destroy guns.

    I've almost perfected the function. One problem I have now is that when I create the gun very quickly, the base gets destroyed quickly before unpinning the machine gun. This error happens when I create guns quickly in a shorter period; if I create them slowly, it works perfectly. Can you please help me fix this?

    Create:

    Destroy:

    Error Video: webmshare.com/play/bG6zm

  • I've explained this so many times in many posts, but people keep making the same two mistakes:

    1. You should never use Trigger Once condition with objects that have multiple instances. Trigger Once doesn't work per instance!
    2. You have events that run on every tick with Wait action in them. This creates lots of delayed threads, which will continue running for several seconds. Never use "wait" in events that run on every tick! It will break the game logic.

    Instead of "Trigger once" use some condition like "is pinned" or "turret enabled". Instead of "Wait" use the Timer behavior to destroy guns.

    Thank you for the help

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The function I want is:

    - The player will create a machine gun.

    - Each machine gun will have a duration (lifetime) when it’s created.

    - The machine gun should be destroyed when its time is over.

    I couldn’t create a separate function for each instance. When I spawn only one machine gun, it works fine. But if I spawn more than one, it doesn’t work as expected.

    Video showing the functionality I need: webmshare.com/play/dGjGx

    Events for creating: i.vgy.me/jDLomT.png

    Event for destroying: i.vgy.me/cM1COn.png

    Video showing the error: webmshare.com/play/VbLbj

  • > If I enable Unbounded Scrolling for the layout, an empty screen becomes visible at the bottom.

    Screen shake doesn't work when there is nowhere to scroll. You need to:

    • enable the Unbounded Scrolling
    • use a separate Camera sprite with ScrollTo behavior (its size doesn't matter)
    • move tha camera to player position
    • limit the camera movement to layout bounds

    Example:

    https://www.dropbox.com/scl/fi/ins0stjp4a58gxdoryh9v/BoundedScroll-with-shake.c3p?rlkey=x3tud71wkscppzivo8bugzlga&st=xd3ead60&dl=0

    Thank you very much

  • i dont understand

    the videos you showed are showing you spawn missiles for the first vid

    the second video wont load for me

    did you mix up the links when you posted your earlier forum on missile spawn issue?

    that missile issue, i got it fixed...

    this is about screen shake effect when the missiles blasting on the ground....

  • I want to keep the screen shake function in my game. My layout size is 3840x1080, and the viewport is 1920x1080.

    I’ve added the ScrollTo behavior to the Hero.

    I couldn’t use the Hero's ScrollTo behavior for screen shake. If I enable Unbounded Scrolling for the layout, an empty screen becomes visible at the bottom.

    So, I decided to use a sprite with the size 1920x1080 and give it the ScrollTo behavior. But I’m getting some issues:

    1. The screen doesn’t shake when the Hero is at the very left edge of the game page, but it works when he is further to the right.

    Video: webmshare.com/play/QGnG1

    2. Since both the Hero and the screen shake sprite have the ScrollTo behavior, the camera doesn't follow the Hero smoothly—he ends up moving out of the screen.

    Video: webmshare.com/play/xV9V3

    Can anyone please help me resolve this?

  • If you want to spawn the missiles at the player's current location, then use player coordinates instead of fixed values.

    For example:

    > Create missile at (Player.x, Player.y-200)
    Create missile at (Player.x-300, Player.y-200)
    Create missile at (Player.x+300, Player.y-200)
    

    Or, you can spawn them relatively to the viewport:

    > Create missile at (ViewportMidX("layer"), ViewportTop("layer")-80)
    

    Thanks, you are a lifesaver...

  • The image below shows my events:

    The hero character has the Scroll To behavior, and my layout is larger than the viewport. I’m spawning 3 missiles from above the viewport and using the Bullet behavior to make them fall to the ground.

    Issues:

    1. If the spawn layer has 100% parallax, the missiles won’t spawn above the player if the player has moved beyond the viewport. They simply spawn in the viewport, and the player can’t even see them.

    Video: webmshare.com/play/PJaJe

    2. If the spawn layer has 0% parallax, the missiles correctly spawn above the player, but they follow the player as he moves. The same thing happens to the blast animation that is spawned when the missile is destroyed.

    Video: webmshare.com/play/5JoJB

  • It's better to use a variable - increase the variable and set the text to that variable.

    Without a variable you'll need to convert the text to number and back.

    Textbox set text to str(int(self.text)*1.5)

    or use float() expression instead of int() if you need decimals.

    Thank you

  • In Construct 3, I have a text box containing a number, which is 40, and it's associated with a panel.

    Every time the player clicks the panel, the value in the text box should increase by 50%.

    How do I do this?

    EX:

    If the text box contains 40, and I click the panel, the value should increase by 50%, which makes it 60.

    If it's 60, it should increase to 90.

    For 90, it should increase to 135.

  • Thank you very much guys, I got it working...

    Again thanks for the help....