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

Topics - Akril15

#41
Sorry for posting here so persistently, but I've encountered a fairly problematic feature in my game.

I didn't realize this until now, but with a Sierra-style inventory window, if the player selects an inventory item and uses it on a hotspot, object or character in the scene behind the inventory GUI, the game will attempt to carry out whatever scripts are associated with the hotspot, object or character in question. In other words, even though the inventory GUI pauses the game when shown, it behaves like a LucasArts inventory GUI, which is always on the screen.

This can be a real problem in some cases. For example, if the player uses a certain inventory item on a hotspot in my game, the player character will walk to that location, an animation will play, and another GUI will open. However, if the player uses that item on the hotspot while the inventory window is open, the wait cursor appears and the game locks up.

I wasn't sure how I might go about fixing this problem. My first thought was to surround the inventory window with a nearly invisible background that covered the entire screen, preventing the player from interacting with anything behind the GUI. However, such a large transparent GUI makes the mouse move a bit sluggishly when the inventory is open. Are there any alternative methods I could possibly try?
#42
I've made a custom icon for my game before (in AGS 2.72), so I'd think it would be easy to do it again in AGS 3.1. For some reason, however, it's proving to be nigh impossible.

When I follow the manual's instructions and 1), save a proper icon named user.ico into my game's main folder (not Compiled); 2), open my game in AGS and 3) save the game, the game's exe icon doesn't change. I've tried every variant of these steps I can think of (compiling the game before and after, naming the icon both USER.ICO and user.ico, saving the icon in 4-bit color), but nothing seems to work.

For some strange reason, when I'm compiling the game, the game's exe file does change to my custom icon, but shortly before compilation is complete, it changes back to the blank default icon. I've searched the forums, but couldn't find any problems similar to this one. I don't know what's going on, and I hope I can get this problem solved soon.
#43
I've discovered two different ways to get the player character to have different footstep sounds on different regions within a room -- one way is changing the sound by making use of the "Player walks onto region" and "Player walks off of region" events, the other is inserting code like this in repeatedly_execute:
Code: ags
if (Region.GetAtRoomXY(player.x, player.y) == region[1]) {
    steps_dirt(); //footsteps on dirt
  }
   if (Region.GetAtRoomXY(player.x, player.y) == region[2]) {
   steps_wood(); //footsteps on wood
  }

Both of these methods work, but there's still one minor problem: if I trigger an event that makes the player character walk across multiple regions, her footsteps will sound the same regardless of which region she is walking across. If she's standing on a footsteps-on-wood region and the event requires her to walk across a footsteps-on-dirt region, her footsteps will sound as if she's walking on wood even while she's walking across the dirt region.

I don't encounter this problem at all if I move her across multiple regions by using the Walk cursor, and there are only a couple of screens where I use multiple regions like this, but I'd still like to get this problem solved, as minor as it is.

Thanks!
#44
Hello,

I've been trying for some time to figure out a way to get my main character to have multiple idle views. SSH's Idle Module looked promising, but because of some major glitches that I was unable to solve, I've tried to come up with an alternative system.

Here's what I've come up with -- I've put a variable named "IdleTimer" at the top of the Global script and placed this code under repeatedly_execute:

Code: ags
  if (player_idle==true && player.Animating==false) {
  IdleTimer++;
  if (IdleTimer>=300) {
    if (player.View==36) {
      player_idle_sm(); //small svga
        }
    //other if statements will follow once I've got this working
    }
}


And this is what player_idle_sm looks like:

Code: ags
function player_idle_sm() {
   int RandomIdle=Random(3);
  if (RandomIdle==0)  {
    player.SetIdleView(171,  4); //idle1
    IdleTimer=0;
      }
  else if (RandomIdle==1) {
    player.SetIdleView(171,  4); //blink1
    IdleTimer=0;
  }
  else if (RandomIdle==2) {
    player.SetIdleView(174,  4); //idle2
    IdleTimer=0;
    }
  else {
    player.SetIdleView(172,  4); //blink2
    IdleTimer=0;
    }
}

The way this all works is that I have IdleTimer work as a sort of "pseudo-timer": its value keeps increasing as long as player_idle is set to true and the player isn't animating, and once it reaches 300, one of several idle views is selected at random, then IdleTimer is reset to 0.

