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

#241
A.S.S. - Another Savegames with Screenshots module - v1.5 released 04.11.2011
Original code by Spyros. Enhanced and ported to AGS 3+ code by hedgefield
---------------------------------------------------------------------------------------------------------

v1.5 changelog:
- fixed a bug where pressing F5 or F7 repeatedly opened new instances of the save and load GUI respectively
- added the option to save and display the date and time the savegame was made. see readme for instructions

v1.4 changelog:
- turned the script into a module now that I know how to do that :)
- resized the GUIs back down to their original size and removed all graphics from them
- the module should now enable the "save screenshots in savegames" option for you if you hadn't already

v1.3 changelog:
- fixed a bug where the load GUI would crash when trying to load with no savegame selected

v1.2 changelog:
- fixed a bug where the load GUI would not recognize the first new savegame after deleting all the existing savegames

V1.1 changelog:
- added a delete button!
- fixed a bug where the game would crash when trying to load when no savegames existed yet
- added the ability to deselect a slot by clicking outside the listbox
- increased the walking speed of the character to make moving around less tiresome
- updated the readme with usage instructions

---

ANOTHER savegames with screenshots template you say? Indeed. It remains a much-requested feature, so why not?

This template is a port -or perhaps "mutation" is more accurate- of Spyros' old savegames with screenshots tutorial. When I upgraded to AGS v3 I had to rewrite his code to work with the new object-oriented scripting language, and made a few modifications in the process. So here it is for you to enjoy aswell!

MAKE YOUR CLICKS HERE FOR DOWNLOADING TIMES (download here)



To install:
- import ASS.scm into the Scripts library in AGS (right-click on it, choose 'import script')
- import gSave.guf and gLoad.guf the same way under the GUI library
- open ASScode.txt, copy the whole thing and paste it at the bottom of your global script

To use: When you want to open the save GUI, all you have to do is call: sl_save();
And to open the load gui - you guessed it: sl_load();

new! If you want to store the date and time the screenshot was made, put SL_DATETIME = true; under function game_start() in your Global Script.

Comes with predefined keyboard shortcuts (F5 and F7, can be edited)


Requires AGS v3.0+. Tested with AGS 3.2.1. Keyboard shortcuts are still in ASCII code for additional backwards compatibility.
#242
Mine's @largopredator

It's more for personal thoughts, but occasionally a game design tweet flies by :)
#243
Quote from: Pumaman on Sun 03/05/2009 15:34:47
* Fixed light levels >100% not working with Direct3D driver

SWEET thanks Ceej, you're the best. :D
#244
Hey guys, quick question:

I have a couple of regions set up around some windows, where the player gets progressively brighter as he walks towards them.
Now, with DirectDraw 5, these regions increase the brightness of the whole sprite beautifully. I used that back in 2.62, but now in 3.12, with DirectX9, I've noticed it only raises the brightness while the contrast remains the same. In other words, only lighter areas actually become lighter, the blacks stay just as intense, which totally ruins the point of the lighting in the first place.



Any way to 'fix' this? I don't want to downgrade to DD5 again, it makes the whole game run slower and I'd lose the antialiasing on scaled sprites. I was already thinking alpha overlays, as discussed here a long time ago, as a way to also smooth out the shadow transitions, but this does bring all sorts of pratical problems along with it aswell.

Cheers.
#245
Excellent release, haven't encountered any problems so far. And the FadingObjectNonBlocking module works again, which makes me very happy! :) There was a problem with the way it handled alpha-blended sprites in 3.1, but it seems to work swimmingly now. Keep up the good work!
#246
Thanks guys! Yeah I forgot to mention that, it does contain a few swearwords. Good looking out.

