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

#1
Khris:

Not in the original version of your module (: For the version implemented in this template, I took out the direction parameter of the walk-to point so that developers can have one less thing to specify, leaving it to be automatically calculated. I've also just added an option to manually override the direction when necessary.
#2
Crimson Wizard:

1. Done.
2. That's true, but I didn't want the tab to block too much of the screen. How wide do you think it should be in relation to the width of the whole inventory panel? Or would it be better to make the inventory tab hotspot wider without actually changing the size of the tab, so that it looks the same while responding to mouse hovers at the top part of the screen underneath the pull-down inventory panel?
3. Fixed.

Most of the commented-out code is left in to give developers more alternatives e.g. allowing them to use an imported sprite instead of a dynamically-drawn sprite as a hotspot marker. I've just gone through the code to remove the lines that are truly obsolete.
#3
Crimson Wizard:

I think this template would be useful for those interested in implementing the features mentioned above. I wrote it because as a player I prefer it when adventure games have such features, and I wanted to make it easier for developers to include them.

Yes, the modules are actually used in the template logic. The GUIColours script is in use by default to make it easier for people to change the look of the buttons and sliders by using dynamic sprites, but it can easily be taken out for those who would prefer to import static images.
#4
frenzykitty: Hope you like it!

StillInThe90s: Yes, it's possible. Note that the double-click code is only run when the cursor is the warp cursor (hovering on an exit), so take a look at the code under "if (mouse.Mode == eModeWarp) {" in the "function on_mouse_click(MouseButton button)" block and use it as a model for your general double-click code.

2 ways:

1) Execute single-clicks immediately (like to start a non-blocking walk) and let double-clicks override the first click without explicitly cancelling anything.

This is what happens in the template currently, so you don't have to do anything special.

2) Do not execute single-clicks until the maximum time interval between clicks (for it to count as a double-click) has run out, upon which the code for either single or double clicks will be run, which will result in a small delay for single-clicks.

This was what the original code did, please take a look. More specific instructions below, but remember to take out the "if (mouse.Mode == eModeWarp) {" check.

Search the code for "// no return, will lead to ProcessClick later". At that place, insert a "return;" statement. The code for single-clicks will be called under repeatedly_execute instead of on_mouse_click.

Search the code for "__arrived = true; // makes sure player". Replace that line with a "single_click(false);" statement.

Search the code for "//single_click(true);" and uncomment out that line.

Add this function to the script:

function single_click(bool single) {
  if (single) {
    // single-click code
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
  else {   
    // double-click code
    Display("Double-click detected!");
  }
}
#5
Phemar: Thanks, glad you like it!
#6
Monsieur OUXX: Done (:

Khris: Thanks for your code, it's really useful! The non-blocking walk module in particular is a godsend. I'm too lazy to do a youtube video, but the template includes a demo game and a basic tutorial through dialogue.
#7
This template uses a left-click interact right-click examine interface, similar to the interfaces used in BASS and Daedalic's games.

It comes with a number of features like:

  • non-blocking walks (courtesy of Khris' GotThere module)
  • exit cursors + double-clicking to teleport to exits (courtesy of Khris' double-click code)
  • show-all-hotspots GUI
  • inventory window that slides in and out (opens and closes without the need for any clicking)
  • navigation map
  • the full set of menus with more customisation options
  • saves which include date/time and screenshot
Made for AGS 3.2.1, compatibility with other versions unknown

Changelog:
v1.1

  • Expanded menu options (e.g. more volume and speed controls)
  • Inventory is now properly translucent (32-bit)
  • Panel GUI colours now easily customisable with dynamic sprites
v1.2

  • GoThere module now makes sure player character faces the right way after walking
  • GoThere functions better explained in dialogue tutorial
  • Saves now include date/time and screenshot
v1.2.1

  • Improved save code
v1.3 14-07-2013

  • Fixed major bug that gets rid of inventory window completely when Esc is pressed with it open
  • General code optimisations and improvement of save function
v1.3.1 07-10-2013

  • Fixed bug where game crashes in the absence of readme.txt
  • Speaking cursor is now used when mouse hovers over characters
v1.4 19-10-2013

  • Added alternative function to manually specify the direction that player character should face after reaching the walk-to point
The current limitation of the non-blocking walks / GoThere module is that the walk-to points have to be set in walkable areas, meaning that walk-to points have to be manually specified for objects and characters. If anyone can figure out a simple and reliable way to find the xy co-ords in a walkable area closest to any given co-ord (i.e. where the PC will stop after being told to walk to a point in an unwalkable area), we might be able to simply use the x and y properties of the object/character and mouse.x and y for hotspots whenever the walk-to points/properties are undefined, making things easier for developers as they would only have to define the points in special cases.


Demo graphics courtesy of Reality-on-the-Norm

Download template here (demo game included)
SMF spam blocked by CleanTalk