This system works very well except for one noticeable problem. For some bizarre reason, if my character is idling in a diagonal position, after a few idle animations, she will suddenly face up, down, left or right. I can't figure out why this keeps happening, or how to fix it.

Does anyone have any idea what's going on?

Thanks in advance!
#45
I was experimenting with AGS's various lip-syncing features recently in an attempt to create a sort of passable lip-sync with Lucasarts-style speech (Calin Leafshade posted a code where Pamela's files could be used to do this, but I've been having some problems with Pamela, so I'm trying to find ways to work without it at the moment). I thought that turning the text-to-speech feature on would result in a reasonable facsimile of lip-sync. However, when I tried displaying a voice file along with a line of text, instead of "reading out" the text, my character's mouth just animated using the default loop.

This got me thinking -- is it possible to create a function where both text and speech appear AND the text is "read out" by AGS? Perhaps something like this:

Code: ags
cChar1.Say("Hey, it looks like I'm actually speaking this line!"); //this character reads out the line, but the text he reads is printed in an invisible font
cChar2.Say("&1 Hey, it looks like I'm actually speaking this line!"); //while THIS character does the actual voice, and the text for HIS line is visible


This is just an idea I had and not an actual request, but I just wanted to know if something like this would be possible.
#46
Hello,

I've been working on a custom "options" GUI which is similar to the classic Sierra one: buttons for saving, restoring and quitting the game, as well as speed and volume sliders. This GUI was behaving pretty well for most of today, but when I tried to open the GUI less than an hour ago, the game crashed and I got an error message that included this text:

QuoteAn exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x0043FBE7 ; program pointer is +379, ACI version 3.12.1074, gtags (2054,13)

I've tried disabling various parts of the GUI to see if I could isolate the problem, but so far, I've had no luck. Every time I try to open the options GUI (from any room in the game, by clicking the icon on the Sierra-style icon bar or pressing F5), I get the same error message. What can I do to fix this?
#47
I'm still tweaking my game's interface in the hopes of improving it. So far, I've accomplished quite a bit, but I've come across a small problem that (as usual) is proving very difficult to solve.

I'm using the Sierra-style icon bar, and I've just noticed that if I have an inventory item selected and the UseInv (use inventory) cursor is active, the cursor won't change to an arrow cursor like it does with every other mouse mode. This looked a little sloppy, so I tried entering this code in repeatedly_execute in the hopes of correcting this problem:

Code: ags
GUI *thegui = GUI.GetAtScreenXY(mouse.x, mouse.y);
if (thegui == gIcons)  {
mouse.SaveCursorUntilItLeaves();
mouse.Mode=eModePointer;
}