And yeah, the animation can be a bit funky sometimes. The jerkiness gets quite apparent when Coyote is scaled up, and the moonwalking is a result of there not being a dedicated up-down walkcycle (it's just the frames from the left-right :)). But improving those would have delayed the game even more, so I'll just fix that for episode II.

And the puzzles might be a bit uninspired because I wrote the story before I worked on the puzzles. Fitting them in afterwards is always a pain. But nowadays I do it parallel, so that should improve in the next game.

Let me know if you have any other feedback!
#247
Predator Productions proudly presents:



The year is 1846.

The first settlers have reached California, and the United States are at the brink of war with Mexico. These are troubled times. And in these times, people look for a hero.

What they got was an outlaw.

Are you man enough to fill his boots?




Coyote is a short game that started as a little sideproject to TMC. It wasn't really going anywhere, but when I decided to use the idea for a school assignment, things got done (deadlines are great!). So here it is, my first completed game with AGS! :)

Like I said, it's a short game. It's a sort of introduction to the world of The Coyote - a prequel, if you will, to a future full-length game.

Featuring:
- Handpainted 640x480 graphics!
- Full voiceacting with 314 lines of spoken dialog!
- Gritty cowboy stuff!
- Authentic cowboy slang!
- Shiny objects!

Minimum requirements:
- A Pentium processor with at least 700 Mhz
- 64 MB RAM
- About 90 megabytes of hard disk space
- Windows 98, ME, 2000, XP or Vista with DirectX 5 or above
- Any DirectX-compatible sound and video card

CLICK HERE TO DOWNLOAD THE GAME [71 mb]
#248
Excellent, thanks CJ. I thought that was what the problem was. Didn't occur to me I can now actually create a screenshot right away without having to save it first. Appreciate the speedy help man.
#249
Ooh thanks, I was wondering about that because I couldn't find savegameindex in the manual. I replaced those references like you said, and in the load GUI SelectionChange I changed:

Code: ags
screenshot = DynamicSprite.CreateFromSaveGame(saveslot, SL_WIDTH, SL_HEIGHT);


to:

Code: ags
screenshot = DynamicSprite.CreateFromSaveGame(lstLoadGames.SaveGameSlots[saveslot], SL_WIDTH, SL_HEIGHT);


Which solved the screenshots displaying wrong. :)

Now to just figure out how to get the screenshot to display right away on the save GUI and I'm all set.
#250
Hey guys, I'm setting up a custom save/load system for my game in AGS 3.0.2 SP1.
It's based off that 'ole 'Save/load with screenshots' tutorial from way back when, and I had it working fine in AGS 2.62. But since I didn't understand the code 100%, I had to do a bit of guessing when translating it to the new scripting language. It seems to have worked out pretty well though, since the overall system works, but there's just some peculiar things going on with the GUI itself.

1. When I open the save gui, it takes a screenshot and puts it on a button. However, the first time the screenshot does not load. Only when I close the GUI and open it again does it show up. If I moved in the meantime though, I have to close the GUI again and reopen to see THAT screenshot. So the display is always lagging behind.
2. Additionally, the tempsave I make to create that screenshot never gets deleted, even though it says so in the code.
3. When I open the load GUI, I cannot get the screenshot of the top slot to display. If there are multiple savegames in the list, all their screenshots display correctly, except for the top slot. It just returns null on that one.


Here's the relevant code:

The function definitions (@ top of the global script)
Code: ags
//--------------------------------------------------------------------------------------------------------------
// Savegames with screenshots
//--------------------------------------------------------------------------------------------------------------
// Definitions

// Define screenshot width  - 320/5, aka 128 real pixels in 640x480
#define SL_WIDTH  64  
// Define screenshot height - 240/5, aka 96 real pixels in 640x480
#define SL_HEIGHT 48  
// Substitute "139" with the sprite number of your choosing
#define SL_EMPTY_SPRITE 70

// Variables

String text;                                                              // Stores the typed text
int saveslot = 0;                                                         // Stores the selected savegame slot
int saves = 0;                                                            // Stores the total number of savegames
DynamicSprite *screenshot;                                                // Stores the screenshot

// Functions

function sl_save() {
  Wait(1);
  SaveGameSlot(100, "temp");                                              // Save current game in temp slot
  screenshot = DynamicSprite.CreateFromSaveGame(100, SL_WIDTH, SL_HEIGHT);// Retrieve screenshot from save
  DeleteSaveSlot(100);                                                    // Delete temporary slot
  if (screenshot != null) {
    btnSaveScreen.NormalGraphic = screenshot.Graphic;                     // Display current screenshot
  }
  txtSaveName.Text = "";                                                  // Clear Text box
  lstSaveGames.FillSaveGameList();                                        // Fill List Box with saved games
  lstSaveGames.SelectedIndex = -1;                                        // Deselect savegame slots
  saves = lstSaveGames.ItemCount;                                         // Count how many saved games there are         
  if (saves > 19){                                                        // If saved games 20 (maximum)
    Display("All save slots are full. Please overwrite a previous save.");// Display warning
  }
  gSave.Visible = true;                                                   // Opens the save GUI
  gSave.Centre();                                                         // Centres the save GUI
  mouse.Mode = eModePointer;                                              // Set the pointer cursor
}

