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 - Jack Hare

#1
Well, I've tried a bushel of searches, but everything I've turned up seems to refer to AGS versions before the Button.Animate command was added -- I'm using v3.1.  Hope I haven't missed something blazingly obvious...

What I want seems simple enough: to have GUI buttons with a normal Image, a normal Pushed Image, and an animated Mouse Over image.  This is the code I've tried to accomplish the first step, getting the button to animate on Mouse Over (using just one button, InvUp, for testing):

Code: ags

function repeatedly_execute()
  {
    GUIControl *theControl = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
    GUI *theGui = GUI.GetAtScreenXY(mouse.x, mouse.y);
    if (theGui == gMain) {
      mouse.SaveCursorUntilItLeaves();
      mouse.Mode = eModeSelect;
      mouse.ChangeModeGraphic (eModeSelect, 10); // the Select cursor changes color depending on which GUI it's over
      if (theControl == InvUp){
        InvUp.Animate (2, 0, 15, eRepeat);
      }
    }
    else if (theGui == gMenu) {
      mouse.SaveCursorUntilItLeaves();
      mouse.Mode = eModeSelect;
      mouse.ChangeModeGraphic (eModeSelect, 5);
    }
    else if (GetLocationType(mouse.x, mouse.y) != 0){
      mouse.SaveCursorUntilItLeaves();
      mouse.Mode = eModeAct;
    }
    else {
        mouse.Mode = eModeGo;
    }
  }


...but this doesn't start playing the animation until the mouse is taken off the button -- while the cursor is over the button, it changes to the first frame but doesn't animate.  From the Button.Animate description in the manual, I don't see why this is the case or how to change it.

After that, of course, I want to restore the regular graphics for default and Pushed Image, but again, from the description of what appears to be the right function, Button.NormalGraphic, I haven't been able to figure out how to construct a correct command line.

As for the "lazy questions", there's a huge list of things remaining on my figure-it-out stack, and as long as I'm posting anyway, maybe some of you old hands can point me in the right directions (or at least away from the wrong ones) -- these aren't 'real' questions yet, since I haven't done intensive research on any of them, just some things I want to accomplish and would appreciate any tips or feedback on:

* I have a black status bar that remains always visible on the lower edge of the screen, and I'd like to use this space to display several different types of thing:  game messages (such as @OVERHOTSPOT@ results, "Use Item on [object name]", and so forth); the Main Menu (which is a simple row of text buttons, "[ save ]  [ load ]  [ new ]" etc.); and several of the Menu options themselves (for instance, the Save "window" would just be a line of text, "Name this saved game: _________ [ ok ]  [ cancel ]", similar for Confirm Quit and Confirm Restart).

I can think of several ways to accomplish this, but I'm interested in hearing your thoughts on simple and elegant ways -- ideally, using the smallest possible number of different images, GUIs and buttons/labels stacked atop one another.

* I want to have a Map window in which one can zoom the view in and out (between three discrete scale images; it doesn't need to animate between them), and drag or scroll the map image around (ideally, by grabbing and dragging it in the manner of Google Maps); on the map I'd like the locations to highlight on Mouse Over, and be available for the "Look" and "Go" commands (with a routine to check whether your character has a clear path to "zip" to a new location).  Again, I do plan to work this out on my own, but there are so many sub-tasks involved that I'm finding the whole thing a little overwhelming -- any advice on how to get started with this particular complex of functions would be greatly appreciated.

[ edit: I looked up some map-related threads, and though I've gotten some ideas, the most specific issue I have is that I want to have the map visible through a window on the screen -- that is, NOT taking up the whole screen, and with the current room still visible around the edges of the GUI. ]

* Finally (for now), because this game involves a LOT of characters, objects and locations, I plan on constructing it as a series of Episodes, each being a self-contained game covering a given amount of the overall story.  To make that work, I want the player to be able to continue from their save of the previous chapter (structurally, the game is mapped out such that each chapter has a range of beginnings based on the possible endings of the preceding).  I don't EVEN know where to begin on this; is there a reasonably simple way to set up such a thing?  In particular, is there anything I should be considering right from the start with an eye toward making the game work this way?

Thanks for any help you feel like giving!   ;D
#2
Well, I've searched and searched, but I've finally reached a question I wasn't able to work out for myself...

I've got a room accessible from anywhere that's supposed to act as a sort of psuedo-GUI to handle inventory in a novel way, but I'd like to create the illusion that it's just a pop-up.  To that end, the inventory room's background features the inventory panel, and a blank gray space; I want to fill the gray space with the player's previous room background image (presumably using dynamic sprites / drawing functions).

But I just can't figure out how to phrase it.  How can I tell this room to call up the player.PreviousRoom in such a way as to get the BACKGROUND image from it?
SMF spam blocked by CleanTalk