As it turned out, this was a bad idea. When I tried running the game and selected an inventory item, the cursor did change to an arrow when I moved the cursor over the icon bar, but several other problems popped up in its place. When I opened the inventory GUI, the items wouldn't respond when I clicked on them with arrow cursor. When selecting other icons from the icon bar (look, talk, etc.), if I've already selected an inventory item, the cursor will turn into the UseInv cursor (both looking AND behaving like it) when it moves over a hotspot* and then stays that way (this doesn't happen if I right-click to cycle through the cursors). If I haven't selected an inventory item when I select one of the icons, however, however, the cursor will turn into the arrow cursor when it moves over a hotspot.

Any idea how I can get around this problem without causing any others?

Thanks in advance!

*I'm using a set of cursors that highlight when they are over a hotspot -- they're set to animate when they're over a hotspot, but they just use a single frame of a different view.
#48
There are characters like me in every game genre -- characters that were going to appear in a game, but had it unexpectedly cancelled. Some of them hang around their own game, hoping that another company will complete it someday. Others spend their time hanging out in other games, which they can visit with ease. Then there are the ones like me who decide to dedicate their time to keeping this particular little genre running smoothly.

My name is Thalia James. I'm an agent of the 2D Third-Person Adventure branch of the Computer Game Maintenance Squad.

There are many agents in this part of the CGMS, and some of their assignments have turned into adventures of a scale almost as large as an actual adventure game.

And this is just one such adventure...


------------------

After several months of preperation followed by more than a year of work, Adventure: All in the Game, the sequel to Adventure: The Inside Job, is almost complete. I've attempted to improve on some of the original's shortcomings: there are more puzzles, somewhat less linear gameplay and fewer overly long cutscenes. Expect to see many more familiar faces (from the previous game as well as many other classic adventures), glimpse several new ones and (hopefully) save the genre from another looming threat.







The game is pretty close to completion. I just have a few more screens to complete as well as a lot of testing. Hopefully, neither should take horribly long.

UPDATE (4-16-11): Uploaded a quick trailer here.

UPDATE (5-23-11): The game is nearing completion -- once I get to the point where I can play through it all the way without stumbling over any glitches, it'll be ready for beta testing.

UPDATE (6-5-11): The game is currently being beta-tested. Here's one additional screenshot:



UPDATE (6-12-11): It's here! Click here to download it (112 MB)!
#49
I've run into another small problem with my latest project -- I'm trying to find a way to display a specific message whenever the player uses an inventory item on itself. The way I see it, the only way I could accomplish this would be to go through every inventory item and insert some code like this in the UseInv section:

Code: ags

if (player.ActiveInventory==iBanana) {
Display("I can't use that on itself!");
}
else unhandled_event(5,3); //use inventory item on inventory item


If I didn't have so many inventory items, this wouldn't be much of a problem. However, since I do (and may make even more inventory-item-rich games in the future), is there any way to designate a standard "I can't use an inventory item on itself!" message without having to insert it in each item's UseInv section?
#50
I've been trying to integrate a slider puzzle into my game. I downloaded a room with one in it from this thread (obviously, this was before Geocities ceased to be), and tried to edit it so that it would work in my game.

The only real differences between the sample room and my game is that the sample room was made in AGS 2.72 at a resolution of 320x240, while and my game is still being made in AGS 3.1 at a resolution of 640x480. I wouldn't think these differences would create much of a problem, but as it turns out, they do.

Like the original room, there are 8 tiles arranged in a 3x3 grid, each of them 80x80 pixels each. I've got the tiles moving and confined to a square in the middle of the screen, but they don't move properly. They slide underneath adjacent tiles, and they only slide sideways, not up or down. Strangely, when I tried decreasing the X values to 20 instead of 40, the tiles did move in the right direction, but of course, they'd only move halfway between their current location and their new one.

I've looked at various threads containing similar pieces of code, but I couldn't find a solution to my problem in any of them, and I finally decided that I needed to ask for help here. Here is the relevant code for the room:

Code: ags

function on_puzzle_solved() {
  Wait(15);
  slider_solved=true;
  player.ChangeRoom(35);
 
}

int button_pressed=0;
Object *ob;
int correct = 0;


function room_RepExec()
{
  if (Object.GetAtScreenXY(mouse.x, mouse.y) == object[9]) {
    object[9].Graphic=2046;
      }
  else object[9].Graphic=2045;
  
  
  
 if (mouse.IsButtonDown(eMouseLeft)) {
    if (button_pressed==0) {
      button_pressed = 1;
      ob = Object.GetAtScreenXY(mouse.x, mouse.y);
    }
  } 
  else {
    button_pressed=0;
    if (ob != null) {
      ob.Baseline = 0; 
      if (Object.GetAtScreenXY(ob.X + 40, ob.Y-1) == null && 
GetWalkableAreaAt(ob.X+40, ob.Y-1) != 0) {
        ob.Move(ob.X+40, ob.Y, 3, eBlock, eWalkableAreas);
      }
      else if (Object.GetAtScreenXY(ob.X - 40, ob.Y-1) == null  && 
GetWalkableAreaAt(ob.X-40, ob.Y-1) != 0) {
        ob.Move(ob.X-40, ob.Y, 3, eBlock, eWalkableAreas);
      }
      else if (Object.GetAtScreenXY(ob.X, ob.Y-41) == null  && 
GetWalkableAreaAt(ob.X, ob.Y-39) != 0) {
        ob.Move(ob.X, ob.Y-40, 3, eBlock, eWalkableAreas);
      }
      else if (Object.GetAtScreenXY(ob.X, ob.Y+39) == null  && 
GetWalkableAreaAt(ob.X, ob.Y+40) != 0) {
        ob.Move(ob.X, ob.Y+40, 3, eBlock, eWalkableAreas);
      }
      ob = null;
    }
  }

  //---- solved-check -------------------------------------------------------------
  correct=1;
  int i=1;
  while (i <= 8) { // number of slide-pieces
    Hotspot *hot = Hotspot.GetAtScreenXY(object[i].X+20, object[i].Y-20); // middle of tile
    correct = correct * (hot.ID == i); // for each object check if its number corresponds to hotspot number
    i++;
  }

  if (correct) on_puzzle_solved(); // run on_puzzle_solved() function if the puzzle's solved
  //-------------------------------------------------------------------------------


}


Thanks in advance!
#51
As I've been getting comfortable with AGS, I've also been experimenting with different kinds of game graphics. However, I seem to have recently hit a barrier of sorts.

I've been making more and more animations using partially transparent PNGS. With PNGs, I can create animations that not only contain far more colors than a GIF, but also contain some cool alpha effects. I create the animation in Paint Shop Pro 7 with each frame as a separate layer, then import the file into Animation Shop 3 to see how it looks in motion.

However, I've discovered that there is (apparently) no easy way to convert the layers of a PSP image to separate PNGs. I thought AS3's "Save Frames As" option could solve this problem easily, but for some inexplicable reason, it saves all PNGs with opaque white backgrounds. My only alternative is going through the PSP image layer by layer, exporting each one individually.

I've tried looking around for other ways of doing this, but so far my least dubious options seem to be:
A) getting an upgrade to a Photoshop CS3, then downloading an unofficial PNG layer export script (since Adobe apparently never got around to implementing one themselves)
B) Buying a program that can read Photoshop files and extract their layers in various formats

