Jump to content


Minishcactus

Member Since 09 Feb 2012
Offline Last Active May 03 2012 06:06 AM

Posts I've Made

In Topic: Timeline

03 May 2012 - 06:08 AM

Timelines will stop running after you change rooms. It might persist if you have the object set to persistent, but I'm not sure.

If there will be no object animation, you can just show images of each room  rather than actually changing rooms. Or, like I said, try setting the object to Persistent. I don't know if the timeline resets when you change rooms, so watch that in the Debug Mode.

Also, make sure you set timeline_speed to greater than 0, otherwise the timeline won't execute.



Ah, I fixed it by duplicating the orb and having it do the rest of the timeline in the create event - so there's sort of a separate timeline per room, thank you though :)

In Topic: Scrolling Text Below Image

03 May 2012 - 02:28 AM

hmm... Now that I think about it I didn't account for the text drawing underneath of eachother.
The screen doesn't redraw, & the text is drawn over & over again rather than just once. Now you can easily fix that, however, you will most likely get a graphical error, which looks similar to scan lines, & it will cause alot of CPU strain, as it has to redraw EVERYTHING each time a new letter is added. Or you can simply go back to the text being un-aligned (which I would recommend).

however here is the code as it would look aligned to the center, displaying relatively properly.

ti = argument0; //Input text
to = '';        //Output text
tn = 0;         //Text at
c = !argument2;  //color modifier
face = argument1; //face sprite. 
//Give each expression its own mouth open & closed for vowels.
//Open mouth should be the second subimage

io_clear(); //clears the pressed status any previously pressed buttons & input devices for this step

while string_length(to) < string_length(ti)
{
    if argument3 = false //If you are not in "Cutscene" mode
    {
        draw_background(back_TextBox,0,480-128) //Draws the text box.
        //You can make this your own background
    }
    else //if you are in 'Cutscene' mode
    {
        draw_set_color(make_color_rgb(255*!c, 255*!c, 255*!c))    //makes the color black or white
        draw_rectangle(0,480-128,640,480,false) //Draws the "text box"
    }

    tn += 1;   //Sets the point where the text is at
    if sprite_exists(face) //if you have a face sprite.
    {
        if string_char_at(ti,tn)= 'A' //if there is a vowel at the current piece of text
        ||string_char_at(ti,tn) = 'E'
        ||string_char_at(ti,tn) = 'I'
        ||string_char_at(ti,tn) = 'O'
        ||string_char_at(ti,tn) = 'U'
        ||string_char_at(ti,tn) = 'Y'
        ||string_char_at(ti,tn) = 'a'
        ||string_char_at(ti,tn) = 'e'
        ||string_char_at(ti,tn) = 'i'
        ||string_char_at(ti,tn) = 'o'
        ||string_char_at(ti,tn) = 'y'
        {
            f=1; //mouth will be open
        }
        else f=0; //mouth is closed
        draw_sprite(face,f,8,480-123)
    }
    draw_set_font(fnt_Text)     //Sets the font to your Text font
    draw_set_halign(fa_center)
    draw_set_valign(fa_top)     //Aligns the font
    draw_set_color(make_color_rgb(255*c,255*c,255*c)); //makes the text color
    to = string_copy(ti,0,tn);  //Makes the output string
    draw_text_ext(320,480-123,to,15,-1);    //Draws the text
    screen_refresh();           //Refreshes the screen (so the text will appear)
    sleep(50);                  //Waits 25 milliseconds before iterating
    screen_redraw();     //redraws the screen, redrawing all active instance's draw events & sprites.
}
draw_set_color(c_aqua) //sets the color to light blue
draw_triangle(640-2, 480-20, 640-20, 480-20, 640-12, 480-2, false) //draws a triangle
screen_refresh();   //Refreshes the screen
while !keyboard_check(vk_enter) //Until the Enter key is pressed
{
    sleep(1);   //Waits 1 millisecond
}
screen_redraw();    //redraws the screen, stopping certain graphical glitches


Okay - I reverted --- I wanted to ask, how to I make multiple boxes - so like I press enter, but the person is still talking?

Nevermind - I figured it out! :D

In Topic: Scrolling Text Below Image

03 May 2012 - 01:54 AM


Ah okay - now I'm getting the face and the message - though the lips aren't moving? I'm trying to understand all this vowel stuff you did...is it so his mouth opens when you use a vowel or something? Anyway....how do I get the font to be in the center in the bottom of the screen?

Yes, as long as the first subimage (image_index = 0) in the sprite is the closed mouth & the second subimage (image_index = 1) is the mouth open it will open every vowel & close w/ every consonant or other characters, animating the sprite.
To get centered text change this bit of code:
    draw_set_valign(fa_top)     //Aligns the font
    draw_set_color(make_color_rgb(255*c,255*c,255*c)); //makes the text color
    to = string_copy(ti,0,tn);  //Makes the output string
    draw_text_ext(50+8,480-123,to,15,-1);    //Draws the text

to

    draw_set_halign(fa_center) //aligns the font to center.
    draw_set_valign(fa_top)     //Aligns the font to the top.
    draw_set_color(make_color_rgb(255*c,255*c,255*c)); //makes the text color
    to = string_copy(ti,0,tn);  //Makes the output string
    draw_text_ext(320,480-123,to,15,-1);    //Draws the text



Uhoh! This made the text spawn multiple times at once, so it's like a bunch of text running into each other....D:

In Topic: Collision Issues

03 May 2012 - 01:49 AM

Awesome! It's working now! :)

In Topic: Scrolling Text Below Image

03 May 2012 - 01:32 AM

scr_ isnt a function, it is just an identifier that I use in the names of scripts, like obj_ for objects, & spr_ for sprites. It's better programing & it helps me keep everything better organized, as to not end up crossing over the names of 2 resources (like a sprite & object both named Player).
Edit: if your script is named scr_DrawMessage then that should work. If not, change scr_DrawMessage to the actual name of your script.



Ah okay - now I'm getting the face and the message - though the lips aren't moving? I'm trying to understand all this vowel stuff you did...is it so his mouth opens when you use a vowel or something? Anyway....how do I get the font to be in the center in the bottom of the screen?