text object doesn't re-populate upon restart of la

0 favourites
  • 7 posts
From the Asset Store
In this template the music plays without looping in your game
  • I have a small issue with the game I'm working on. There are three layouts, the first upon startup loads a project text file via AJAX and loads the text into a Text object. Press a key, goes to the next layout. The player dies, it goes to the third layout (GAME OVER) and if the player presses R it should go back to the very first layout. Upon eturn to that first layout, it doesn't seem to get the text from the porject file and put it into the text object...

    Any ideas?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Since I haven't received any answers I've posted screen shots of the two event sheets in question...

    dl.dropboxusercontent.com/u/108572298/introLayoout.png

    dl.dropboxusercontent.com/u/108572298/gameoverLayout.png

  • Remember, the first time through it works, the next time through it does not. It's not covered in the manual, nor could I find a tutorial specific to this issue.

    I don't think it's a logic thing because if it were, it would most likely not work the first time. Granted, I don't really need to do this via a file (an embedded project file) and the AJAX object, but I thought it'd be an interesting exercise.

    Can anyone offer a suggestion as to why it works once, and only once unless I completey reload the browser?

    1st layout - loads the project text file via AJAX displays it into the text object. Got to level 2, play the game. In the event the character dies, go to layout 3. Press R to restart, go to 1st layout, project file does not get loaded, and no error reported by the AJAx object.

  • So, the second time through it isn't pulling the data from the intro.txt file, correct?

    Would that info change? If not, would it be possible to load that info once and store it in a global variable for use later?

    Or is this just more of a, why isn't this working?

  • It's more of a why isn't it working. I could do 1 of three things to display the text I need, but I really would've thought the AJAX call should work at the layout start when that layout starts.

    Option 1: populate the text object and leave it static (currently I re-use the text object for some other textual elements to try and make it more efficient) or a global variable I suppose, I could just hard code the text in the event sheet (not a fan of this idea with quotes and newlines breaking it up in the dialog for entering text via the event sheet and if it needs to be edited) and option 3 would be on the game restart don't go to the first layout at all since it's the intro layout, but I know who'll be playing this game (friends & family) and they'll need the intro re-fresher... :)

    So there's a few options I could take, but it's just befuddling me that it's not working. It's not all that complicated if you looked at the screen shots posted above...

  • Looking at the code I can't think of any reason it's not working either. I haven't played with AJAX very much, but this looks like a bug to me.

  • I wanted to second that I'm also having this error. AJAX requests don't appear to fire on layout restart. Saving it to another file as a workaround for now until fixed (also still on r141 given all the bugs/performance issues with latest releases, possible it was fixed in a later release).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)