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

#101
This is even better yet.  Thank you!!!
#102
Wow, nice, thank you.
#103
What I was looking for was an option to play in window mode through a settings panel. Since it's an older game with older graphics, playing in a windowed mode may be beneficial to some.
#104
If I set up a "settings" gui and add a button for setup, how can I link in the winsetup file to get accessed?
#105
Hi guys, thanks for the responses.  I'll have to come back to this at a later date.  I had a bunch of work that came in that I need to work on. :)
#106
Has anyone coded a Crossword Puzzle in their game? The player would be inputing letters on a crossword puzzle grid.
#107
Thanks, that worked.
#108
I figured out how to slow the scrolling.  I would like to have it start scrolling as soon as I enter the room as opposed to the space bar.  What would I need to change for this?
#109
The Credits Module is running great.  Thank you. Can you tell where I can slow it down some?
#110
Since I have separate guis for Save & Load (or restore) can I do something like this for the restore button? I think it makes more sense to see a screenshot of the save you want to restore.  This seems to be working but I had to comment out the first line because there is no txtNewRestoreName.Text like there is for the save. Is it ok to leave this out?

Code: ags
function lstRestoreGamesList_OnSelectionChanged(GUIControl *control)
{
 // txtNewRestoreName.Text = lstRestoreGamesList.Items[lstRestoreGamesList.SelectedIndex];
  int slot = lstRestoreGamesList.SaveGameSlots[lstRestoreGamesList.SelectedIndex];
  buttonSprite = DynamicSprite.CreateFromSaveGame(slot, btnScrshotR.Width, btnScrshotR.Height); 
  if (buttonSprite != null) {
      btnScrshotR.NormalGraphic = buttonSprite.Graphic; }
}
#111
Perfect, thank you I'll check this out.
#112
That works perfect for removing the gui on the screenshot. 

I notice that if I save with a screenshot, for example, Dom at letter (see example), then I play some more and save again, Dom at front of house. When I come into Save again, the screenshot displays the last screen that was selected/highlighted on the gui as opposed to the last save.  So anytime I am in the Save function, it will always show the screenshot of the last item I highlighted in the gui. Should it be working like this?
#113
Thank you.  Ok, I downloaded the script, imported it and created a room and a gui gCredits. When I try to run the room I get this error.
Error (line 11): Undefined token "Credits" Here is my room script:
Code: ags
// room script file

bool credits_running;

function room_Load()
{
{
  int yellow = Game.GetColorFromRGB(255, 255, 0);
  int white = Game.GetColorFromRGB(255, 255, 255);
  
  Credits.SetFont(eFontFont0, 15); // font, line height
  Credits.SetColor(white); // default text color
  Credits.SetShadow(17, 1, 1); // color, offsetX, offsetY
  Credits.SetWidth(200); // total width of credits text
  Credits.SetDelay(1, -5); // 1 pixel per frame, 5 pixels per frame when mouse is held down

  Credits.AddLine("Made with", eAlignCenter, 0, yellow);
  Credits.AddLine("Adventure Game Studio");
  Credits.AddSpace();
  Credits.AddLine("Special Thanks To", eAlignCenter, 0, yellow); // yellow text
  Credits.AddLine("Alice", eAlignLeft);
  Credits.AddLine("Bob", eAlignRight, -1); // offset -1: add text to previous line
  Credits.AddLine("Charles", eAlignLeft);
  Credits.AddLine("Dick", eAlignRight, -1);
  Credits.AddLine("Eddie");
  Credits.AddSpace(50); // add gap of 50 pixels
  Credits.AddLine("THE END");
}

DynamicSprite* credits; // create pointer

void StartCredits() {
  credits_running = true; // set flag for room_RepExec
  gCredits.Visible = true; // show GUI
  credits = Credits.Tick(); // run first update to get sprite
  //gCredits.BackgroundGraphic = credits.Graphic; // set GUI background
}

void CreditsEnded() {
  gCredits.Visible = false; // hide GUI
  credits.Delete(); // clean up
  credits_running = false; // reset flag
  QuitGame(0); // or go to main menu
}

void DoCredits() {
  Credits.Tick(); // advance credits display
  if (Credits.Done()) CreditsEnded(); // credits have finished
}
}

function room_RepExec()

{
  if (credits_running) DoCredits();
}

void on_key_press(eKeyCode k) {
  if (k == eKeySpace) StartCredits();
}
#114
Hi, that code definitely corrected the size of the screenshot. 

I am seeing the Save Gui showing up in the screenshot. How do I eliminate that?

Also, the screenshot shows that you can save with a blank name. (Not sure if this really matters)

