How do I make text loop?

0 favourites
From the Asset Store
SynthWave Loop Pack includes 68 seamless loops, founded on 11 original melodies.
  • I'm working on a survival horror game that has very limited graphics, relying on sound, and text instead. Its sort of like a hybrid of text adventure, and graphics, in that there are graphics to display where you are, almost like a zoomed in mini map - but each and every 'animation' or, 'environment' is relayed through text instead of visual stimuli. I want it to be something of a horror game with action elements that rely on the imagination.

    How I achieve this is by pinning text to both an enemy and player close so that it won't be too distracting from action. Basically, you can focus on the action in real time, and read about what the enemy is doing, and so on.

    The text appears based on timing, and button prompts. For an example, when shift is held, above the player text says, 'You raise your weapon.' and you're player will slow down in speed leaving you vulnerable. If it is released, it says, 'You put you're weapon away.'

    So, all this is fine and dandy, and above the zombie similar text presents every 5 seconds.

    So, like, 'Theirs a glimmer of hate in its vacant bleeding eyes.'

    and, 'A open sore shows maggots squirming.'

    I've written three, and I want to write more to give it more variety. But, the problem is, I have no idea how to loop the 'animations' (Descriptions, really. )

    I've played around with loops but it just makes the text look as if its having a mini stroke.

    I simply want the text actions to repeat. Randomize, preferably, but I'm not so much focusing on that currently.

    UPDATED: Forgot to mention that I'm relatively new to construct 2. I acknowledge that its super easy so far. Seriously impressed by how everything runs and how user friendly it is. Especially to newbs. But, I would still appreciate it if its explained step by step to me. Or, in child talk. Basically, just pretend I know nothing.

    Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • at justintime0185

    set up a global variable

    global (textCounter)

    then set a group of events like this...

    if textCounter is 1 then set "enemy text to "come , sit next to me"

    wait 5 seconds

    if textCounter is 2 then set "enemy text to "I love you"

    wait 5 seconds

    if textCounter is 3 then set "enemy text to "lets dance"

    wait 5 seconds

    if textCounter is 4 then set "enemy text to "what kind of car do you drive?"

    wait 5 seconds

    if textCounter is 5 then set "enemy text to "I give up"

    wait 5 seconds

    then create a random string like so...

    [every 5 seconds] system set textCounter to RANDOM(5)

    This will bounce threw your text displays randomly every five seconds setting it to a different text

  • Thanks a lot! I will give it a try later.

    Man I love how simple this is than coding a language that takes a while to understand. May buy a license when I want to put something on android.

  • No prob bro!

    Halla at me if you do, I have a complete tutorial on a android build

  • cant seem to find 'System: Set TextCounter' I made sure it was a global variable.

  • I have 'Add to', 'Reset global variables', 'Set value', and 'Substract from' all of which don't let me choose my TextCounter.

  • tried it with a instance variable too. No luck.

  • Will try again later.

  • Use (set value) then select the global var

  • Are you using a timed event?

  • Yes. I've went to set value and it doesn't let me choose a global variable.

  • Yes. And I tried to go to set value and it doesn't let me choose a global variable.

  • I tried timed event. Didn't work.

  • It doesn't seem to want to change the set no matter how hard I try.

    Like, its almost as if the variable or text needs to be destroyed and recreated to work...

  • 1.add Global Text Variable "ZombiText"

    ..add Global Number Variable "Phrase"=0

    On start of Layout set ZombiText

    "Theirs a glimmer of hate in its vacant bleeding eyes.#A open sore shows maggots squirming.#I simply want the text actions to repeat."[/code:320c99uf]
    pay attention!
    after every phrase I put "#"
    
    [img="http://i57.tinypic.com/bi2s0h.gif"]
    
    [img="http://i60.tinypic.com/303k0te.png"]
    
    You can add more phrases...just use "#" as separator...
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)