AnD4D's Forum Posts

  • Anyone know how to add padding to text?

    Some of my text is italicised, and I have word wrapping on. If the text gets too close to the edge, sometimes it simply gets cut off.

    If I could add some padding to the text box, it would still display it, and also make the text wrap at an early position to ensure it doesn't get cut off.

    Additionally, I know we have wrapping for both word and character, but is there a way to turn it off entirely?

    While I'm at it, is anyone else working with Japanese characters in their games? Construct doesn't seem to like formatting them at all! I have to set it to character wrap in order to get it to work even slightly, which results in periods being added to the line below on occasion.

  • Anyone unable to access their save files from Onedrive? Hoping it's a quick fix.

  • In the Find Results window, there is a button dedicated to "Refresh".

    I'm currently going through about 70 results, replacing a little bit of code in each. Every single time I made a change, the search is refreshed, and the list scrolls back up to the top.

    This is making a 2 minute job take significantly longer.

    Is there a way I can stop Construct from refreshing the find list? I'm not pressing that refresh button, so why is it refreshing? Can this be a toggle? At the moment, I'm not sure what the point of the button is for, if it does it anyway.

  • Yeah, it's really annoying that NoSave behavior can't be added to arrays, dictionaries and JSON.

    I remember posting this suggestion, but it must have been on an old platform, and it never got implemented.

    What you can do is save array.AsJSON in an instance variable on a sprite with NoSave behavior, clear the array, save the game, restore the array from that instance variable.

    Haha! Yeah, that's what I had. While making it, I kept thinking how frustrating it was. Reminds me of the time a year ago where I mentioned multiplayer breaking when you leave the server before leaving the room. Ashley pretty much told me it was my mistake and I had to work around it.

    https://www.construct.net/en/forum/construct-3/how-do-i-8/multiplayer-broken-163229

    Look what's coming out in the next stable build! A fix for my exact issue.

    I guess all I needed was to wait for Ashley to start developing a multiplayer game.

    I hope a year from now I'll be able to have more control over what gets saved and what doesn't. Hopefully Ashley will try to add the ability to customize a save in his game, and we'll get it sooner XD

  • With sprites you can give them a "No Save" behaviour.

    Say I have an array or a Global Variable that I don't want to be included in the save game.

    How do I stop that from happening?

  • I think the default is mouse.x just grabs the bottom layer. I think it would be complicated for construct to automatically guess what layer to grab the position from or it may just be impossible most of the time to make a good guess.

    You're correct. My bottom layer is indeed 3D.

    However, I'm having a similar issue trying to get the sprite on the 3D layer to follow the cursor on the 2D layer if controlled by something other than mouse, such as a gamepad or a keyboard.

    Sprite.X("Layer") isn't a thing, unfortunately.

    My guess is I'll need to multiply its position based on the Z difference?

  • Thanks, R0J0hound. That did the trick, but strangely enough I had to tell the sprite on the 2D "Cursor" layer to set its X and Y to mouse.x("Cursor") rather than the 3D layer I expected.

    Makes sense if you think about it, but I'd have thought that would be default behaviour.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I appear to be having some issues with a mouse cursor if I have a 3D Camera enabled.

    I want the cursor to always be rendered on top of everything else, so I have it set on a 2D layer. When I do this, the cursor no longer stays on the mouse's x and y pos so long as I have the 3d camera enabled.

    Why is this? Why are 2d layers affected by 3d cameras?

    I mocked up a quick example. Feel free to check it out.

    https://1drv.ms/u/s!AlZkRk7KfdFFivsjA7O4P3LQrRDW0g?e=0iTe6y

    Is this intended by design? Seems... for lack of a better word... useless for game development. When would you not want a sprite to stick to the mouse if you set it to the mouse's x and y? I'd have thought a sprite on a 2d layer would follow the mouse.

    However, if you open debug and look at the mouse object, it shows a different x and y position for each layer. There's no way I can use this data from what I can tell.

    I want the sprite to appear on the HUD layer, but get its positioning from the 3D layer, apparently.

    Also, I know I could replace the cursor with a sprite, and that works, but for my actual game, rather than a sprite, I'm using particles.

    Any ideas?

  • Had similar occurences a couple times. A new export, upload, and cache refresh (ctrl+F5) solved it.

    Tried that :D For the past 4 hours, I've been removing eventsheets, sprites, etc, and have finally reached a point where if I delete any more objects, the game doesn't crash.

    Time to submit a bug report.

  • Ashley So... not sure whether to pursue this.

    I started to minimalize the project, deleting events and sprites until it reached the point where the game started working again.

    When that happened, I started backtracking and undoing my deletions until the project stopped working again.

    The problem is... it didn't break again. Apparently deleting the game and undoing that has fixed the bug. Literally nothing else has changed.

    I have a save file before it broke, which is still broken, but how could deleting and undoing solve this problem?

    Do you still want me to figure out which specific sprite or file broke the game? Or should I just shrug it off?

  • Just to follow up, the game also works when exported using NW.exe. It just doesn't work when exported as HTML5.

    Ashley So I'm not sure if this is a bug with something I've changed in the game, but it seems odd that it only appears in the html5 export.

    I've been testing the game online using HTML5 exports from the very beginning, so it's odd that it's suddenly started happening.

    As I mentioned, the only thing I've really added is audio and a few more sprites.

  • I've been testing my game on a webhost, as recommended, for the past 2 months.

    However, today I'm getting an unusual error, and a black screen.

    The error is:

    Uncaught (in promise) TypeError: Cannot read properties of null (reading 'IsInContainer') at Layout._CreateAndLinkContainerInstances (c3runtime.js:1636:210) at Layout._StartRunning (c3runtime.js:1630:446) at C3Runtime.Start (c3runtime.js:3235:417) at async C3Runtime.Init (c3runtime.js:3220:161) at async RuntimeInterface._InitDOM (main.js:41:1) at async RuntimeInterface._Init (main.js:28:372)

    I am able to load an earlier build, and this isn't appearing.

    The only thing I've changed is adding audio to the game, and a few graphics.

    The game plays perfectly fine in preview mode (albiet a little slower than it did in the previous version of Construct 3), but beyond that, I have no idea how to fix the error.

    All I get is a black screen, no audio... nothing.

  • Any chance you can update your topic title to layout rather than layer so this is more useful?

    I just tried a search for "How to check if layers exist", and was brought here :(

  • How did you fix it on CORS?

  • Are you able to post a pic of your events?

    If a sound is to be played if the character is on the screen, it will CONSTANTLY play the sound until the player leaves the screen.

    It won't just happen once. It will be like it's playing the same sound 60 times a second, every second.

    Use the "trigger once" event, or find a better alternative.