I'm baffled at how difficult this is turning out to be, and I can't help wondering if I've somehow overlooked a much simpler (and cheaper) alternative.

Does anyone here have any advice concerning this little problem?
#52
Hello,

My game's inventory is displayed in a pop-up window, and there are a few points in my game where I want sounds to play when the player interacts with inventory items in a certain way. However, whenever I try implementing a PlaySound or Wait command, my inventory window will disappear and won't reappear until the sound or wait time has stopped. I've searched the manual and the forum, but haven't been able to find out why this is happening or what I can do to fix it. Is there any way I can get around this problem?

Thanks,


-Akril
#53
Hello,

It's been a while since I've posted here. I'm creating a game that uses an interface that uses the Sierra-style icon bar with cursors that highlight over hotspots, characters and objects (sort of a hybrid between the King's Quest V/VI interface and the King's Quest VII interface). This was a lot harder than I thought it would be at first, but I think I'm close to success.

In my game, the standard Look, Interact and Talk cursors have a "grayed-out" appearance, and I've created three similar ones that are much more striking. In the following code, the lowercase modes are the grayed-out cursors and the all-caps ones are the highlighted cursors (except for the last part). Whenever the cursor moves over a character, the mouse cursor changes from the un-highlighted cursor to the highlighted one:

Code: ags

//highlight mouse if over a character
if (GetLocationType(mouse.x, mouse.y) == eLocationCharacter)
{
if (mouse.Mode == eModeTouch){
 Mouse.SaveCursorUntilItLeaves();
mouse.Mode = eModeINTERACT;
}

if (mouse.Mode == eModeLookat){
 Mouse.SaveCursorUntilItLeaves();
mouse.Mode = eModeLOOK;
}

if (mouse.Mode == eModeTalkto){
 Mouse.SaveCursorUntilItLeaves();
mouse.Mode = eModeTALK;
}

if (mouse.Mode == eModeUseinv){
 Mouse.SaveCursorUntilItLeaves();
mouse.Mode = eModeactiveinv;
}
}//end


This code seems to work pretty well, but I've found that unhandled_event won't work if I try looking at, touching or talking to a hotspot, character, or object with no response message assigned to it (probably because I'm not using the standard cursors to interact with the game's elements).

I've also noticed that I can't scroll through all the icons if my current icon is highlighted. This is due to un-checking the highlighted icons' "Standard cursor mode" boxes -- checking them fixes this problem, but makes me scroll through both the highlighted and un-highlighted icons if my current icon is un-highlighted. I suppose DisableMode might be able to correct this, but I'm not quite sure how at the moment.

I also can't seem to get the cursor to highlight over the items in my custom inventory window (which is essentially an improved version of the AGS default inventory). I did a search on it and found that InventoryItem.GetAtScreenXY would fix that problem but wasn't able to get it to work. However, I decided that I could live without this since there doesn't seem to be a code that allows something to happen when the mouse is over a GUI button --  having the cursor highlight over inventory items but not the buttons on the inventory GUI (or any of the other GUIs' buttons) would seem a bit awkward.

Is there anything I can do to repair these fairly minor flaws, or better yet, is there a game template I might have overlooked that uses a similar system?

EDIT: I forgot to mention that I'm using AGS 2.72, and with this system I have to enter all of the custom interaction commands under "Any click on hotspot/character/object" in the Interaction Editor. In a way, this is actually a bit simpler than creating several new "Run Script" actions under the various interactions.
#54
Hello,

I've had my heart set on making an AGS game with voice acting for several years. I was happy to hear that lip-sync was possible in AGS, but disheartened to hear that it was only possible with Sierra-style speech boxes.

I've looked around these forums several times, but I haven't been able to find a way to have lip-syncing with the LucasArts style. I found one suggestion to turn the "Automatic lip-sync" feature on and thus have the character's mouth synced up to the text instead of the audio, but I'm not sure if that would work very well.

So I'm pretty much asking whether there is currently any way to create a game with 1) voice acting, 2) lip-sync, and 3) LucasArts-style speech. I doubt that there is any relatively easy way to accomplish this, but there may be some workaround that I have overlooked...at least, that's what I hope.

Thanks in advance!
#55
Hello,

Several times over the last few months, I've searched the forums in an attempt to find a simple way to display speech as opaque white text on top of a semi-transparent black box near the bottom of my game's screen (like in Torin's Passage and LSL7). I want the characters to be talking and/or moving in other ways as their dialogue is displayed as well.

The LSL7 GUI won't work with any of the AGS versions that I thought would support it, so I've tried to find other methods of imitating it. Obviously, the Sierra style with background option and the Display line won't work for what I have in mind, and there's no way that I know of to put a transparent background behind Lucasarts style text. I've tried working with SSH's Hypertext module, but unfortunately it proved to be much more complex and challenging than I first thought, and it looks like I won't be able to go with that option either. I've even tried displaying Lucasarts speech over a transparent GUI with the same text in it that I set to appear at the same time the dialogue did, but that method turned out to be too cumbersome.

Is there any other method that anyone can recommend? I would greatly appreciate some advice on how I might go about doing this.
#56
Thalia James, member of the Earth Anti-Encroachment League for over twenty years, has contacted a bizarre disorder during an inspection of a distant planet. Now it seems that danger is always two steps behind her as she continues what she once considered a relatively mundane job. It seems as if there is something rotten in the state of the Milky Way...

*******

That was the summarizing paragraph for the adventure game I was going to star in...before it got cancelled.

However, for a game character, being cancelled is hardly the end of the world. In fact, there's an entire universe beyond the one that you Outsiders see on your screens whenever you start playing our games...and for the first time, you're going to get a look at it...









This is my first AGS project. It's taken a total of almost a year to finish, and I hope that it will be worth the wait.

The paragraphs above are pretty much the best way I've found to describe this game's plot without giving too much away. I feel that going into too much detail about the plot would ultimately spoil the experience, since the premise of this adventure game is a somewhat unique one (at least, I hope it is).

To elaborate somewhat: My first game, Area 50.5, was meant to appeal not only to people new to adventure games, but to people who love adventure games as well.  Adventure: The Inside Job, however, was designed to appeal to people who not only love adventure games, but have played too freaking many adventure games.



Here's some good news and bad news about what you can expect from Adventure: The Inside Job -

The bad news:
-This game will have ripped sprites, ripped backgrounds, and ripped music.
-The game's storyline is copied from an idea conceived by an author to such an extent that fans of said author would be screaming "RIPOFF!" five minutes into this game.
-This game is pretty big (and I don't mean "big" in terms of story, length, budget, or puzzle volume).

The good news:
-This game has ripped sprites, ripped backgrounds, and ripped music for reasons quite different than the usual "I can't draw/compose music very well"/"I don't have time to draw/write music for this game" excuse, for reasons you will soon see once you start playing. And the game DOES have some original sprites/backgrounds/music.
-This game is meant as a homage to the author mentioned above, in fact, one of his books is hidden in one of the game's screens, and I intend to give him and his idea full credit in the credits.
-This game's size is primarily due to its vast quantity of (original!) animations and its high resolution (640X480!).

In some ways, ATIJ can be considered a fangame, which would make it one the few fangames that includes ripped graphics and music yet isn't a sequel, a remake or a spinoff.



Yes, it's been almost five months, but at long last, this game is now ready to be downloaded and (hopefully) enjoyed by the masses! Have fun, everyone.

Download (66 Mb compressed, 337 Mb uncompressed)
Alternate download
Adventure: The Inside Job Website
#57
Thalia James, member of the Earth Anti-Encroachment League for over twenty years, has contacted a bizarre disorder during an inspection of a distant planet. Now it seems that danger is always two steps behind her as she continues what she once considered a relatively mundane job. It seems as if there is something rotten in the state of the Milky Way...

*******

That was the summarizing paragraph for the adventure game I was going to star in...before it got cancelled.

However, for a game character, being cancelled is hardly the end of the world. In fact, there's an entire universe beyond the one that you Outsiders see on your screens whenever you start playing our games...and for the first time, you're going to get a look at it...





Adventure: The Inside Job



This is my first AGS project. I've been working on it for almost six months as of now, not wanting to say anything about it publicly until it was nearly finished.

The paragraphs above are pretty much the best way I've found to describe this game's plot without giving too much away. I feel that going into too much detail about the plot would ultimately spoil the experience, since the premise of this adventure game is a somewhat unique one (at least, I hope it is).

To elaborate somewhat: My first game, Area 50.5, was meant to appeal not only to people new to adventure games, but to people who love adventure games as well.  Adventure: The Inside Job, however, was designed to appeal to people who not only love adventure games, but have played too freaking many adventure games.



Here's some good news and bad news about what you can expect from Adventure: The Inside Job-

The bad news:
-This game will have ripped sprites, ripped backgrounds, and ripped music.
-The game's storyline is copied from an idea conceived by an author to such an extent that fans of said author would be screaming "RIPOFF!" five minutes into this game.
-This game is pretty big (and I don't mean "big" in terms of story, length, budget, or puzzle volume).

The good news:
-This game has ripped sprites, ripped backgrounds, and ripped music for reasons quite different than the usual "I can't draw/compose music very well"/"I don't have time to draw/write music for this game" excuse, for reasons you will soon see once you start playing. And the game DOES have some original sprites/backgrounds/music.
-This game is meant as a homage to the author mentioned above, in fact, one of his books is hidden in one of the game's screens, and I intend to give him and his idea full credit in the credits.
-This game's size is primarily due to its vast quantity of (original!) animations and its high resolution (640X480!).

In some ways, TIJ can be considered a fangame, which would make it one the few fangames that includes ripped graphics and music yet isn't a sequel, a remake or a spinoff.



Development Progress:
Approx. 95% done. All that's left to be done now is mostly last-minute testing and tweaking. If all goes well, this game should be completed within the next month or so.

EDIT: Added breaks near beginning of post.

UPDATE (6-8-08): About 99% done; all that remains to be added is the music for the end credits. I've found someone willing to write it, but I don't know how long it will take him to finish it. I've also found several people willing to beta-test the game, so I don't need any more testing volunteers.

UPDATE (7-16): Credits music is on the way, so the game should hopefully be complete before the end of this month.

UPDATE (7-29): Release date has been pushed to mid-August.

UPDATE (8-22): I'm afraid the date has been pushed again to the end of the month. Hopefully the music for the end credits will be complete by then. Again, sorry for the long delay.

UPDATE (8-30): I should have seen this coming...I'm keeping my fingers crossed that the music will be complete by mid-September at the latest.
#58
I'm using Joe Carl's Save/Restore GUI, and I've saved 31 games successfully with it, but when I tried to save a new game today, I got the "Are you sure you want to overwrite this saved game?" message. I had obviously run out of save game slots, so there was nothing troubling about seeing this message, but when I clicked "Yes", the game crashed and gave me this error message:

QuoteAn internal error has occurred. Please note down the following information. If this problem persists, please contact Chris Jones.
(ACI version 2.72.920)

Error: run_text_script1: error -6 running function 'overwriteSI_btn_Click':
Error: Array index out of bounds (index: 27, bounds: 0..19)
inGlobal script (line 181)

Here's the code for the overwriteSI_btn_Click function:
Code: ags
#sectionstart overwriteSI_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE
function overwriteSI_btn_Click(GUIControl *control, MouseButton button) {
 int p = 0;
while(p<=partidas.ItemCount){
  if((partidas.ItemCount>p)&&(partidas.Items[p]==guardar.Text)){
UnPauseGame();
gOverwrite.Visible=false;
gSaverestore.Visible=false;
cerrar.Enabled=true;
SaveGameSlot(savegameindex[p], guardar.Text);
partidas.FillSaveGameList();
guardar.Text="";
gGui0.Visible=true;
return;
} 
p++;  
}
 
}
#sectionend overwriteSI_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE


And this is line 181:
SaveGameSlot(savegameindex[p], guardar.Text);

I tried restarting the game and saving the game again and got the same error message. I've searched the forums for "Array index out of bounds", but the code mentioned in all the posts is somewhat different than the code I'm using, and I'm hesitant to try fixing something I don't entirely understand. For some reason, I've been able to master almost all the basics of AGS, yet GUIs are still beyond my grasp.
#59
Hello,

I've been repeatedly trying to find a solution to this small but annoying problem, but after a couple of months, I've finally given up and decided to ask for help here:

My game (which I'm making in AGS 2.72) starts with a simple GUI that I made into a splash screen where the player has the option to start a new game, restore an old one, or quit. However, I'm using Joe Carl's combination Save/Load GUI (since I was unable to make a Save/Restore GUI by myself), so currently the GUI that pops up if the player clicks on Restore gives him the option of saving the game on the splash screen, which is not something I want.

I'm trying to make the "Save" button invisible when the player restores a game from the splash screen (using variables to determine whether the button is visible or not). Unfortunately, I've been unable to accomplish this, because I always get an “undefined token” error message.  I've repeatedly searched the forums and the manual, but haven't been able to find how to properly "define" the button.

Code: ags

////////////////////////////////////////////////
// SaveRestore-GUI                                   //
////////////////////////////////////////////////
if (interface == 6) { 
if (GetGraphicalVariable("menu") == 1) {

btnSaveGame.Enabled = false;
}



Also, I have an animated (unclickable) button on the same GUI, but it won't animate when I access the Save/Restore GUI from the game's splash screen. Here's its code (which I've inserted at the very beginning of the SaveRestore-GUI block):

btnimage.Animate(23, 5, 1, eRepeat);

Any help would be much appreciated.

Thank you.
#60
Hello,

I'm new to AGS, and I've run into a small problem with two GUIs that I downloaded. I'm using LucasFan's KQV template (from Shimbleshanks' page) and Joe Carl's Save/Load and Overwrite GUI.

My problem is very simple: whenever I load a saved game, the Options menu (in the KQV template there's a separate GUI menu for the Save, Restore, Restart, and Quit buttons) always appears. I don't want it to appear, because it's too much of a hassle to click it out of the way every time a game is loaded. It's also visible whenever I click the button that brings up the Save/Restore GUI.

I've tried entering the InterfaceOff command at what I considered to be appropriate lines in the script, and this somehow ended up rendering not only the Options menu, but the icon bar permanently invisible when I restored a game. Otherwise, the two GUIs seem perfectly compatible with each other, and I'm sure I'm missing something fairly basic. Still, I think I need some advice on how to fix this problem before I do something incredibly stupid.

Here are the two relevant sections of the global script:

KQV Options GUI:

Code: ags

////////////////////////////////////////////////
// Options-GUI                                //
////////////////////////////////////////////////

if (interface == 2) {  
    if (button == 0) SetGameSpeed(GetSliderValue(2,0)); // slider for gamespeed
    else if (button == 1) SetMusicMasterVolume(GetSliderValue(2,1)); // slider for musicvolume
    else if (button == 2) game.text_speed = GetSliderValue(2,2); // slider for textspeed
    else { 
     InterfaceOff(2);
     InterfaceOn(0);
      if (button == 3) SaveGameDialog();  //save game
      if (button == 4) RestartGame();       // restart game
      if (button == 5) { SetCursorMode(6); InterfaceOff(2); InterfaceOn(3); } // quit game
      if (button == 6) Display("Eine King's Quest-Demo füare AGS. Weitere Informationen auf Adventure-Treff.de"); // about
      SetDefaultCursor();
      }
   }



Overwrite and Save/Restore GUI:

Code: ags

#sectionstart overwriteSI_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE
function overwriteSI_btn_Click(GUIControl *control, MouseButton button) {
 int p = 0;
while(p<=partidas.ItemCount){
  if((partidas.ItemCount>p)&&(partidas.Items[p]==guardar.Text)){
UnPauseGame();
gOverwrite.Visible=false;
gSaverestore.Visible=false;
cerrar.Enabled=true;
SaveGameSlot(savegameindex[p], guardar.Text);
partidas.FillSaveGameList();
guardar.Text="";
Display("Game overwritten");
return;
} 
p++;  
}
  
  
  
}
#sectionend overwriteSI_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart overwriteNO_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE
function overwriteNO_btn_Click(GUIControl *control, MouseButton button) {
  gOverwrite.Visible=false;
  cerrar.Enabled=true;
  
}
#sectionend overwriteNO_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart partidas_SelectionChanged  // DO NOT EDIT OR REMOVE THIS LINE
function partidas_SelectionChanged(GUIControl *control) {
  guardar.Text=partidas.Items[partidas.SelectedIndex]; 
  
  
}
#sectionend partidas_SelectionChanged  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart guardar_Activate  // DO NOT EDIT OR REMOVE THIS LINE
function guardar_Activate(GUIControl *control) {
if(guardar.Text==""){
Display("Please enter a name before saving");
return;
}
int p = 0;
while(p<=partidas.ItemCount){
  if((partidas.ItemCount>p)&&(partidas.Items[p]==guardar.Text)){
Display("The game will be overwritten");
gOverwrite.Visible=true;
cerrar.Enabled=false;
return;
} 
p++;  
}

UnPauseGame();  
gSaverestore.Visible=false;
SaveGameSlot(partidas.ItemCount+1, guardar.Text);
  partidas.FillSaveGameList();
  guardar.Text="";
Display("Game saved");
return;
  
  
  
}
#sectionend guardar_Activate  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart savegame_Click  // DO NOT EDIT OR REMOVE THIS LINE
function savegame_Click(GUIControl *control, MouseButton button) {
if(guardar.Text==""){
Display("Please enter a name before saving");
return;
}
int p = 0;
while(p<=partidas.ItemCount){
  if((partidas.ItemCount>p)&&(partidas.Items[p]==guardar.Text)){
Display("The game will be overwritten");
gOverwrite.Visible=true;
cerrar.Enabled=false;
return;

} 
p++;  
}

UnPauseGame();  
gSaverestore.Visible=false;
SaveGameSlot(partidas.ItemCount+1, guardar.Text);
  partidas.FillSaveGameList();
  guardar.Text="";
Display("Game saved");
return;


  
  
}
#sectionend savegame_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart restoregame_Click  // DO NOT EDIT OR REMOVE THIS LINE
function restoregame_Click(GUIControl *control, MouseButton button) {
if(partidas.ItemCount!=0){  
int index = partidas.SelectedIndex;
RestoreGameSlot(savegameindex[index]);
  partidas.FillSaveGameList();
  savegame.Enabled=true;
  guardar.Enabled=true;
  cerrar.Enabled=true;
  SetGameOption(OPT_WHENGUIDISABLED, 2);
  }else Display("No game to load.");
  
  
  
}
#sectionend restoregame_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart borrar_Click  // DO NOT EDIT OR REMOVE THIS LINE
function borrar_Click(GUIControl *control, MouseButton button) {
if(partidas.ItemCount>=1){
int index = partidas.SelectedIndex;  
DeleteSaveSlot(savegameindex[index]);
  partidas.FillSaveGameList();
  }
  
  
}
#sectionend borrar_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart cerrar_Click  // DO NOT EDIT OR REMOVE THIS LINE
function cerrar_Click(GUIControl *control, MouseButton button) {
UnPauseGame();
gSaverestore.Visible=false; 
guardar.Text=""; 
  

}
#sectionend cerrar_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart FlechaPartidasUP_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE
function FlechaPartidasUP_btn_Click(GUIControl *control, MouseButton button) {
  partidas.ScrollUp();
  

}
#sectionend FlechaPartidasUP_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart FlechaPartidasDOWN_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE
function FlechaPartidasDOWN_btn_Click(GUIControl *control, MouseButton button) {
  partidas.ScrollDown();
  

}
#sectionend FlechaPartidasDOWN_btn_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart saverestore_Click  // DO NOT EDIT OR REMOVE THIS LINE
function saverestore_Click(GUIControl *control, MouseButton button) {
  partidas.FillSaveGameList();
  gSaverestore.Visible=true;
  mouse.UseModeGraphic(eModePointer);
}
#sectionend saverestore_Click  // DO NOT EDIT OR REMOVE THIS LINE



Thanks in advance.

EDIT: fixed formatting problems.
SMF spam blocked by CleanTalk