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

#141
Oh, I see.  Do you have any suggestions on how to do this?
#142
I don't understand what this means.
#143
Adding image for above post.
#144
The game is 20 years old and has been imported into the latest version of AGS so you'll see some of that Legacy stuff.  Actually, I am amazed I am able to do this. :)

Here's the code from the room.  The first thing it does is make gui 16 visible, drops some text in the gui with SaySpecial7 (character Mamba).  I have the gui16.visible=false commented out because I want that gui to stay open at the bottom of the screen.
So far so good. I can see the text and it's at the bottom of the screen.
The next thing it does, it makes gui23 visible with SaySpecial23 (character Mamba). It displays at the top of the screen. It drops some text in and all is well with that gui.
The problem is when it opens gui23 up, it removes the text from gui 16.
So I am wondering if I can't have the Mamba character in two different gui's at the same time.
I included an image that shows both guis being visible.  It shows the text that went into gui 23 and at the bottom is gui 16 with no text.


Code: ags
function object0_a() {
  // script for Object 0: Interact object
 gGui16.Visible = true;
 SaySpecial7(cMamba, "This ."); 
 //gGui16.Visible = false;

if (card0 == 0) {
  gGui10.BackgroundGraphic = 165;
  gGui10.Visible = true;
  gGui23.Visible = true;  
  SaySpecial23(cMamba, "The Fool:");    
  gGui23.Visible = false;
  gGui10.Visible = false; }
#145
Can I use a second Gui and Label for a character.  I can't seem to get the text into the gui for this.
Example: I have a character, we'll call her Mamba.  She has a Gui16 with a label called slabel7 in the global script.

 
Code: ags
#sectionstart SaySpecial7  // DO NOT EDIT OR REMOVE THIS LINE
function SaySpecial7(Character *thechar, const string message) {
  slabel7.TextColor = thechar.SpeechColor;
  slabel7.SetText(message);
  thechar.SayAt(0, 0, 0, message); // say text but hidden (width 0), so voice speech plays
  slabel7.SetText("");
}
#sectionend SaySpecial7  // DO NOT EDIT OR REMOVE THIS LINE

She is also in the Global Header like this:
Code: ags
import function SaySpecial7(Character *thechar, const string message);

She is used in a room like this:
Code: ags
gGui16.Visible = true;
    SaySpecial7(cMamba, "The origin of 

So what I want to do is keep that Gui16 visible and let a second Gui (Gui23) open using the same character.  So I added a function in the global scrip like this:
Code: ags
#sectionstart SaySpecial23  // DO NOT EDIT OR REMOVE THIS LINE
function SaySpecial23(Character *thechar, const string message) {
  MLabel.TextColor = thechar.SpeechColor;
  MLabel.SetText(message);
  thechar.SayAt(0, 0, 0, message); // say text but hidden (width 0), so voice speech plays
  MLabel.SetText("");
}
#sectionend SaySpecia23  // DO NOT EDIT OR REMOVE THIS LINE

And did an import like this:
Code: ags
import function SaySpecial23(Character *thechar, const string message);

Then in the room did this:
Code: ags
function object0_a() {
  // script for Object 0: Interact object
 gGui23.Visible = true;
 SaySpecial23(cMamba, "This 


The Gui23 has a label called MLabel.
But the text does not appear in the Gui.  What am I doing wrong?
#146
Quote from: Khris on Thu 06/06/2024 12:30:39You can also create a copy of Game.agf and rename it to Game.xml. Open that with a suitable editor and you can search the entire game structure with a simple text search.

Perfect! Thank you.
#147
The game dump is great to have so you can search it for anything.  What room an object is in, where global inits are being used etc.  The second reason I wanted it was to create a voice acting script to give to the voiceover people. I did the "Create voice acting script" but it created an empty file. I need all the lines from the SaySpecial*'s.
#149
Is there a way to dump the whole game script into a word doc or notepad?  I seem to recall being able to do that in an older version.  If not, is there a way to dump off all the "Say" parts for creating speech?
#150
Thank you both.
#151
How do I center the background image in a gui?
When a player picks up an inventory item, I want the item to display in a gui. It works but not centered.
#152
That was exactly the issue. Thank you!
#153
I added this code to the repeatedly execute and when the slider gui pops up it immediately closes where you can't move the slider.
#154
What code would I use to make it go away if the player moves the mouse far enough away from the slider?
#155
It is working perfectly now. :)  Thank you for your time and patience, it's been a while and I am rusty. I do have a question about the music slider.  I have it set up on the gui that I posted above.  If they click on the question mark, which I will change to a music symbol, it opens the slider gui up.  They can then adjust the music. But then the slider gui does not go away unless you click on it.  Is there a better way to do this?
#156
Ok makes sense.  I moved that part to the top of the script.  I am getting a parse error on the System.AudioChannels playing clip line.

Here is the top part of my script:
Code: ags
// Automatically converted interaction variables
int IntVar_Global_1 = 0;
export IntVar_Global_1;
int IntVar_barhaveitems = 0;
export IntVar_barhaveitems;
// main global script file
string herscore;
string hisscore;
int x; 
int y; 
bool WasMusicLowered;
bool IsAnySoundPlaying()
{
    // we begin checking with channel 1, because channel 0 is reserved for the speech
    for (int i = 1; i < System.AudioChannelCount; i++)
    {
        System.AudioChannels[i].PlayingClip;
        if (clip != null && clip.Type == eAudioTypeSound)
        {
            return true;
        }
    }
        return false;
        }

#sectionstart game_start  // DO NOT EDIT OR REMOVE THIS LINE
#157
Where does this part of the code go? I have it in the Repeatedly Execute function but still getting an error about nested functions.

bool WasMusicLowered;

bool IsAnySoundPlaying()
{
    // we begin checking with channel 1, because channel 0 is reserved for the speech
    for (int i = 1; i < System.AudioChannelCount; i++)
    {
        AudioClip *clip = System.AudioChannel.PlayingClip;
        if (clip != null && clip.Type == eAudioTypeSound)
        {
            return true;
        }
    }
    return false;
}
#158
Ok I fixed that part.  Now an error saying AudioChannel is not a public member of 'System".  Are you sure you spelt it correctly (remember, capital letters are important)?

// we begin checking with channel 1, because channel 0 is reserved for the speech
    for (int i = 1; i < System.AudioChannelCount; i++)
    {
        AudioClip *clip = System.AudioChannel.PlayingClip;
        if (clip != null && clip.Type == eAudioTypeSound)
#159
It's getting an error on this line in red and the error reads:  Nested functions not supported (you may have forgotten a closing brace)

bool WasMusicLowered;

bool IsAnySoundPlaying()
{
    // we begin checking with channel 1, because channel 0 is reserved for the speech
    for (int i = 1; i < System.AudioChannelCount; i++)
    {
        AudioClip *clip = System.AudioChannel.PlayingClip;
        if (clip != null && clip.Type == eAudioTypeSound)
        {
            return true;
        }
    }
    return false;
#160
Ok I see what you are saying now.  I didn't realize that the slider was created within a gui.

I added the second script to the global script where you stated and I get an error message:

Error: Specified argument was out of the range of valid values.
Version: AGS 3.6.1.24

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
   at WeifenLuo.WinFormsUI.Docking.DockContentCollection.GetVisibleContent(Int32 index)
   at WeifenLuo.WinFormsUI.Docking.DockContentCollection.get_Item(Int32 index)
   at WeifenLuo.WinFormsUI.Docking.DockPaneStripBase.TabCollection.get_Item(Int32 index)
   at WeifenLuo.WinFormsUI.Docking.VS2005DockPaneStrip.EnsureDocumentTabVisible(IDockContent content, Boolean repaint)
   at WeifenLuo.WinFormsUI.Docking.VS2005DockPaneStrip.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at WeifenLuo.WinFormsUI.Docking.DockPaneStripBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

It is also telling me that a serious error occurred, and data may be corrupted.  My main game is on another computer.  I installed the latest version on a different computer so that I can play around with it and not break anything.
SMF spam blocked by CleanTalk