Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Cassiebsg

#701
The Rumpus Room / Re: Name the Game
Thu 16/03/2017 18:18:43
Pirates?
#702
I'm not a musician, but would sure try to participate as a listener and a voter. (nod)
#703
Yes, I knew why they were writing simultaneous, just not how to stop the first line from being removed. ;)
I'll give a try, and thanks bunch for the help and the module! (nod)


EDIT: Been trying this but now the second line (or any other after the 1st) never starts... :( Not sure what I did wrong, probably the arrays?
#704
Yes, I'm actually using 6 labels in the GUI, because I wanted the text to be displayed in different places on screen, and thought it would be easier to print each line to a new label... (roll)
I'm pretty happy the way it's working now, except for the top label with the smaller font and the bottom label with the bigger font are printed at the same time.
I would love it to print the fist line, not clear the line, then type the second line, and then clear the two lines simultanoues when I move to print line 3 and 4.

I tried to figure where the clear was in the code, but failed to see it. :-[

Here's the code I'm currently using:
Code: ags

#define footline_TYPEWRITER_PRESET 1

String footlines[];
int footline_count;
int footline_index;
int footline_tw;

function game_start()
{
  footline_count = 7;
  footlines = new String[footline_count];
  footlines[0] = "A fan game by     [";
  footlines[1] = "Sandra T. Almeida [";
  footlines[2] = "Made with             [";
  footlines[3] = "Adventure Game Studio [";
  footlines[4] = "based on the original TV show: [";
  footlines[5] = "Battlestar Galactica           [";
  footlines[6] = " ";
  footline_index = 0;
  footline_tw = NO_TYPEWRITER;
  
  //lblTypedText1.TextColor = 64960;
  //lblFootline.Font = eFontGalactican;
  lblTypedText1.Text = "";
  lblTypedText1t.Text = "";
  lblTypedText2.Text = "";
  lblTypedText2t.Text = "";
  lblTypedText3.Text = "";
  lblTypedText3t.Text = "";
  
  TypewriterPreset.SetGeneral(footline_TYPEWRITER_PRESET, 2, 4, eTypedDelay_LongSpace, 10);
  //TypewriterPreset.SetCaret(footline_TYPEWRITER_PRESET, 2, 4, eTypedCaret_Explicit, " ");
  //AudioClip *type_clips[] = new AudioClip[3];
  // type_clips[0] = aKeyboard;
  //type_clips[1] = aKeyboard2;
 // type_clips[2] = aKeyboard3;
 // TypewriterPreset.SetSoundArray(footline_TYPEWRITER_PRESET, type_clips, 3, null, aKeyboard_beep);
}

void NextFootline()
{
  if (!playingCredits)
  {
    if (footline_tw != NO_TYPEWRITER)
    {
      TypewriterRunners.Cancel(footline_tw);
    }
  }
}

function repeatedly_execute_always()
{
  if (!playingCredits)
  {
    if (footline_tw != NO_TYPEWRITER)
    {
      if (!TypewriterRunners.IsActive[footline_tw])
        footline_tw = NO_TYPEWRITER;
    }
    if (footline_tw == NO_TYPEWRITER)
    {
      if (Game.DoOnceOnly("1st intro line")) 
      {
        lblTypedText1t.Font = eFontOptimus;
        footline_tw = lblTypedText1t.Typewriter(footlines[footline_index], eNoBlock, footline_TYPEWRITER_PRESET);
        //lblTypedText1="";
        footline_index++;
        footline_tw = lblTypedText1.Typewriter(footlines[footline_index], eNoBlock, footline_TYPEWRITER_PRESET);
      }
      else if (Game.DoOnceOnly("2nd intro line")) 
      {
        lblTypedText1t.Text="";
        footline_tw = lblTypedText2t.Typewriter(footlines[footline_index], eNoBlock, footline_TYPEWRITER_PRESET);
        footline_index++;
        footline_tw = lblTypedText2.Typewriter(footlines[footline_index], eNoBlock, footline_TYPEWRITER_PRESET);
      }
        else if (Game.DoOnceOnly("3rd intro line")) 
      {
        lblTypedText2t.Text="";
        footline_tw = lblTypedText3t.Typewriter(footlines[footline_index], eNoBlock, footline_TYPEWRITER_PRESET);
        footline_index++;
        footline_tw = lblTypedText3.Typewriter(footlines[footline_index], eNoBlock, footline_TYPEWRITER_PRESET);
      }
      footline_index++;
      if (footline_index == footline_count || footlines[footline_index] == null)
      {
        lblTypedText3.Text="";
        footline_index = 6;
      }
    }
  }
}


The label ending in t is the top line with the smaller font.

But don't go out of your way if making it work slightly different is too much of a pain. It's just a little fine tune to make it 1% better (in my eyes, that is). (laugh)

EDIT: Fixed the indent... seems like the forum doesn't like my copy/pastes from the editor (I'm using tab for indent there...)
#705
I'll give it a try, can it be a transparent GUI/overlay?

I'm using the D3D plugin by AJA for the video rendering found here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=45348.0
You can probably easily test it your self, if you like, by copy pasting my code into a new game's room, and just replace the video filename with any other ogv movie you might have laying around.

EDIT: No, text gets drawn over the video. At least the speech text does. Had no problem rendering the TextSay over it.

EDIT2: Okay, tried it with a GUI, I imported the footline code from your demo to test, and edited the lines relating to sounds out.
I got it to sorta work. It seems it can render over the video. (nod) Only it doesn't run while the speech is running. (wrong) So, I only get the first line rendered once I hit the start button on the main menu, and my second video starts. ??? Then the next comes first after the game has started (controling the character in a non-blocking way). So my guess right now is, the GUI lbl won't uptade if it's blocked.

Haven't tried overlay yet, since I have never used overlays before, meaning that it's even a bigger mystery for me. (roll)

EDIT3: Now I'm even more confuse... works even in blocked mode, but still not over my first video. This is weird, since the code is the same for both videos, is it not? ??? (EDIT4: And now I'm at a loss... put my 1st video on the cutscene_start and then I get the text typed... with the cutscene_Intro it doesn't run... what is different? ??? )

EDIT5: Okay, got it working with a GUI! :-D :-D :-D Now I just need to change the lines to display my text and fine tune it! (nod)
Thanks, and sorry for being a noob. ;)
And oh, am not sure what was wrong before, I changed 2 things, I moved the NextFootline(); to room_load() and added a variable to fire up my code in rep_exe... which ever of the two "fixes" was, it's working! :-D

