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

#1
Is there a reliable way to identify if the player has just skipped a line of speech?

My method in 3.6.1 is as follows:

1. Wrap Character.Say() to track when a character is speaking and if speech was skipped:

Code: ags
function MySay(this Character*, String message) {
  SetGlobalInt(IS_SPEAKING, this.ID);
  this.Say(message);
  if (GetGlobalInt(IS_SKIPPING_SPEECH)) {
    Display("speech was skipped");
    SetGlobalInt(IS_SKIPPING_SPEECH, 0);
  }
  SetGlobalInt(IS_SPEAKING, -1);
}

In 3.6.2, you can use Speech.SpeakingCharacter instead of SetGlobalInt(IS_SPEAKING, ...).

2. In repeatedly_execute_always(), check if a character is speaking and the skip key is pressed:

Code: ags
function repeatedly_execute_always() {
  if (GetGlobalInt(IS_SPEAKING) >= 0 && IsKeyPressed(Speech.SkipKey)) {
    SetGlobalInt(IS_SKIPPING_SPEECH, 1);
  }
}

This approach sometimes but not always captures whether speech has been skipped.  I assume this is because there's a race condition between completing the rest of the MySay() function (which clears IS_SPEAKING) and running repeatedly_execute_always() (which checks IS_SPEAKING).

Is there a better, more reliable way of tracking if speech has been skipped?
#2
I noticed that, while playing an AudioClip of eAudioTypeMusic (say, aMusFoo), when an AudioClip of aAudioTypeSound plays (say, aSfxBar), the observed volume of aMusFoo decreases substantially and remains decreased even after aSfxBar stops playing.  I've checked the volume of the channel playing aMusFoo before/during/after aSfxBar plays, and its value doesn't change; however, the observed volume definitely decreases.

Any idea what's going on here?  I'm guessing this is related to the internals of AGS' sound handling?

