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 - AdamM

#1
As monkey says, I think it would be easiest to substitute a character for the object. After all, the AGS Manual itself states:

QuoteA character is similar to an object, except that it can change rooms
#2
I think I've already compensated for that, but thanks for pointing it out.

I've been analysing how AGS treats different strings of text, and rather than the Text Window wrapping at a static width as I had assumed, it varies slightly. AGS seems to magically know what width to set the window at so the text wraps without any big gaps or space. But surely that's impossible to determine with the script? I wish CJ could reveal how it's done.
#3
I'm a patient man.

Unfortunately I'm also a perfectionist, so my game isn't getting developed until I can resolve this.
#4
Quote from: Snake on Wed 09/03/2011 16:45:09At least your goal isn't to have sex with more children than your pedophile pals.

You've just given me a fantastic idea for a spiritual sequel!

In the meantime I'll just have to satisfy myself with beating and raping children for getting questions wrong in that gaming masterpiece I Have Candy Get in the Van.
#5
Well that was certainly one of the most disturbing things I've ever seen created with AGS.

I give it three and a half cups out of five!
#6
Bumping this shiznit off of page 2.
#7
No, I've changed all the 1s to 2s and that doesn't seem to have changed anything.
#8
Okay, well as my design is so simple I've taken your suggestion about using buttons, Khris; one at each corner and side. I've written this bit of code that seems to emulate the Sierra view using a GUI, called gNewText, and I've inserted it before Say() is called in SSH's module. As it doesn't draw borders automatically I've taken two labels each using the component fonts and put them on top of each other, resizing them identically.

I came up with 215 as the number of 320 resolution pixels that AGS seems to wrap to in the Sierra view by measuring the screenshot I took in the first post of this thread; if the GetTextWidth is shorter than 215 the GUI resizes itself around it as normal, but if it is longer then it freezes the GUI at a static width. It didn't seem to work entirely well so I adjusted the rest of the numbers through trial and error.

It seems to work moderately well now but I've been looking at how the generated text on the GUI compares to the SierraWithBackground style that still appears, and it's not always identically wrapped. Here is a comparison screenshot: the dialogue above is my emulated code and the dialogue below is how AGS handles it. Can someone tell me where my maths is going wrong?

http://img141.imageshack.us/img141/2601/sierrabackgroundwithnew.png

Code: ags

    //This bit is for the New Text GUI

if (GetTextWidth(what, 1)>215) {
      gNewText.Width=235;
      gNewText.Height=(GetTextHeight(what,1, 215)+10);
      NewTextLabel.Width=225;
      NewTextLabel.Height=GetTextHeight(what, 1, 215);
      NewTextBorder.Width=225;
      NewTextBorder.Height=GetTextHeight(what, 1, 215);
    }

    else {
      gNewText.Width=(GetTextWidth(what, 1)+10);
      gNewText.Height=(GetTextHeight(what, 1, GetTextWidth(what, 1)));
      NewTextLabel.Width=GetTextWidth(what, 1)*2;
      NewTextLabel.Height=GetTextHeight(what, 1, GetTextWidth(what, 1));
      NewTextBorder.Width=GetTextWidth(what, 1)*2;
      NewTextBorder.Height=GetTextHeight(what, 1, GetTextWidth(what, 1));
    }
    
    BottomLeft.Y=gNewText.Height-2;
    BottomRight.SetPosition(gNewText.Width-2, gNewText.Height-2);
    TopRight.X=gNewText.Width-2;
    TopRight.Y=0;
    RightBorder.SetPosition(gNewText.Width-2, 0);
    BottomBorder.SetPosition(0, gNewText.Height-2);
    
    NewTextLabel.SetText(what);
    NewTextBorder.SetText(what);
    gNewText.Visible=true;
    gNewText.SetPosition(5, 5);
    
    //End New Text GUI bit
    
    this.Say(what);
#9
Completely forgot about this; my frustration with the problem resulted in me losing interest in designing the game for a while.

QuoteGetTextHeight and GetTextWidth

Aha. I wasn't aware of these functions, thanks.

However it still isn't quite clear how the GUI itself will resize its borders to fit the text. Your List Box thing seems like a workaround. The standard Text Window GUI asks you to provide images for the borders and then through some kind of mystic art translates them into a perfectly-sized text box. If I only knew how this was manifested in scripting I would just be able to use that.
#10
This is what my dialogue currently renders as (Lucasarts):

http://img97.imageshack.us/img97/4023/sierral.png

I'm in the process of designing a new conversation GUI with embedded portraits (yes I know you adventure design buffs will probably take issue with the options but please reserve comment for now):

http://img836.imageshack.us/img836/6509/talkgui.png

It all works perfectly, except for the dialogue which appears as the above default Lucasarts. This is what I want my dialogue to render as, i.e. on a GUI (Sierra with Background):

http://img801.imageshack.us/img801/9284/sierrabackground.png

Unfortunately there seems to be no way of achieving the latter effect without using a blocking function like Display(), or using SierraWithBackground, which displays an extra portrait in the top left of the screen in addition to the one I've drawn in my GUI (I'm using SSH's GuiPortrait module to achieve that). My current workaround is SierraWithBackground and a blank SpeechView, but even with this the text is limited to rendering in two fixed positions of the screen i.e. top left or top right, whereas I want to move it wherever I want so that it doesn't necessarily cover up the conversation GUI or anything else.

If I make a new GUI to handle it, it isn't able to dynamically (and magically) resize itself depending on the amount of text it is displaying like the mysterious Text Window GUI.

So that's the problem. Solutions go.

PS: And why is SierraWithBackground destroying all my SpeechColor variables anyway?

PPS: No responses in 20 hours? A more complicated problem than I thought then?
#11
Ooo eee ooo eee ooooooh.

Waaah waaaah waaaaah.
#12
Quote from: SSH on Fri 11/06/2010 05:45:01
Any serious projets should use AGS's revision control integration.
I can't tell if you're joking or not.
#13
Jesus Christ, why is there no Undo button in the Dialog editor? I had to restart the editor to correct my horrific mistake, and if I'd saved at any point it would have all gone permanently.
#14
Good lord this is old!
#15
No, I meant, why is it eFontNormal in the first place? All the other default variables compile with no error messages, so where did eFontNormal come from?
#16
After installing the module I got an error saying 'eFontNormal' was undefined. I only have fonts with enums like eFontFont0 and eFontFont1.

Is eFontNormal a default name, and if so, is the reason I don't have it because I started working on my game way back in AGS 2.7?

EDIT: It must not be that, the 'Custom dialog options rendering' article in the help files states it was written for AGS 3.1, and it mentions 'eFontFont0' in its example script.
#17
I just think you're berating the wrong person for the right reasons.
#18
Well Gilbet, IMO Khris was just being incidental, and MRollins was really overreacting with such a sarcastic reply. It doesn't matter whether someone's comment is helpful or redundant; it was completely unnecessary to such a hostile tone. I would have appreciated Khris's post, as it would have made clear to me how the manual could have answered my question instead, and that this knowledge would be helpful the next time I need it.
#19
I was waiting for someone to point out a better way of doing that, thanks.
#20
Trying to get lip-sync in this module... seems to work for me, although I had to hard-code the syllable detection and which frame corresponds to which syllable... I'm not the best scripter in the world SSH, of course.

Code: ags

String Portrait_Workspace;
int Portrait_Reduction;
int Portrait_LSFrame;
String LipSyncMessage;
int Portrait_IsEndOfSpeech;

...

function Portrait_LipSync(String what) {
  Portrait_Workspace = what.Substring(Portrait_Reduction, (what.Length-1));
  Portrait_LSFrame = -1;
  String Portrait_vls = Portrait_Workspace.Truncate(2);  //Two-letter syllable
  if (Portrait_IsEndOfSpeech==1) {Portrait_LSFrame=0;}
  else if ((Portrait_vls.CompareTo("ph")==0)) {Portrait_LSFrame=2;}
  else if ((Portrait_vls.CompareTo("ch")==0)) {Portrait_LSFrame=5;}
  else {
    Portrait_vls = Portrait_Workspace.Truncate(1);   //Not two-letter syllable
    if ((Portrait_vls.CompareTo(".")==0) || //M sound
    (Portrait_vls.CompareTo("?")==0) || 
    (Portrait_vls.CompareTo("!")==0) || 
    (Portrait_vls.CompareTo(",")==0) || 
    (Portrait_vls.CompareTo("B")==0) || 
    (Portrait_vls.CompareTo("K")==0) || 
    (Portrait_vls.CompareTo("Q")==0) || 
    (Portrait_vls.CompareTo("D")==0) || 
    (Portrait_vls.CompareTo("P")==0) || 
    (Portrait_vls.CompareTo("M")==0))
    {Portrait_LSFrame=0;}
    else if ((Portrait_vls.CompareTo("L")==0) || //Tongue sound
    (Portrait_vls.CompareTo("T")==0) || 
    (Portrait_vls.CompareTo("R")==0) || 
    (Portrait_vls.CompareTo("S")==0) || 
    (Portrait_vls.CompareTo("J")==0) || 
    (Portrait_vls.CompareTo("N")==0) ||
    (Portrait_vls.CompareTo("3")==0) || 
    (Portrait_vls.CompareTo("9")==0))
    {Portrait_LSFrame=1;}
    else if ((Portrait_vls.CompareTo("F")==0) || //F sound
    (Portrait_vls.CompareTo("V")==0) || 
    (Portrait_vls.CompareTo("4")==0) ||
    (Portrait_vls.CompareTo("5")==0))
    {Portrait_LSFrame=2;}
    else if ((Portrait_vls.CompareTo("W")==0) || //O sound 
    (Portrait_vls.CompareTo("U")==0) || 
    (Portrait_vls.CompareTo("O")==0) || 
    (Portrait_vls.CompareTo("0")==0) ||
    (Portrait_vls.CompareTo("1")==0) || 
    (Portrait_vls.CompareTo("2")==0))
    {Portrait_LSFrame=3;}
    else if ((Portrait_vls.CompareTo("G")==0) || //A sound
    (Portrait_vls.CompareTo("A")==0) || 
    (Portrait_vls.CompareTo("H")==0) || 
    (Portrait_vls.CompareTo("Y")==0) || 
    (Portrait_vls.CompareTo("8")==0))
    {Portrait_LSFrame=4;}
    else if ((Portrait_vls.CompareTo("E")==0) || //E sound
    (Portrait_vls.CompareTo("X")==0) || 
    (Portrait_vls.CompareTo("I")==0) ||  
    (Portrait_vls.CompareTo("3")==0) || 
    (Portrait_vls.CompareTo("6")==0) || 
    (Portrait_vls.CompareTo("7")==0))
    {Portrait_LSFrame=5;}
    else {Portrait_LSFrame=4;}
  }
   Portrait_Reduction=(Portrait_Reduction+Portrait_vls.Length);
   if (Portrait_Reduction>=what.Length) {Portrait_IsEndOfSpeech=1;}
}

function Portrait_DoFrame() {
    Portrait_vf=Game.GetViewFrame(Portrait_View,  Portrait_Loop, Portrait_LSFrame); //changed Portrait_Frame to Portrait_LSFrame
...
}

function repeatedly_execute_always() {
...
      Portrait_LipSync(LipSyncMessage);
      Portrait_DoFrame();
...
}

function GSay(this Character *,  String what,  int view,  int loop) {
    LipSyncMessage=what;
    Portrait_IsEndOfSpeech=0;
    Portrait_Reduction=0;
...
}
SMF spam blocked by CleanTalk