Burvey's Recent Forum Activity

  • No, I don't think so.

  • Use on pressed instead of is down.

  • No problem. The reason it didn't work the first time is because the array wasn't loaded in time. If you want to call the array from another layout, after the one with this code is on it runs, you can set the text on the start of the new layout without any issues.

  • Ok... But I found your video so it doesn't really matter right?

  • As a test, move the Set Text to Array... action up right under Load from JSON string and see if it works.

  • You know, I think I may have found your video... Developed in C2, has flowers with fire in them, platformer guy with a mask, red color scheme and asian name.

    Subscribe to Construct videos now
  • They do keep watch history for that long, and you can search your watch history as well, you don't have to browse through everything. It's likely the only way you're going to find what you're looking for.

  • Have you tried browsing through your youtube history or liked videos etc? Maybe it's still in there?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, the first thing you'll want to do is in your project click on the layout editor (Just like if you were going to add a new sprite to the project) and add the AJAX object and the Array object.

    Then go to the bottom right of the screen and in the Projects panel right click on Files then click on Import Files. Import the .json file to the project.

    Then you'll need to add some events to your eventsheet like this:

    System, On start of layout -> AJAX Request yourfilename.json (tag "sentences")

    In another event under it add this:

    AJAX, On "sentences" completed -> Array, Load from JSON string AJAX.LastData

    Now your array is set up and ready to use. To choose a random sentence to display, you'll use something like this:

    Add the Text object to your level layout (the same way you would add a new sprite). Resize the text object so it's large enough to display your sentences, then add the following to your level eventsheet.

    System, On start of layout -> Text, Set Text to Array.At(0,(random(100))

    The 100 is the number of sentences that you have setup.

    Try that out and once you have it set up if it doesn't work then I'll help you tweak it.

  • Well, I mean, you're not giving much to go by. The only game remotely close that I can think of off the top of my head would be Jack B. Nimble.

  • I would start here:

    Good luck!

  • That's how it works by default unless you have something funky going on in your events. Can you post your capx or a screenshot of the event sheet?

Burvey's avatar

Burvey

Member since 5 Oct, 2013

None one is following Burvey yet!

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies