Dialog Problem.

0 favourites
  • 12 posts
From the Asset Store
Template for a generic save / load system, fully documented in comments and video
  • Hi guys, I have set up check points throughout my lvl, when these checkpoints are hit it adds one to a variable that i set to play certain texts for each check mark. (the only way it made since to me)

    It is working fairly good except if you get to the second check point before the first text is over.

    It plays both of the texts at the same time. Is there a command i can put in to cancel out the first text once the next check box is hit.??? and suggestions would be appreciated. thanks

  • Really difficult without a capx, but is the text the same Text instance? If so then the old text should overwrite the last. If not then just pick the previous Text instance (give them an ID 1, 2, 3 etc for this) then clear the text for Text ID1 when you hit checkpoint 2, for example.

  • Yeah, you should be using the same text object, and just setting the new text when you reach the checkpoint.

  • As Burvey said, you should use one text object and just set its text. By the way, I'd put the text as a variable of the checkpoint object.

    And add the event:

    Player on collision with Checkpoint > Set checkpointDialog text to Checkpoint.text
                                          Set checkpointDialog visible
    [/code:1btggmto]
    Fail proof!
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is how i have it currently set up feel like something is a little wrong. Because it should be working smoother?

    I messed it up more somehow and now its not working well at all i must be missing something.

  • I didn't look through your code with a fine toothed comb but the one thing that jumps out at me is your use of the wait event. I believe that you should be using a timer behavior instead for that.

    Also, since you're using the free version, I think you should be able to save yourself a few events by moving your events (not triggers) in 53 and 54 all up to 52. You will need to make more events for the timer behavior though if you change it out with the wait, which you should.

  • I will give that shot. Have not used timers much. But if it is more common to use timers for text. I will learn to do it! thank you

  • It seems to me you would save a lot of space and time, and keep your code more organized, if you created a function to show Hippy and his tips. I can help you to set this up, but I'd need to see how exactly this thing behaves. If you can share the capx, I could just add it there for you.

  • I would love some help, but im a little embarrassed by how spastic and unorganized all my stuff is. Its kind of a organized chaos. I am not sure i know how to set up a function like that. only been working with the program a couple weeks so still trying to figure stuff out. So i would defiantly use the help. I am going to go try and neaten everything up a little.

  • Don't worry about the mess. We've all written messy code once...

  • Hmm, seems every time i try to upload capx it refreshes the page to blank. Is it a reputation thing?

  • Things that jump out at me are the triggers within triggers, like TextActivator: On destroyed within the Playerbox: Is overlapping TextActivator event. I'd move that out. Also the second redundant PlayerBox: Is overlapping TextActivator which you can delete.

    I recommend an Else in between the System:Textactivator = 1 and System: Textactivator = 2. This helps alleviate some common gotchas and IMO is more readable.

    Actions like Hippy: Set Visible, titktext: Set Visible, textbackground: Set visible seem to happen whatever Textactivator is activated, so just put them once, at the Playerbox: Is overlapping TextActivator event. Same with the "set Invisible" actions which can go once at the end.

    I know these aren't directly related to the Text issue.

    Having said all that, you should look at factoring out all the common code into Function(s) at some point. Or look into using Arrays to store your text, and index into the array with the Textactivator variable or similar.

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