EDIT 6: Am I over doing this? Sorry.
Now I'm trying to complicate a simple thing... I am here trying to keep 2 lines on screen, instead of writing one line, clear, and then write a second line. I realized that I can just use the [ to break a line into 2, and I would do that, if I didn't want to use a smaller font on the 1st line and a bigger on the second. (roll)
I've managed to do it, by writing 2 lines simultaneous (though I would prefer to write one at a time), but the first line is still removed before the second. Is there a simple setting I can change, or this is not possible without some complicated rewrite?
#706
Okay, I figured out why it's not working... seems like it can't render over my BG video?
I "removed" the code for the D3D pluging BG video, and now it's working. (nod) Looks really nice too!
Also thanks for the heads up with the TextColor code. :)
Do you think it's possible to render it over the video, like the speech is? If it's not it's okay, I'll just have to work something else out. Or add the text to the rendered video.

EDIT: Also, think you canceled the module too quick, seems to be working just fine, and that it's just my ineptitude to understand the complex code plus my other messy code that was on the way. ;)
Only real needed change, seem to be in your example code, where you typed string s instead of String s. ;)
#707
Oh. :~(
And I was enjoying seeing the text printed there... (roll)

Hope you can fix it soon, and sorry for being a pain.
#708
Okay, replacing TypeSay with TypeOnDS rproduces: Erro (line 137): Type mismatch: cannot convert 'const string' to 'string'

I looked at the code, and if I replace function TypeOnDS(string st) with function TypeOnDS(String st)
then it runs, but I can't see the text being printed on screen. :-\
#709
No, I told you I had no idea what I was doing. Not that as easy to use this module. :-[

So, how do I call the tt_draw, then? And how do I call TypeOnDS??

Or: What code should I be using?
#710
Code: ags

// text script for room
TypedTextDrawing tt_draw;
DynamicSprite *roomBkg; // will keep saved room background
 

function RestoreRoomBkg()
{
    // Restore original room background
    DrawingSurface *ds = Room.GetDrawingSurfaceForBackground();
    ds.DrawImage(0, 0, roomBkg.Graphic);
    ds.Release();
}
 
// Calling TypeOnDS will start typed text
function TypeOnDS(string st)
{
    if (roomBkg == null)
    {
        roomBkg = DynamicSprite.CreateFromBackground();
    }
    else
    {
        RestoreRoomBkg();
    }
    tt_draw.Start(st);
}
 
function repeatedly_execute()
{
}
 
D3D_Video* video;
TypedText my_text;
     
function repeatedly_execute_always() 
{   
    if (tt_draw.IsActive)
    {
        tt_draw.Tick(); // update TT
        if (tt_draw.IsIdle)
        {
            tt_draw.Clear();
            RestoreRoomBkg();
        }
        else
        {
            DrawingSurface *ds = Room.GetDrawingSurfaceForBackground();
            tt_draw.Draw(ds);
            ds.Release();
        }
    }
    if (my_text.IsActive)
    {
        my_text.Tick(); // update TypedText
        if (my_text.IsIdle)
        {
            my_text.Clear(); // clear the text
        }
        else
        {
            String text_to_show=my_text.CurrentString;
            if (my_text.IsCaretShown)
            {
                text_to_show=text_to_show.Append(""); // append carret symbol to the end of the text
            }
            cNarrat.SayBackground(text_to_show); // print typedText's current text 
        }
    }
}
 
function room_Load() 
{
    tt_draw.TypeDelay = 4;
    tt_draw.CaretFlashOnTime = 4;
    tt_draw.CaretFlashOffTime = 4;
    tt_draw.CaretStyle = eTypedCaret_Explicit; // draw caret
    tt_draw.CaretSprite = 1010; // put your sprite number here
    //tt_draw.TypeSound = aTypewriterTyping; // set sound to play
	
    tt_draw.X = 500;
    tt_draw.Y = Room.Height / 2;
    tt_draw.Width = 500 ;
    tt_draw.Height = Room.Height / 2 ;
    tt_draw.Font = eFontGalactican;
    tt_draw.TextAlign = eAlignLeft;
    // Config typed text
    my_text.TypeDelay=4;
    my_text.CaretFlashOnTime=4;
    my_text.CaretFlashOffTime=4;
    // End config of type text
	
    //	SetViewport(0, 0);
    cShuttle.Transparency=100;
    cShuttle.Baseline=288;
    cShuttle.ChangeRoom(1, 199, 139);
}

function TypeSay(String st)
{
    my_text.Start(st);
}



void Cutscene_Intro()
{	
    //bool Esc_CutScene=false;
    //D3D Plugin - playing background video with Theora-------------
    //Required for autoplay
    D3D.SetLoopsPerSecond( GetGameSpeed() );
    
    // Open video file
    video = D3D.OpenVideo( "Intro_Opening_v1.ogv" );
    
    if ( video )
    {
        // Use room coordinates
        video.relativeTo = eD3D_RelativeToRoom;
        
        // Anchor point to top left corner
        video.SetAnchor( -0.5, -0.5 );
        
        // Play!
        video.Autoplay();
    }
    else
    {
        player.SayBackground( "Couldn't open video." );
        
    }
    //END OF D3D plugin video---------------------------------------
    play_Music(Intro);
    StartCutscene(eSkipESCOnly);
    //	oGal.Visible=true;
    // oGal.SetView(60);
    TypeSay("An AGS game by Sandra T. Almeida[");
	 
    cNarrat.SayAt(6, 261, 500, "&1 There are those who believe");   
    cNarrat.SayAt(6, 261, 500, "&2 that life here began out there,");
    TypeSay("a fan game based on Battlestar Galactica[");
    cNarrat.SayAt(6, 261, 500, "&3 far across the universe,");
    cNarrat.SayAt(6, 261, 500, "&4 with tribes of humans");
    cNarrat.SayAt(6, 261, 500, "&5 who may have been the forefathers of the Egyptians");
    cNarrat.SayAt(6, 261, 500, "&6 or the Toltecs or the Mayans.");
    //  oGal.Animate(0, 1, eOnce, eNoBlock, eForwards);
    cNarrat.SayAt(6, 261, 500, "&7 Some believe that there may yet be brothers of man");
    cNarrat.SayAt(6, 261, 500, "&8 who even now fight to survive");
    cNarrat.SayAt(6, 261, 500, "&9 somewhere beyond the heavens.");
    play_Music(Main);
    while (video.NextFrame()) 
    {
        if (IsKeyPressed(eKeyEscape)) break;
        else Wait(1);
    }
    EndCutscene();
    video=null; 
    CloseM.Visible=false;
    gMenu.Visible=true;
}

function room_AfterFadeIn()
{
    if (Game.DoOnceOnly("Play Intro")) Cutscene_Intro();
}

void Cutscene_Start()
{	
    //D3D Plugin - playing background video with Theora-------------
    // Required for autoplay
    D3D.SetLoopsPerSecond( GetGameSpeed() );
    
    // Open video file
    video = D3D.OpenVideo( "test.ogg" );
    
    if ( video )
    {
        // Use room coordinates
        video.relativeTo = eD3D_RelativeToRoom;
        
        // Anchor point to top left corner
        video.SetAnchor( -0.5, -0.5 );
        
        // Play!
        video.Autoplay();
    }
    else
    {
        Display( "Couldn't open video." );
        //return;
    }
	//END OF D3D plugin video---------------------------------------
	
    SetGameSpeed(25); // you don't need to use the same fps as the video like this, but it's easiest this way*/
	
	
    cAthena.ChangeRoom(1, 1024, 0);
    cNarrat.ChangeRoom(1, -5, 0);
    cNarrat.SpeechView=97;
    cShuttle.SetAsPlayer();
    //cAthena.SpeechView=18;
    //oGal.StopAnimating();
    Start_Cutscene=false;
    StartCutscene(eSkipESCOnly);
    play_Music(Intro);
    oGal.Graphic=1213;
    oGal.Visible=true;
    oBay.Visible=true;
    cShuttle.Transparency=0;
    cShuttle.Walk(948, 201, eNoBlock, eAnywhere);
    //oShuttle.Visible=true;
    //oShuttle.Move(492, 201, -2, eNoBlock, eAnywhere);
    // oShuttle.SetView(VSHUTTLE);
    //oShuttle.Animate(0, 2000, eOnce, eNoBlock, eForwards);
    //cNarrat.SayAt(6, 261, 500, "&11 What's Starbuck's status?");
    cNarrat.Say("&11 What's Starbuck's status?");
    Wait(10);
    ReleaseViewport();
    //cAthena.SayAt(6, 261, 500, "&45 He's due on the Rising Star at any moment.");
    cAthena.Say("&45 He's due on the Rising Star at any moment.");
    Wait(5);
    cNarrat.Say("&12 I hope we don't have to move him to red before he eats.");
    //oShuttle.Move(939, 142, -2, eNoBlock, eAnywhere);
    cShuttle.Walk(948, 137, eNoBlock, eAnywhere);
    cAthena.Say("&46 Starbuck did ask me to dinner tonight but...");
    cAthena.Say("&47 Well, I do have this duty.");
    cAthena.Say("&48 I guess he'll have to eat alone.");
    cShuttle.Walk(948, 135, eNoBlock, eAnywhere);
    cNarrat.Say("&13 Well, er... perhaps this once we can make an exception, hm?");
    Wait(5);
    cNarrat.Say("&14 You go ahead and join him.");
    cNarrat.Say("&15 I'll handle this with Colonel Tigh.");
    //	oShuttle.Visible=false;
    Wait(60);
    oGal.Visible=false;
    oBay.Visible=false;
    EndCutscene();
    play_Music(Stb);
    cStarb.SetAsPlayer();
    video=null; 
    SetGameSpeed(SldSpeed.Value);
    player.ChangeRoom(2, 309, 582);
}


function room_RepExec()
{
    if (Start_Cutscene) Cutscene_Start();
}


EDIT: Indent was out of wack...

EDIT2: Maybe it's the characterSay? And the speech font is being enforced over the settings?
#711
No, it is linked, that's why I moved the code there.
I have other code in there that is being initialized in the room.
#712
Seems to be completely ignoring the settings at game start (I realized that game start wasn't doing anything in the room, and moved it to room_load) but seems to still be ignoring it.

Okay, I'll change that code, but I solved that problem by just adding [ at the end of the text. ;)
#713
oh, right, forgot that display blocks. :-[ I put displayAt so I got possition the text, but now that I'm looking at the code, I think I spot where I should change that.

Let me so try with sayBG, brb.

EDIT: Okay, that worked. :) Well, almost, since for some reason didn't used my font nor it printed the last letter.
Also, why is the text scrolling to the left? I wanted it to start at one position and write to the right.

EDIT: Seems to be completely ignoring the settings at game start (I realize it game start wasn't doing anything in the room, and moved it to room_load) but seems to still be ignoring it.
#714
Managed to get it to display on the room now, but the text doesn't get typed unless I press the mouse button or the enter key. Plus, there's still a white box displaying, instead of the background.

Maybe you can figure out what I'm doing wrong here? I removed the code for the BG video and speech for now.
EDIT: I put the code in Room 1, since it's the only room that I'll be using for all the text. Not sure if that makes a difference or not.
Code: ags

// text script for room
TypedTextDrawing tt_draw;
DynamicSprite *roomBkg; // will keep saved room background
 
function game_start()
{
    tt_draw.TypeDelay = 4;
    tt_draw.CaretFlashOnTime = 4;
    tt_draw.CaretFlashOffTime = 4;
    tt_draw.CaretStyle = eTypedCaret_Explicit; // draw caret
    tt_draw.CaretSprite = 1010; // put your sprite number here
    //tt_draw.TypeSound = aTypewriterTyping; // set sound to play
    
    tt_draw.X = 40;
    tt_draw.Y = 40;
    tt_draw.Width = Room.Width - 80;
    tt_draw.Height = Room.Height - 80;
    tt_draw.Font = eFontGalactican;
    tt_draw.TextAlign = eAlignCentre;
}
 
function RestoreRoomBkg()
{
    // Restore original room background
    DrawingSurface *ds = Room.GetDrawingSurfaceForBackground();
    ds.DrawImage(0, 0, roomBkg.Graphic);
    ds.Release();
}
 
// Calling TypeOnDS will start typed text
function TypeOnDS(string st)
{
    if (roomBkg == null)
    {
        roomBkg = DynamicSprite.CreateFromBackground();
    }
    else
    {
        RestoreRoomBkg();
    }
    tt_draw.Start(st);
}
 
D3D_Video* video;
TypedText my_text;
     
function repeatedly_execute_always() 
{   
    if (tt_draw.IsActive)
    {
        tt_draw.Tick(); // update TT
        if (tt_draw.IsIdle)
        {
            tt_draw.Clear();
            RestoreRoomBkg();
        }
        else
        {
            DrawingSurface *ds = Room.GetDrawingSurfaceForBackground();
            tt_draw.Draw(ds);
            ds.Release();
        }
    }
	if (my_text.IsActive)
	{
		my_text.Tick(); // update TypedText
		if (my_text.IsIdle)
		{
			my_text.Clear(); // clear the text
		}
		else
		{
			String text_to_show=my_text.CurrentString;
			if (my_text.IsCaretShown)
			{
				text_to_show=text_to_show.Append("_"); // append carret symbol to the end of the text
			}
			DisplayAt(140, 113, 500, text_to_show); // print typedText's current text 
		}
	}
}
 
function room_Load() 
{
	// Config typed text
	my_text.TypeDelay=4;
	my_text.CaretFlashOnTime=4;
	my_text.CaretFlashOffTime=4;
	// End config of type text
	
	/*	SetViewport(0, 0);
		cShuttle.Transparency=100;
		cShuttle.Baseline=288;
		cShuttle.ChangeRoom(1, 199, 139);
	*/
}

function TypeSay(String st)
{
	my_text.Start(st);
}



void Cutscene_Intro()
{	

	 TypeSay("An AGS game by Sandra T. Almeida");
}


function room_AfterFadeIn()
{
	if (Game.DoOnceOnly("Play Intro")) Cutscene_Intro();
}


PS - I changed the sting from s to st, as the s was giving me a parse error. ???
#715
Okay, this seems way more complex to use than I initially thought it would...
I'm trying to do something very simple, which is basically type the text non-blocking while some other blocking speech is running... but I'm basically drawing a blank... :( In other words, nothing is being typed, while the rest of my code runs perfectly, once it ends and shows the menu GUI, I get a square white box that will type my text, letter by letter, every time I click my mouse... twice. 8-0
Not exactly what I had in mind.

Thought it would be easier to work with, like add the settings to the start of the script, and then used TypedText(text) to show the lines... :-[
#716
The Rumpus Room / Re: *Guess the Movie Title*
Fri 03/03/2017 17:42:30
On Her Majesty's Secret Service?
#717
The Rumpus Room / Re: *Guess the Movie Title*
Thu 02/03/2017 19:45:56
Snarky got it, it's Flatliners. (nod) (laugh)

Ps - That's Julia Roberts on the right. ;)
#718
The Rumpus Room / Re: *Guess the Movie Title*
Thu 02/03/2017 18:29:48
Nope, not Speed.
#719
The Rumpus Room / Re: *Guess the Movie Title*
Thu 02/03/2017 17:09:53
No, no, no and no.

But I would say you all in the right track... give or take. :-D
#720
The Rumpus Room / Re: *Guess the Movie Title*
Wed 01/03/2017 21:50:42
Yes, would never have guessed it without your hint though. ;)

Anyway, one from one of my favorite movies... hope it's not 1sec instant easy... (laugh)



PS - OOPS... just realized I never posted this after I hit preview... no wonder no one replied to it yet. :-[
SMF spam blocked by CleanTalk