function sl_load() {
  lstLoadGames.FillSaveGameList();                                        // Fill List Box with saved games
  lstLoadGames.SelectedIndex = -1;                                        // Deselect savegame slots 
  gLoad.Visible = true;                                                   // Opens the load GUI
  gLoad.Centre();                                                         // Centres the load GUI
  mouse.Mode = eModePointer;                                              // Set the pointer cursor
}

//--------------------------------------------------------------------------------------------------------------


The GUI interactions (@ bottom of the global script).
Code: ags
// Save GUI
function btnSaveOK_OnClick(GUIControl *control, MouseButton button) {
  saves = lstSaveGames.ItemCount;                           // Count saved games
  if (saves < 20) {                                         // If less than 50
    text = txtSaveName.Text;                                // Get the typed text
    if (screenshot != null) {
      btnSaveScreen.NormalGraphic = SL_EMPTY_SPRITE;        // Resets the screenshot
      screenshot.Delete();
    }
    gSave.Visible = false;
    mouse.Mode = eModeWalkto;
    Wait(1);
    SaveGameSlot(saves+1,text);                             // Save game (text as description)
  }   
  else {                                                    // If saved games are maxed out (50)
    saveslot = lstSaveGames.SelectedIndex;                  // Get the selected save game
    text = txtSaveName.Text;                                // Get the typed text
    if (screenshot != null) {
      screenshot.Delete();
      btnSaveScreen.NormalGraphic = SL_EMPTY_SPRITE;        // Resets the screenshot
    }
    gSave.Visible = false;
    mouse.Mode = eModeWalkto;
    Wait(1);
    SaveGameSlot(savegameindex[saveslot],text);             // Overwrite the selected game
  }
}

function btnSaveCancel_OnClick(GUIControl *control, MouseButton button) {
  gSave.Visible = false;
  mouse.Mode = eModeWalkto;
  if (screenshot != null) {
    screenshot.Delete();
    btnSaveScreen.NormalGraphic = SL_EMPTY_SPRITE;          // Resets the screenshot
  }
}



// Load GUI
function btnLoadOK_OnClick(GUIControl *control, MouseButton button) {
  saveslot = lstLoadGames.SelectedIndex;                    // Gets the selected slot
  gLoad.Visible = false;
  mouse.Mode = eModeWalkto;
  if (screenshot != null) {
    screenshot.Delete();
    btnLoadScreen.NormalGraphic = SL_EMPTY_SPRITE;          // Resets the screenshot
  }
  RestoreGameSlot(savegameindex[saveslot]);                 // Restores the selected slot
}

function btnLoadCancel_OnClick(GUIControl *control, MouseButton button) {
  gLoad.Visible = false;
  mouse.Mode = eModeWalkto;
  if (screenshot != null) {
    screenshot.Delete();
    btnLoadScreen.NormalGraphic = SL_EMPTY_SPRITE;          // Resets the screenshot
  }
}

function lstLoadGames_OnSelectionChange(GUIControl *control) {
  // Updates screenshot display when selecting a different slot
  saveslot = lstLoadGames.SelectedIndex;                    // Gets the selected slot
  screenshot = DynamicSprite.CreateFromSaveGame(saveslot, SL_WIDTH, SL_HEIGHT);
  if (screenshot != null) {
    btnLoadScreen.NormalGraphic = screenshot.Graphic;       // Updates the screenshot
  }
}


Any thoughts?


[UPDATE]
I've done a bit of further tweaking, and I've discovered some things.
When I delete the tempsave after clicking OK or Cancel on the save GUI instead of right away, it succesfully gets deleted. Side-effect: Now the GUI never shows a screenshot.

Also, something strange happens on the load GUI. I've noticed that the screenshots are sorted in ascending order, with the first one at the top, but the savegames themselves are listed descending, so the most recent one is at the top. So if you save a few times, it sticks the wrong screenshots on the slots.
#251
I encountered the same problem today, so I thought I'd post the solution if anyone else has had this problem too.

If you start with the empty game template, create at least ONE gui. You don't even have to use it - you can just make one and turn it off, but apparently you need at least one gui in your game for the built-in text window to work.
#252
General Discussion / Re: Anyone play guitar?
Tue 16/09/2008 20:04:17
Quote from: Ryan Timothy on Tue 16/09/2008 03:20:09
I've been thinking of learning how to play the acoustic guitar.  But I don't really want to pay for guitar lessons.  Anyone know the best way to learn how to play without pay?