Other debugging information:
* I'm using v3.5.0.30, though I've observed this in previous versions of 3.5 as well.  (I hadn't yet added sound to my game back in the 3.4 days, so I'm not sure if it's a regression from then.)
* Even though sSfxBar isn't speech, I've tested with Game.SetAudioTypeSpeechVolumeDrop set to 0 for all my audio types, and it makes no difference.
* "Crossfade tracks" is disabled for all my audio types.
* For eAudioTypeMusic, MaxChannels is 2, and for eAudioTypeSound, Max Channels is 0 (but ends up being 2 after you subtract the channels used by my other AudioTypes).

Thanks,
Greg
#3
In my warnings.log, I'm getting a lot of entries that look like this:

> [R 456] SetCharacterIdle called while character view locked with SetCharacterView; idle ignored

Despite the outdated function names, I understand what this means: chr has a locked view at the at the time I'm calling chr.SetIdleView().  However, I'm not sure why this is a warning, as chr.SetIdleView() is still behaving exactly as I'd expect it to.  Namely, it's setting chr.IdleView, and though the idle animation won't play right now (since chr currently has a locked view), it will play sometime after chr.UnlockView() is called.

> [R 1110] Warning: ChangeCharacterView was used while the view was fixed - call ReleaseCharView first

I get this warning (also with outdated function names) if I call chr.ChangeView() while chr has a locked view.  However, that also behaves exactly as I expect it to, i.e. it clears the locked view and changes the character's normal view.

My question: is there a purpose to these warnings?  And in general, is warnings.log a useful debugging tool for people?

Thanks,
Greg
#4
Advanced Technical Forum / acsprset.spr size
Thu 11/07/2019 02:18:32
Hi, I was wondering how the size of acsprset.spr is determined.

Context: My acsprset.spr file is currently at 1.7 GB (with compression enabled in AGS), which is uncomfortably close to the 2 GB limit*.  To nudge the file size down, I compressed the source pngs for many sprites (via pngquant) and then reimported them into AGS (via "Replace sprite(s) from source...").  The total size of the source pngs decreased by 20 MB.  However, the size of acsprset.spr didn't change at all.

From https://www.adventuregamestudio.co.uk/forums/index.php?topic=53949.msg636543911#msg636543911, I understand that AGS converts the pngs to bmp upon import.  Since the size of acsprset.spr didn't change after I compressed the source pngs, does that mean whether a png is compressed or not, its bmp will be the same size?

Possibly related: if I add or remove a sprite and save the game, AGS takes ~10 seconds to save.  However, when I reimported ~200 sprites (via "Replace sprite(s) from source..."), AGS saved as quickly as it does when I haven't modified any sprites at all.  Could this mean the source sprites aren't getting reimported successfully?  I'm using AGS 3.4.3.1.

Thanks!
Greg

* - I know that AGS 3.5 removes the 2 GB limit, so this will become moot soon.
#5
Hello!  I'd like to use a custom key (specifically, spacebar*) for skipping cutscenes.  For dialog, there's Speech.SkipKey, but no such option exists for cutscenes.

To tackle this problem, my ideas are:

Idea #1: I can log a feature request for the equivalent of Speech.SkipKey for cutscenes (or, specific to my case, eSkipSpacebar for the StartCutscene() call). However, this is dependent on the Powers-that-Be agreeing it's a worthwhile feature and eventually putting it in a future release.

Idea #2: I can start cutscenes with StartCutscene(eSkipESCOnly), and then add a clause in repeatedly_execute_always() that, if spacebar is pressed, issues an Esc keypress.  However, while there's a way of issuing a click (e.g. Room.ProcessClick), I don't believe there's a way of issuing a keypress.

So my questions become:
* Beyond the ideas mapped out above, is there a way of using a custom key to skip cutscenes?
* Is there a way of issuing a keypress in the AGS scripting language?

Thanks!
Greg

* - Here's why I'd like to use a custom key:

AGS allows cutscenes to be skipped with Esc, Esc-or-rightclick, any key, any click, or any key-or-click.  I'd like to use Esc for opening the main menu (which seems a standard use of Esc, no?) and right-click for opening the inventory, and I'd like to minimize the chance of the user skipping the cutscene accidentally which using any key, any click, or any key-or-click would certainly trigger, as would using a key already mapped to another function (in this case, Esc or right-click).
#6
From the release notes, with 3.3.5, I understand that I can only write files to $SAVEGAMEDIR$ and $APPDATADIR$.  However, provided that I open the file in mode eFileRead, is it intended that I can still read files from the installation directory?

I have a call that looks like this...

File* st = File.Open("filename.txt", eFileRead);

...where filename.txt is located in the installation directory ("Compiled").  With 3.3.4, the call read the file successfully from that location.  With 3.3.5, it can't find the file -- I've verified that it's looking in $APPDATADIR$* instead.  I tried to force AGS to read from the Compiled directory with "./filename.txt", but it still can't find the file.

My question: is it possible to read files from the installation directory?  If so, how?

Thanks!
Greg

* - On my PC (Windows 10), $APPDATADIR$ is located at "C:\Users\All Users\Adventure Game Studio\Name of Save Game Directory".
#7
Is there any way to play a speech file (packaged in speech.vox) as an audio clip rather than as speech?

For example, to play a speech file as speech, I'd use cEgo.Say("&1234 I speak therefore I am."), which then plays EGO1234.ogg (which was packaged into speech.vox at compile time).

But is it possible to play EGO1234.ogg directly as an audio clip, i.e. to access that particular sound file within speech.vox?  Right now, my workaround is to import the speech file as an audio clip (e.g. aEGO1234) and then play it; but that's clunky for several reasons (e.g. duplicates data, not extensible since you have to import each sound manually in the editor, etc).

By the way, my goal in all this is to play a speech file in a non-blocking manner.  (I'm writing my own version of SayBackground that includes sound.)

Thanks,
Greg
#8
Can a function wait in a way that doesn't prevent other functions from running?  Here's what I'm trying to do.

Code: ags

// show icons, allow the player to choose one, and return the choice
function ReturnIconChoice() {
  // Display a list of icon buttons.
  // When the player selects a button, the button's script stores the button ID in global integer CHOICE.
  // The GUI is normal (as opposed to pop-up modal), so that the ambient actions (animations, sounds, etc) continue even when the GUI is showing.
  ShowIconsGUI();

  // wait for the player to make a selection
  while (GetGlobalInt(CHOICE) != NO_CHOICE_MADE) Wait(5);

  // return the selection
  return GetGlobalInt(CHOICE);
}


This hangs at present because Wait() doesn't allow any scripts to run in the background.  I'm looking for a way of putting ReturnIconChoice() to sleep for a couple cycles so that the player can make a selection from the GUI and then we can continue executing ReturnIconChoice().  Is this possible?  If not, are there any suggested workarounds?

Thanks!
Greg
#9
Hi, I'm trying to set backgroung music levels via GUI.  I've read the threads in the archive about the subject, but it doesn't seem that they've come to any real resolution.

Rather than using SetMasterMusicVolume(), which can't control background music independently of the room-based SetMusicVolume(), I'm trying to manipulate the music directly via SetChannelVolume(0, desiredVolume).

This controls the music volume accurately (i.e. 0 silences the music, and 255 makes it really loud), but, whenever a character speaks, the background music reverts to its previous level.  Do you know why this would be?

In any event, here are excerpts from my script for reference...

function game_start() {
  if (IsMusicVoxAvailable() == 0) {
    ...
  } else {
     SetChannelVolume(0, 128); // set initial volume level
  }
}

// in the GUI code
    ...
    } else if (button == 12) { // player presses OK, change volume levels
      SetDigitalMasterVolume(GetSliderValue(SOUND, 6));
      SetSpeechVolume(GetSliderValue(SOUND, 0));
      SetChannelVolume(0, GetSliderValue(SOUND, 1)); // background music
      SetSoundVolume(GetSliderValue(SOUND, 4));
      SetVoiceMode(GetGlobalInt(98));
      GUIOff(SOUND);
    }
    ...

Thanks for your help!

Greg
#10
Jessica Plunkenstein and the Dusseldorf Conspiracy

     

"The game's laugh-out-loud dialogue and clever puzzles make Düsseldorf the best adventure game I've played this year." â€" Charles Herod, The New York Times

Overview

It's been a peculiar day for Jessica Plunkenstein.  By a freak twist of fate and/or airline security, our hero finds herself up against evil barons bent on world domination, evil headmistresses bent on pathological propriety, and evil yodelers bent on nothing in particular.  Full of llamas, ninjas, French people, pickled herring, dubious German accents, yetis in heat, and musical theatre up the wazoo, Jessica's adventures bring her from the Amazonian Rain Forests to the Norwegian Alps with layovers along the Eastern seaboard.  So tag along, and you, too, can unravel The Düsseldorf Conspiracy.

Features:


  • An irreverent storyline with absolutely no mammoths or talking robots.
  • Eight hours of gameplay, divided over four parts and fifty unique locations.
  • Full score and over 2,500 lines of recorded dialog.
  • Llamas.

Download Information:


  • Downloads, updates, and the latest on all things Plunkenstein is available at greGAMES.net
SMF spam blocked by CleanTalk