Jump to content

new game test run.gif

this is what happens if you have never played the game, once you run this one time, it never happens again

From the album:

People That are Cool and I like to talk to

  • 12 images
  • 39 image comments

Recommended Comments

I am disappointed in you Ashy. That word wrapping is awful! It always makes me cry a little inside whenever I see a game do it that way. You need to count ahead if you are going to type out one letter at a time. Is that really that hard? I wrote a script for ace to do it...


... Could it be that I am a word wrap snob?

Share this comment

Link to comment

You are making me sad Ashy, my inner programmer is crying bitter tears! :(


But sure, do it the lazy way. Go on. I can't stop you. Even if it hurts my heart a little each time I see it....


Hehe, I am just messing with ya, don't let my grumbles about word wrapping get you down. :3

Share this comment

Link to comment

Each time a word wraps like this, one fairy dies. That's why Kayzee is sad.


Seriously though, how you handle that at the moment? You made a good job already; I think at this point it would be just a matter of modifying the code a little, so that instead of wrapping in the middle of typing, it decides to wrap before drawing the word, that won't fit.

Share this comment

Link to comment

oh draw_text_ext function I see; that changes things. Well, then you'd have to implement the whole system for that; It's not long, but may be confusing to work with. I thought you did that already, but now I see, that you just used that function. Hmm in that case; forget what I said.

Share this comment

Link to comment

If you are curious how I did it in VX Ace, my script is here. It's probobly not too helpful for you though. Basically the way I do it is that when a letter is drawn, if it's a space, figure out how big the next word is going to be and insert a linebreak instead.


I will say this: It looks like the text is redrawn every frame and the one letter at a time effect is done by adding to the text string being drawn. Is there a better way to do the one letter at a time effect? Like if there are color control codes maybe drawing the whole text in black and recoloring it one letter at a time or something to that effect? Maybe drawing it one word at a time and not one letter at a time? The problem is not really the word wrapping it's self, but how it interacts with the one letter at a time effect.

Edited by Kayzee

Share this comment

Link to comment

ok so this goes every step


if alarm[0] == 0 {
    string_po += 1;
    strings += string_c;
    if string_po > string_length(init_ar[array_c]) {
        string_po = 1;
        array_c += 1;
        string_c = "";
        index = 1;
        strings = "";
    if array_c > 19 {
    alarm[0] = .15 * room_speed;

then in the alarm0


string_c = string_copy(init_ar[array_c],string_po,1);

and then it draws



like I said I spent thirty minutes writing, an hour debugging it. I don't have the same caliber mind like you programmers. I'm lucky if 1+1 still =2 at the end of the day. Likely I try to force it into =1 since 1 or 1 is 1. but ya.

Share this comment

Link to comment

That's just how Game Maker handles drawing I suppose. It redraws things each frame, so I think it's normal to have a loop, that draws each character separately.


So with that having in mind; I wrote it that way, so before drawing the text, it calculates the widths and whatsoever and modifies the string, that is going to be drawn. It adds line break commands into the string. So width checking is done once; before drawing text.


Now the drawing method itself - there's a variable, that keeps track of the progress. The higher the variable, the more it loops - for each character. Now if it will find, for example, "\C4" in the string, it will change the drawing color for one with ID 4 for characters past that point instead of actually typing that. At the moment I use "\B" to perform line break.



test_string=This is a\C1 relatively long string\C0, that will\C1 not fit \C0into a single line. It will be \C2automatically divided \C0into multiple lines based on \C3calculations \C0made in order to get the drawn word's width.\B\BThe process details are visible on the \C1poorly designed\C0, budget \C3black box to the left\C0.\B\BThere also are \C4multiple colors \C0in case you didn't notice. How fancy!\B\BNow a single word longer than the drawing area:\C1 1234567890123456789012345678901234567890123456789012345678901234567890




Notice how it added "\B" to the string in initialization.


In the result it's a pretty short code I suppose (about 100+ lines atm); but it's kinda confusing to come up with - not hard; it just follows some logic, but it requires some imagination and patience to configure that properly. My mind was blown few times-- until I noticed, that I accidentally made two ifs, instead of if+elsif heh. These typo-thingies are the worst. :P 

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Top ArrowTop Arrow Highlighted