Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [GM 8.1 Lite]Text System/Type-Writer/Textbox/Whatever  (Read 3773 times)

0 Members and 1 Guest are viewing this topic.
[GM 8.1 Lite]Text System/Type-Writer/Textbox/Wha...
« on: July 23, 2012, 07:15:16 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Going through my rpg project and converting it down to GM 8.0.  GM 8.1 is retarded as it adds a watermark onto a game made with Lite and has issues with tile layers and editor zooming(at least from my frustrating hours and hours of using it).  So, I have been going through everything item by item and having to copy/paste into a gm8 file.  I thought someone may benefit from the text engine I have at this point.  I hope it is easy to understand.  I do not comment code unfortunately.

Anyway, simple things like maxlines drawn as well as a wait/pause feature could be added.

Well, have fun.  If used, a credit in your project would be nice.
« Last Edit: July 23, 2012, 07:21:57 am by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: [GM 8.1 Lite]Text System/Type-Writer/Textbox...
« Reply #1 on: July 23, 2012, 10:33:15 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Interesting note: This doesn't work properly in GM 8.  Wonder if anyone would know why?  It works fine except that it is doing double of the starting char of each word.  I am on my Blackberry at work so I won't be ablt to try anything for 7 hours.
Logged
  • Super Fan Gamers!
Re: [GM 8.1 Lite]Text System/Type-Writer/Textbox...
« Reply #2 on: July 23, 2012, 11:06:30 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
When I put together a text engine component for a Pokemon Engine I worked on previously I ran into the same type of condition. The reason you get the double of the starting character is because of the index of the character you are drawing - at least I think, I can't be sure it was a while ago. The character at index 0 and 1 is treated as the same, to avoid the error you start at index 1.
Logged
Re: [GM 8.1 Lite]Text System/Type-Writer/Textbox...
« Reply #3 on: July 24, 2012, 02:18:10 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Well, I got off work early(thank god, pizza place was over 100 degrees) and so I tried your suggestion.  It solved one issue of the the first word not having 3 duplicates of the first character, however, each word has a duplicate of it's first character. Took a screenshot of what is happening.


Nevermind, I figured it out.  It was what you had said, I just forgot to change the current word's char counter to 1 as well.
Thanks, 4sword.
« Last Edit: July 24, 2012, 02:34:44 am by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: [GM 8.1 Lite]Text System/Type-Writer/Textbox...
« Reply #4 on: July 24, 2012, 02:40:23 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I don't know exactly how your code and mine are different, but when you call the string_char_at function such that you are doing string_char_at(completeText,0) you get nothing or possibly a space. If you do the string_char_at(completeText,1) you get "T". I get this in Game Maker 8.1. In this sense you are referring to part of the string that is not there.

Earlier versions of Game Maker handled this differently:
Quote from: http://store.yoyogames.com/downloads/gm4win/release-notes.html
Version 8.1.65 (Final) (no longer available)

Addressed issue
0000718: string_char_at(str,0) returns same as string_char_at(str,1)
0000714: Re-installation Failure
0000703: LIBs don't work...
Fixed bugs
0000720: Shift+Tab in Code editor works only when text is selected
0000719: On fullscreen watermakr becames very wide.
0000717: Middle mouse button panning jumps in Win7 dual monitor setup

This would show the duplicate letter.
Logged
Re: [GM 8.1 Lite]Text System/Type-Writer/Textbox...
« Reply #5 on: July 24, 2012, 02:45:56 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Already fixed it :P Check my post right above this one :3
The engine between 8.1 and 8 must be different for handling strings.
« Last Edit: July 24, 2012, 02:48:08 am by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: [GM 8.1 Lite]Text System/Type-Writer/Textbox...
« Reply #6 on: July 24, 2012, 02:53:56 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I was typing out my post when you went back to edit yours, but yeah that is the explanation of why the difference is there (the string_char_at function being goofy between versions). Anyway, the code you in your engine is pretty neat - I like the way it handles something that can be complicated to new people in a way that has a simple solution. It could be improved upon but it's a good place to start.
Logged
Re: [GM 8.1 Lite]Text System/Type-Writer/Textbox...
« Reply #7 on: July 24, 2012, 02:58:16 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
I just wanted something simple based upon old Final Fantasy NES games.  I am sure with arrays and such you could have colored words,resized words, and such.  As it stands, all I have to edit on it right now to complete what I want it to do is add line support.  Basically just a line counter of 3 and once it hits zero, it will wait for the user to hit the continue key(probably Z) then wipe out the drawn_text , reset back to 3 lines, then continue.
Logged
  • Super Fan Gamers!
Re: [GM 8.1 Lite]Text System/Type-Writer/Textbox...
« Reply #8 on: July 24, 2012, 03:26:20 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Multiple line support in Game Maker 8.1 Lite can be simple if you just reset the start position, but if you want to display partial lines so that you can actually do scrolling I recommend you take a look at the Pokemon Engine I did. It handles parsing a large string into smaller parts similar to how yours does, so you can probably use concepts from it (doing the line scrolling, resetting, and how to increment the start character in order to not loop so much to draw everything). It is here.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.369 seconds with 55 queries.