Game authors and players, please read this thread!

Author Topic: SOLVED: DisplayAt - Game.TextReadingSpeed problem.  (Read 339 times)  Share 

Hi

EDIT: Using Game.MinimumTextDisplayTimeMs seems to do the trick.

------------------------------------------------------------------------------------------------------
I have just noticed that DisplayAt is not displaying text as Display does as it is not complying with Game.TextReadingSpeed which I have as 7.

I need to position text due to screen area.

Code: Adventure Game Studio
  1.  
  2.   DisplayAt(30, 100, 500,  "%s %s %s %s",
  3.   "12 years have passed since that fateful day when your parents were killed. Over the years your mind has
  4.  been tortured by its darkside!",  
  5.   "[[You have changed. From a mild mannered young boy to a disturbed, neurotic adolescent hell bent on
  6.  revenge!",
  7.   "You enrolled in all the martial arts and made great acclaim in Kodokan Goshin Jutsu, Kapap, Bartitsu and
  8.  Karate. You have been preparing yourself to avenge your parents murders!",
  9.   "[[You learn that the gang invloved in your parents death were part of the Polizti gang. They must pay!
  10.  They must suffer as you have!");
  11.  

Can you offer a way round this?

cheers
« Last Edit: 26 Jun 2012, 10:47 by Red Belly »
I am not dead, I am only sleeping ;)

monkey_05_06

  • AGS Project Admins
  • Has left the building.
Re: SOLVED: DisplayAt - Game.TextReadingSpeed problem.
« Reply #1 on: 26 Jun 2012, 15:19 »
invloved

I too suffer from a deep, longing desire to have inventory. In my pants. 8-)

Regarding this issue, without doing further testing, how long was the text staying on-screen? You're creating a rather lengthy string, but my initial thought is that if it's not displaying for very long it may be calculating the display time before injecting the formatted parameters. I don't see why it would be doing that, but could possibly be a bug. You definitely shouldn't have to use Game.MinimumTextDisplayTimeMs for this...

Edit: Based on some preliminary review of the editor source, this definitely doesn't look to be a bug. The text is being formatted before being displayed. So again, how long was the text actually displaying? Also, you were setting the text reading speed first right?
« Last Edit: 26 Jun 2012, 15:28 by monkey_05_06 »
Let's be honest. Most people suck at coding. I suck at coding, but at least my code is readable. To Hell with anyone too lazy to maintain consistent formatting in their code. I could deal with bad interfaces and structure if I could even read your horrible code. And that's putting it nicely. -monkey

Re: SOLVED: DisplayAt - Game.TextReadingSpeed problem.
« Reply #2 on: 26 Jun 2012, 21:02 »
Hi Monkey

with just Game reading text set at 15 the DisplayAt was showing for about 5 seconds only (4 strings.)

Was it actually failing to read all strings and stopped after first %s?

After fiddling around I use the Game.MinimumTextDisplayTimeMs set at 40000 alonf with Game reading text and it then seemed to be ok.

steptoe


« Last Edit: 26 Jun 2012, 21:05 by Red Belly »
I am not dead, I am only sleeping ;)

monkey_05_06

  • AGS Project Admins
  • Has left the building.
Re: SOLVED: DisplayAt - Game.TextReadingSpeed problem.
« Reply #3 on: 26 Jun 2012, 21:40 »
Code: Adventure Game Studio
  1. String text = "Blah blah blah";
  2. int loops = ((text.Length / Game.TextReadingSpeed) + 1) * GetGameSpeed();

Based on this formula and I calculated roughly 550 characters in your string, it should be displaying it for about 25 seconds.

Do some debugging for me...

Code: Adventure Game Studio
  1. DateTime *now = DateTime.Now;
  2. int oldTime = now.RawTime;
  3. String text = String.Format("%s %s %s %s",
  4.   "12 years have passed since that fateful day when your parents were killed. Over the years your mind has been tortured by its darkside!",
  5.   "[[You have changed. From a mild mannered young boy to a disturbed, neurotic adolescent hell bent on revenge!",
  6.   "You enrolled in all the martial arts and made great acclaim in Kodokan Goshin Jutsu, Kapap, Bartitsu and Karate. You have been preparing yourself to avenge your parents murders!",
  7.   "[[You learn that the gang invloved in your parents death were part of the Polizti gang. They must pay! They must suffer as you have!");
  8. DisplayAt(30, 100, 500, text);
  9. now = DateTime.Now;
  10. Display("Text length: %d, Text reading speed: %d, Time elapsed: %d seconds!", text.Length, Game.TextReadingSpeed, now.RawTime - oldTime);

Please tell me exactly what output you get. :)
Let's be honest. Most people suck at coding. I suck at coding, but at least my code is readable. To Hell with anyone too lazy to maintain consistent formatting in their code. I could deal with bad interfaces and structure if I could even read your horrible code. And that's putting it nicely. -monkey

Re: SOLVED: DisplayAt - Game.TextReadingSpeed problem.
« Reply #4 on: 26 Jun 2012, 21:55 »
Hi Monkey

I will give your code a test tomorrow..

cheers

steptoe
I am not dead, I am only sleeping ;)

monkey_05_06

  • AGS Project Admins
  • Has left the building.
Re: SOLVED: DisplayAt - Game.TextReadingSpeed problem.
« Reply #5 on: 28 Jun 2012, 21:44 »
Hmm..I don't know where I got 25 from. I think I was insane when I typed that. It should be closer to 37.

By the way, for historical benefit, I just wanted to note that Red Belly PM'd me the following:

Quote from: Red Belly
The script you suggested seems to work ok.

I only had game.skip_display = 0; and NO Game.TextReadingSpeed

This is what was returned:

Text length:554, Text Reading Speed:15, Time elapsed:37 seconds!

He didn't specify what changed between reportedly only showing for about 5 seconds...presumably it was something related to confusion between game.skip_display and Game.TextReadingSpeed? In any case, 37 seconds is the expected result (still don't know where I got 25 from), so it would seem that this indeed was a case of scripting error, and has been resolved. ;)

P.S. Only off by 4 characters? Hah! Pretty good guess then. :D
Let's be honest. Most people suck at coding. I suck at coding, but at least my code is readable. To Hell with anyone too lazy to maintain consistent formatting in their code. I could deal with bad interfaces and structure if I could even read your horrible code. And that's putting it nicely. -monkey

Re: SOLVED: DisplayAt - Game.TextReadingSpeed problem.
« Reply #6 on: 28 Jun 2012, 22:15 »
Monkey

what's 4 characters between friends (laugh)

cheers a lotto  8-)
I am not dead, I am only sleeping ;)

Calin Leafshade

  • AGS Project Admins
  • Long live King Cat!
    • I can help with AGS tutoring
    •  
    • I can help with voice acting
    •  
  • Calin Leafshade worked on a game that was nominated for an AGS Award!Calin Leafshade worked on a game that won an AGS Award!
Re: SOLVED: DisplayAt - Game.TextReadingSpeed problem.
« Reply #7 on: 29 Jun 2012, 11:35 »
Hold on this might still be a bug.

You skipped the bug by formatting it as a string first.

Code: Adventure Game Studio
  1. Display("%s %s", "lol", lmao");

is not the same as

Code: Adventure Game Studio
  1. String text = String.Format("%s %s", "lol", "lmao");
  2. Display(text);

(note that im not saying it *is* a bug, merely that you sidestepped the issue with your debugging)

Leon: You need the sword first before you can get the monkey.

Re: SOLVED: DisplayAt - Game.TextReadingSpeed problem.
« Reply #8 on: 29 Jun 2012, 12:05 »
Hi Calin

yes, I understand what you are saying. I will look into this.

cheers

steptoe

I am not dead, I am only sleeping ;)

monkey_05_06

  • AGS Project Admins
  • Has left the building.
Re: SOLVED: DisplayAt - Game.TextReadingSpeed problem.
« Reply #9 on: 29 Jun 2012, 16:57 »
I looked through the source and the two should be functionally equivalent. DisplayAt is definitely formatting the string before displaying it. Granted, you're right that I didn't actually test it by passing the values directly into the DisplayAt function, but the engine code is doing the same thing.
Let's be honest. Most people suck at coding. I suck at coding, but at least my code is readable. To Hell with anyone too lazy to maintain consistent formatting in their code. I could deal with bad interfaces and structure if I could even read your horrible code. And that's putting it nicely. -monkey