Nilom's Recent Forum Activity

  • Okay before I try to understand your code I made a simple example on how I would implement word wrapping.

    Let me know if this could help you.

  • This is strange. Do you append the text? Can you show us the code that you use?

    I'm not sure about checking for a line break.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did you try setting wrapping to word in the text objects properties? You have to have at least one text object on the layout in the editor for it to work and for it to safe these properties. You can delete it on start of layout.

  • You should have one function doing what you want and use function parameters if you want alternations of that function.

    Imagine you have 3 different versions of the same function on 3 event sheets and then you need to change huge portions of that function. Than you have to do every change 3 times instead of just one time. Also it can get messy if you forget to update some of these functions to the newest changes.

    I would probably use a Boolean function parameter so that you can easily enable or disable additional function behavior.

  • Why would you want to do that? I can call my functions from other event sheets. In fact I have a whole event sheet just for functions and call them from my main event sheet.

  • You could use "wait for signal xxx" on b and at the end of a you give the "signal xxx".

    But I would probably avoid running too many events zigzag from different layouts. If you can avoid it.

  • It's up to you how you organize your data in table format. Pages may represent a parent object in JSON. (shops in my example above) I also often try to split big arrays into multiple pages, simply because it's easier to read and edit than one huge wall of numbers.

    Okay great. I think I already know how I'm going to structure it.

    And of course not all JSONs can be done this way, I have a few plain-text JSON files in my project as well.

    Yeah I have that as well. But I think for database-like it is better to use actual tables.

  • oosyrag Interesting. I will look into Google Forms (I guess that's what it's called?).

    dop2000 Cool. Thank you very much for the example. So depth translates to the different pages? When I copy data from Google Sheets, can I just copy the whole page?

    I also found this. That is a script that can export JSON from Google Sheets.

  • Hello there!

    I'm wondering what the most practical way to add and edit card data would be.

    Of course ingame I will be storing all the data in a JSON object. But I think it is very error prone and slow, due to formatting, to manually write hundreds of JSON entries into a JSON file.

    Additionally I really like being able to write down new card ideas on my phone on the go.

    So Google Sheets comes to my mind. Is there another good way to do this?

  • Ahhhh! Now I got it.

    I tried it with action set variable but I did it wrong:

    find(usage, "/") > 0 ? filter_mode="match" : filter_mode="contains"

    Thank you!

  • Hey there!

    Why doesn't the following evaluate expression work?

    "find(usage, "/") > 0" returns 1 in console log. And 1 should be "true" right?

    This does not trigger. There is no browser log shown:

    Can't I set variables inside this conditional operator?

    What am I doing wrong here?

    Edit: I added the parentheses just for testing purposes. Originally I had

    find(usage, "/") > 0 ? filter_mode="match" : filter_mode="contains"

    which didn't work either.

  • If it is for personal use only you can just use the browser plugin. If you want to sell it you should use an online databank.

    But I assume that you use it personal.

    On start of layout set the following variables:

    current_month = mid((Browser.ExecJS("Date()")),4,3)
    current_day = mid((Browser.ExecJS("Date()")),8,2)
    current_year = mid((Browser.ExecJS("Date()")),11,4)

    Save the door numbers in a variable door_number inside the door sprites.

    Then on door sprite creation check the local storage to find if there is the door_number safed as open. If so show an open door instead.

    On door sprite clicked compare two values:

    current_year = 2022
    current_month = "Dec"
    current_day >= sprite.door_number
    	-> do stuff and safe to local storage that you opened the door
Nilom's avatar

Nilom

Member since 26 Dec, 2019

Twitter
Nilom has 1 followers

Trophy Case

  • 4-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

9/44
How to earn trophies