narFsnw's Forum Posts

  • How do we reset static variables to their default (initial) value?

    I'm making a function that delete the savefile (since Construct doesn't provide an easy way to do so, which would be very useful btw ).

    My "deleteSavefile" function does the following:

    • Clear local storage
    • Reset global variables to default
    • Reset persistent objects
    • Send the player to the title screen

    What I can't figure out how to do is to reset the static variables to their initial values. Right now, after calling this function, the player is sent to the title screen, but when clicking "New Game", it's not really a new game, because all static variables kept their values.

    You folks have any tips for me? Thanks

  • Ahhhhh! Obviously, it was a dumb thing. But I found it!!

    On page #2 of the tutorial, Ashley suggest to untick "Public". But if, like me, your network is not setup properly, then maybe you can try to actually keep it tick.

    Side note: If you already created the rule, no need to create a new one. Go in your Advanced Firewall Settings, and fin the rule you created before. Double-click it and go to the "Advance" tab to tick the "Public" checkbox.

    Hope this will help other people!

  • Ok, so, I'm sure there's a dumb thing that I'm missing, but I can't make the Preview on Lan work.

    I'm following this tutorial here https://www.scirra.com/tutorials/247/ho ... ork/page-1

    Followed instructions of all 3 pages twice, and it still doesn't work. It used to work on my previous computer so I'm guessing it might be related to Windows 10's firewall maybe?

    Any tips or suggestions? What am I blindly missing?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Mostly suggestions of improvements around the search feature and the dev interface:

    • Be able to do a search in all event sheet at the same time
    • Highlight the found conditions or actions when doing a search with a bright color (instead of hiding the other conditions or actions)
    • Improve the warning when deleting a variable or a behavior in an object: instead of just saying that "affected lines will be removed", it should tell *how many* lines will be removed (so that I feel safe that I cleaned my code correctly before deleting a variable).

    Stuff like that.

  • Is there a place where all feature requests are cataloged? Like a Jira database or something?

    I have some UI improvement in mind for the editor, mostly related with the search tool, but I don't want to bombard the forums with duplicate requests.

    I'm aware that C3 is being developed with a focus on the editor itself, so even if those requests never make it to C2, maybe they can be taken in consideration for C3.

  • What exactly is considered a top level event?

    I'm guessing from the name it's an event that is not a sub-event.

    1) If my event is inside a group, or inside a group-in-a-group, it is still a top level event? (I saw some confusion in other posts)

    2) Are functions top-level event? I'm guessing that it depend on where I call that function?

    3) Events that are triggered at the end of something, like "on path found" or "on preload complete", etc. Are those top level?

  • Ok, I see now.

    For reference, if someone else find this post, here's links to other topics where this is discussed:

    is-this-a-bug-can-t-pick-objects-created-in-the-same-ti_p890954?#p890954

    and

    will-the-span-class-posthilit-top-span-span-class-posthilit-level-s_p980737?#p980737

    Is there any official documentation about this? I can't find anything in the manual. Might be useful to also add a warning next to the "create object" function on this page: https://www.scirra.com/manual/125/system-actions

  • Hmmm I see... But then, why is it picked in my event #6 (pick instance with UID)? It's not in the next top level event, so it should not pick the newly created object, right?

    And then, if I really want to pick it in another block when the button is clicked, I should create another top level "on button clicked" event? That's the recommended way of working around that limitation?

    Is there documentation I could read on the subject? I tried looking in the manuals but I can't find anything about those technical aspects.

  • I don't know how your enemies are moving, but why not have an event like this:

    Ennemy: On collision with "Wall" : Change direction to move away from the wall.

  • Hi,

    What is the expected behavior for Construct to pick objects when the object was created in a separated block?

    I created this little test. It creates an object and then try to pick it in different ways.

    (see the full image: https://dl.dropboxusercontent.com/u/313 ... et%201.png)

    What I'm wondering is why the "Pick all xxxx" doesn't catch the newly created object.

    Here's the link to my capx: https://dl.dropboxusercontent.com/u/313 ... reate.capx

  • In other words, it's exactly the same issue as this one:

    ...but it now requires the game to be relaunched (closing or refreshing the tab or using the "reload" button in the debugger) for the issue to happen.

  • Oh my god! I'm so blind!!

    It was right there all along! In the list of System conditions!

    For the reference, here's where it is:

    Add condition > System > Is value type

  • One solution could be to write a function that would check, character by character, if they are all digits or all letters. But I'm trying to know if there's already a function built it. Something like function isNumber() or isNaN(). Is there anything like that?

  • I have a function that receive 2 parameters: a number and a string.

    Because I'm dumb when I code (happens to everybody!), I sometime send the parameter inverted: the number instead of the string and the string in place of the number.

    I want to make this function stupid proof by checking if the parameter received are indeed of the right type. Something like:

    If type of function.param(0) == "number"
    --> browser.log("Incorrect parameter")
    
    If type of function.param(1) == "text"
    --> browser.log("incorrect parameter")[/code:3akx0gtu]
    
    How can I do that? How can I check the type of a variable?
  • The issue have been submitted here: