jonathang wrote:AMAZING SCRIPT LCL!!!
I'm using this script for my next test thing, however customizing it seems a bit more difficult than I thought it would...
So... Whenever I keep trying to make the text come out slower when my game is 60 fps, it ends up breaking the script! Can you show me how to print the type each 2-3 frames instead of each frame? Thanks lcl, again great script! +1 for you!
if (counter < strlen(Speak) && frame % 2 == 0) //The second condition here only allows the code to be run if current frame number is divisible by 2 (like 2, 4, 6, 8, ...)
{
type[counter] = Speak[counter];
sprintf(text, type);
counter ++;
}
lcl wrote:jonathang wrote:AMAZING SCRIPT LCL!!!
I'm using this script for my next test thing, however customizing it seems a bit more difficult than I thought it would...
So... Whenever I keep trying to make the text come out slower when my game is 60 fps, it ends up breaking the script! Can you show me how to print the type each 2-3 frames instead of each frame? Thanks lcl, again great script! +1 for you!
Haha, thanks! This is so old, though. Pyrometal is the one you should thank, this code works exactly like his, and I wouldn't have been able to write this, without looking at his code back then
Anyway, for updating the printed text only every 2 or 3 frames, use this:
- Code: Select all
if (counter < strlen(Speak) && frame % 2 == 0) //The second condition here only allows the code to be run if current frame number is divisible by 2 (like 2, 4, 6, 8, ...)
{
type[counter] = Speak[counter];
sprintf(text, type);
counter ++;
}
Zivouhr wrote:Cool. I'll take a look at it. Thanks Lcl and Pyrometal.
jonathang wrote:Sorry Pyrometal! I forgot to thank you!
jonathang wrote:And so it's the strlen part we had to change? I changed everything which kinda ruined it, I thought of using mod but yeah, wrong parts to change.
fmod(frame, 2)
jonathang wrote:Does strlen count the amount of characters stored in speak, or the amount of characters in the text by the way?
jonathang wrote:Works like a charm lcl! +1 for you!
lcl wrote:Yes, strlen returns the length of Speak. Also, strlen stands for string length.
lcl wrote:Great, thanks for the point!
Zivouhr wrote:Thanks Jonathang. I'll take a closer look at this code once I get some extra time this week. How are your games developing Jonathang? Nice to hear this code can help.
Looking forward to some news on LCL's games also.
pyrometal wrote:Wow, I'm very suprised there are still semi-active users here, using this stuff!
Zivouhr wrote:pyrometal wrote:Wow, I'm very suprised there are still semi-active users here, using this stuff!
Hey Pyrometal. I'm pretty sure I've played some of the games you've offered created with Game Editor. Was one of them with the little sci fi character who gained different weapons and abilities as he traveled through a maze, made for small smart phones? I remember text dialog too. Cool game and design. Correct me if I'm wrong. I have to look up the titles again as it's been a year or so since I played them.
Users browsing this forum: No registered users and 1 guest