I've learned a lot from Justin Sandercoe. He has a free acoustic guitar course at http://justinguitar.com/en/AA-000-LessonIndex.php.
#253
I have no idea how it's all coded exactly, but isn't there a way you could toggle the scrolling on/off?

As for the the properties thing, all I can see is //Required Properties:// etc, there's not really a mention of 'you need to go make these custom properties in the custom properties editor of the room'. I happened to remember there was a properties editor there, but I never knew what it was for before.

And the dummy thing might be a good workaround. In another game I already used that method before I figured out the setviewport business.
#254
Quote from: MEHRDAD on Mon 15/09/2008 16:29:43
choose graphics driver: direct draw5
Yeah thanks those settings have nothing to do with this at all.

Quote from: Pumaman on Mon 15/09/2008 20:24:55
Did you create the three custom properties (PxPos etc) described at the top of the module script ?

I have to create those properties anyway even though I don't use parralax objects? It's strange that the scrolling does work if I just start in a different room then. For a next version you might want to specifiy that bit a little more clearly for people who have never used custom properties before.

But anyway that seemed to have been the problem, so thanks. Though now, locking the Viewport doesn't seem to work anymore.
#255
Hey, I've been trying to implement this module in some of my games I'm building with AGS 3.02 SP1, but in some rooms I get this error:



This happens in the first room of my game, which is a scrolling room. But when I start in the second room (also scrolling) - or any other room-, it works perfectly. In another game it also happens in one specific non-scrolling room. What could be the issue here?
#256
Quote from: AGA on Sat 06/09/2008 15:33:33
It's possible upgrading to SP1 deleted your existing system restore points, since they might no longer be valid, which might explain the extra free space all of a sudden.
I regularly clear my System Restore points, and like every two weeks Vista accumulates another 10 Gig of Restore Points, so yeah, that is probably it.
#257
Exactly, I think it depends on what kind of person you are for what you take away from listening to music. For me it's mostly about feeling and visualisation. I too can come up with entire movies when I listen to a song, like "oh this song would be perfect for a scene like ...". or just feel transported to a different place.
#258
That's what used to happen with Global Ints. I had a long list of 'em, and one time I forgot to give one a description and consequently could not for the life of me figure out where I used it.

But with the global variables editor its easy. You can call its name directly from the script so no need to remember it's number. As extra, I always add the prefix gvar_ to whatever name I give the variable so I can easily recognize it in a script.
I guess one of the 'dangers' is that if you edit the variable a lot from many different rooms, you could lose track of what you're doing to it and where. But I'm not convinced turning it into local variables is any less confusing. Afer all, it's still code. :)
#259
Right, OK, I can't say that I completely understand what the problem was, but I see now that global variables and global ints are two different things. I removed all references to GetGlobalInt and SetGlobalInt so that it's just gvar_wine = 1; etc, and that seems to work.

I've only recently switched to the OO scripting language of the 3.0 releases from ags 2.62, so I still need to familiarize myself with some of these new methods. The manual isnt very clear on some of these things.

So I guess there is no choice but to use a run-script now if you want to change a variable from a dialog...

Thanks for the help guys.
#260
Hmm maybe I should try that, I've been using the global variables editor to create them. I forgot you can also do it manually like that.

[edit]
Hmm no luck so far. Using SetGlobalInt as definition in the global script doesn't work anymore, and I don't know how to do that whole #define thing, it's not in the manual. So I removed all the global variables from the editor and created them again, but the problem persists.

There is no definition anywhere that could make gvar_wine == gvar_mexican.
The only place I actually edit these variables via SetGlobalInt is by using set-globalint gvar_wine x during one dialog, and in another dialog I call a run-script which among other things sets gvar_mexican to 1. This second dialog does not occur until three rooms after the room where the problem occurs.

[update]
I have two other variables defined besides _wine and _mexican, which are _window and _cellar. I didnt involve them in the testing before, and like the others they have nothing to do with eachother, but testing shows that they suffer from the same problem. gvar_cellar changes to 1 when you move an object in another room, and gvar_window turns to 1 when you exit a certain room via a particular exit.


Bottom line: when I set a value for one global variable, all the other ones assume the same value. Is this a bug in the global variables editor?
SMF spam blocked by CleanTalk