#115
The link for the module goes to a funny looking download page.  Is this correct? Just want to make sure before I download.
#116
Hi, Ok, I got this working, sort of.  The screenshot that displays is the correct room but it is filling up the whole area where the buttons are.  So I can't use the Save, Delete, or Cancel buttons. 
#117
Is there a current Scrolling Credits Module? I found a few listed in the forum but with old dates on them so I would like advice on which one to use.
#118
I checked both global scripts and do not find any verbiage using buttonsprite in either, other than what is shown above.
Can you show me how to code this check so player would not get an "array index out of bounds" exception if nothing is selected in the listbox?
#119
I've included the code for Saving and Restoring.  The error message I am getting on "DynamicSprite *buttonSprite;" is Attributes of identifier do not match prototype

Code: ags
//=============================================================================
// SAVE / LOAD DIALOGS
//=============================================================================

int find_save_slot(String name)
{
  bool slots[] = new bool[999];
  int slots_used = 0;

  // record which slots are occupied already, 
  // if the types save name matches any existing one, then use that
  for (int i = 0; i < lstSaveGamesList.ItemCount; i++)
  {
    if (lstSaveGamesList.Items[i] == name)
    {
      // found existing save with matching name
      return lstSaveGamesList.SaveGameSlots[i];
    }

    // remember which slots are already taken
    slots[lstSaveGamesList.SaveGameSlots[i]] = true;
    slots_used++;
  }
  
  // current version of AGS has a limit of 50 save slots
  // that may be displayed in the ListBox at the same time
  if (slots_used >= 50)
  {
    return -1;
  }

  // find first free save slot, starting with slot 1 (for "cosmetic" purposes)
  for (int i = 1; i < 999; i++)
  {
    if (!slots[i])
    {
      return i;
    }
  }

  // no free slots found
  return -1;
}

function btnSaveGame_OnClick(GUIControl *control, MouseButton button)
{
  int gameSlotToSaveInto = find_save_slot(txtNewSaveName.Text);

  if (gameSlotToSaveInto < 0)
  {
    Display("Save slots limit of 50 is reached, delete some of the existing saves first!");
  }
  else
  {
    SaveGameSlot(gameSlotToSaveInto, txtNewSaveName.Text);
    close_owning_gui(control);
  }
}
function btnRestoreGame_OnClick(GUIControl *control, MouseButton button)
{
  if (lstRestoreGamesList.SelectedIndex >= 0)
  {
    RestoreGameSlot(lstRestoreGamesList.SaveGameSlots[lstRestoreGamesList.SelectedIndex]);
  }

  close_owning_gui(control);
}
DynamicSprite *buttonSprite;

function lstSaveGamesList_OnSelectionChanged(GUIControl *control)
{
  txtNewSaveName.Text = lstSaveGamesList.Items[lstSaveGamesList.SelectedIndex];
  buttonSprite = DynamicSprite.CreateFromSaveGame(1, 78, 78);
  if (buttonSprite != null) {
    btnScrnshot.NormalGraphic = buttonSprite.Graphic; }
}

function lstSaveGamesList_OnSelectionCh(GUIControl *control)
{
  txtNewSaveName.Text = lstSaveGamesList.Items[lstSaveGamesList.SelectedIndex];
}

function txtNewSaveName_OnActivate(GUIControl *control)
{
  // pressing Return in the text box simulates clicking the save button
  btnSaveGame_OnClick(control, eMouseLeft);
}

function btnDeleteSave_OnClick(GUIControl *control, MouseButton button)
{
  if (lstSaveGamesList.SelectedIndex >= 0)
  {
    DeleteSaveSlot(lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex]);
    lstSaveGamesList.FillSaveGameList();
  }
}

function gReset_OnClick(GUI *theGui, MouseButton button)
{
SetGlobalInt(420,1);
}
#120
I uderstand the button on the gui and adding this code to the OnSelectionChanged event handler. But where do I add the code where it reads "at the top of the script outside event functions"  Does this mean the global script?  If so I added at the top and I get an error.

Code: ags
// at top of script, outside event functions
DynamicSprite *buttonSprite;

// inside an event function
buttonSprite = DynamicSprite.CreateFromSaveGame(1, 50, 50);
if (buttonSprite != null) {
    btnScrnshot.NormalGraphic = buttonSprite.Graphic;
}

Secondly where do I put this code for the Saved Game Slots:
Code: ags
int index = lstSaveGames.SelectedIndex;
RestoreGameSlot(lstSaveGames.SaveGameSlots[index]);

Just a little confused how to piece this all together.
SMF spam blocked by CleanTalk