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 - Laura Hunt

#1
I'm implementing a card minigame in my game and I want the cards to "pop" up and move to the front when the mouse moves over them. When the player moves the cursor at a "reasonable" speed, things go well:




However, if the cursor moves too fast, some cards will get "stuck" in their top position and won't go back down:



Also, if I leave the cursor at just the right spot, the card will start jumping up and down, since it will constantly move in and out of the cursor's hotspot:



This last case doesn't worry me too much since it's kind of an edge case, but the cards getting stuck is a real problem that makes the whole thing look kind of bad. Is there any way I could avoid that?

My code:

Code: ags
Object* previouscard;

void descendCard(Object* card)
{
  int ycoord;
  switch(card)
  {
    case oObject1:
    case oObject4:
      ycoord = 220;
      break;
    case oObject2:
    case oObject3:
      ycoord = 205;
      break;
    case oObject0:
      ycoord = 190;
      break;
  }
  card.TweenY(0.25, ycoord, eEaseOutBackTween, eNoBlockTween);
}

void ascendCard (Object* card)
{
  int ycoord;
  switch(card)
  {
    case oObject1:
    case oObject4:
      ycoord = 210;
      break;
    case oObject2:
    case oObject3:
      ycoord = 195;
      break;
    case oObject0:
      ycoord = 180;
      break;
  }
  card.TweenY(0.25, ycoord, eEaseOutBackTween, eNoBlockTween);
}

function room_Load()
{
  
  oObject1.Baseline = 189;
  oObject2.Baseline = 190;
  oObject0.Baseline = 191;
  oObject3.Baseline = 190;
  oObject4.Baseline = 189;
  // there's a series of dynamic sprite rotations here which I'm omitting because they're not relevant

}

function room_RepExec()
{
  Object* o = Object.GetAtScreenXY(mouse.x, mouse.y);
  
  if (o == null) { // to empty space
    if (previouscard != null) {
      previouscard.Baseline = previouscard.Baseline - 3;
      descendCard(previouscard);
      previouscard = null;
    }
  }
  
  else if (o != null && previouscard != null && o != previouscard) { // from one card to another
    o.Baseline = o.Baseline + 3;
    ascendCard(o);
    previouscard.Baseline = previouscard.Baseline - 3;
    descendCard(previouscard);
    previouscard = o;
  }
  
  else if (o != previouscard) { // from empty space to card
    o.Baseline = o.Baseline + 3;
    ascendCard(o);
    previouscard = o;
  }
}

#2


Would it be possible to make these arrows a bit taller, or replace them with elements that are a bit easier to click? It really is a bit of a pain to have to click on an area that's like 4 pixels tall in order to scroll through lists of room elements.
#3
This is kind of a weird one and it might be difficult to explain, but I'll try my best. Using 3.6.0 RC 2.

In a test room for my game, I'm doing the following:

Code: ags
oExampleObject.SetView(FIRSTVIEW);
oExampleObject.Animate(2, 6, eOnce, eBlock);
oExampleObject.SetView(SECONDVIEW);
oExampleObject.Animate(2, 6, eOnce, eBlock);
oExampleObject.SetView(THIRDVIEW);
oExampleObject.Animate(2, 6, eOnce, eBlock);

I know that when you call SetView without the optional loop and frame parameters these default to 0, so that what I'm doing here is equivalent to oExampleObject.SetView(FIRSTVIEW, 0, 0).

However, I made a tiny mistake here, because loop 0 for FIRSTVIEW, SECONDVIEW and THIRDVIEW is empty.

I would expect the game to maybe crash or throw a warning in this case, but what it's doing instead is playing a frame-linked audio that belongs to a completely different view from any of these three every time the SetView command is triggered.

Furthermore, I have not called SetView on any object or GUI button before this.

Obviously what I need to do is set the correct loop in the SetView command: oExampleObject.SetView(FIRSTVIEW, 2). Still, this is very confusing, because I have no idea why AGS is choosing to trigger that specific view and frame when it finds an empty loop.

Anybody have any idea what might be going on here?
#4
I would like to implement a timer such that, if the player doesn't choose one of the options in a dialog in a certain amount of time, one of them will be triggered at random.

The idea I've been working on is to launch a timer right before the dialog starts, and to check it in repeatedly_execute_always like this:

Code: ags
function repeatedly_execute_always()
{

  if (IsTimerExpired(1) && !dExampleDialog.HasOptionBeenChosen(1) && !dExampleDialog.HasOptionBeenChosen(2) && !dExampleDialog.HasOptionBeenChosen(3)) {
    int rnd = Random(2);
    for (int i = 0; i<3; i++) {
      if (i != rnd) dExampleDialog.SetOptionState(rnd+1, eOptionOffForever);
    }
    dExampleDialog.Start();    
  }
}


The idea is to check if the player has not chosen any options, and then switch all other options to Off so that when I re-trigger the dialogue, there will only be one left and it will run automatically.

The logic seems sound, but there is an issue: I cannot trigger dExampleDialog.Start() from inside rep exec always. So now I'm stuck and maybe it's because I've spent too much time in front of this, but I can't find an alternative way to do it. Any suggestions?

Edit: actually, it seems like I can't trigger a new dialogue (or the same one) while one is running, so this makes it even harder now... Is there a way to exit/stop a dialogue from outside the dialogue itself?
#5

I'm not sure if this is a bug, a feature, or if there's something really obvious I'm missing.

I'm using AGS 3.6.0.30, and I have set Speech.SkipStyle to eSkipKeyMouse. I'm using "Lucasarts" speech style (above the characters' heads) and I don't have any voice clips/voiceover.

What I expect to happen is that when my character says something (cTestChar.Say("Hi! I am a test character.");), the text will stay on screen and his talking animation will loop until I click the mouse or press a key.

However, what happens is that his talking animation only plays up until a certain point and then it freezes until I press a key or click the mouse and a new line plays.

My guess is that this animation only plays for as long as it would usually take for the text to be dismissed at the current TextReadingSpeed, and then it simply stops. Is this intended? Am I missing anything?
#6
General Discussion / DRM Discussion
Wed 22/09/2021 19:57:34
Quote from: Frodo on Wed 22/09/2021 19:19:46
That's a shame.   :cry:

Like I said, the game looks brilliant.  But since I don't support DRM, I won't be buying it from steam.

But I'll gladly give you my money when it's DRM-free. 

Can we please kill the misconception that Steam = DRM? Games on Steam only have DRM if the developer chooses to implement it (and I'm not even sure how/if you could do it for AGS). We released our game on Steam just yesterday, and it's completely DRM-free. You can copy the folder, move it somewhere else in your hard drive, or to another computer, and it will play perfectly without the client.

#7
IF ON A WINTER'S NIGHT, FOUR TRAVELERS

or

A tale of dark and troubling things

(A free point-and-click adventure anthology in four acts.)




THE SILENT ROOM

In a luxurious hotel room in Rome, freshly arrived from Turin, Carlo awaits for his lover Patrick to arrive. However, as the shadow of fascism looms ever larger, the tension of meeting in constant hiding is beginning to take its toll.





THE SLOW VANISHING OF LADY WINTERBOURNE

Lady Winterbourne has lost her husband in a tragic accident. Now letters from pretenders to her vast fortune keep arriving every day at her mansion, yet the only thing she's interested in is the bottle of laudanum in her cabinet.




THE NAMELESS RITUAL

Harassed, ridiculed and belittled by his peers, Dr. Jordan Samuels has resorted to the occult sciences in a desperate attempt to turn the tables on his tormentors. But is he truly ready to face the Guardian of the Threshold?




IF ON A WINTER'S NIGHT

As much as Laylah enjoys her job, sometimes she yearns for a bit of variety to distract her from her daily routine -- even if it means going against her very powerful bosses' orders.




BROUGHT TO YOU BY:



Laura Hunt: coding, writing, music, sound design.

Thomas Möhring: art, animations, cutscenes.


Additional music:

Spoiler
- Emanuel Salvador, 3 Old Viennese Dances - I. Liebesleid (Fritz Kreisler, 1910). Licensed under Creative Commons CC BY 3.0.

- Walter Scanlan, Always (Irving Berlin, 1925). Restored mp3 transfer of original recording licensed under Creative Commons BY-NC 2.5 by the University of California, Santa Barbara Library.

- Gnossiene No. 1 (Erik Satie, ca. 1890). Piano performance by Edward Rosser, from public domain recording. Harp performance arranged by Laura Hunt from MIDI file by unknown sequencer.

- Gerluz, Serenade for Strings Op. 22 - II. Menuetto (Antonin Dvorak, 1875).  Licensed under Creative Commons BY-NC-ND 3.0.

- Amelita Galli-Curci & Tito Schipa, Parigi, o cara (Giuseppe Verdi, 1853). Performance from 1924. Copyright status unknown, assumed to be public domain from the date of the recording.

- Mal Hallett and his Orchestra, My New York (Irving Berlin, 1927). Public domain recording.

-  Zephyrus Early Music Vocal Ensemble, Sanctus. Arranged by Sally Sanford and Paul Walker. Public domain recording.

- Jack Stillman & Orchestra, At peace with the world (Irving Berlin, 1926). Restored mp3 transfer of original recording licensed under Creative Commons BY-NC 2.5 by the University of California, Santa Barbara Library.

Additional sound effects from freesound.org and the BBC sound library.
[close]

Game testers: Kastchey, Sandra T. Almeida, Durq, Creamy, Ivan Mogilko, TheFrighter, heltenjon, Deabriel, Morgan Willcock, Darío, Racoon, Selmiak.

Very Special Thanks: Ivan Mogilko, Morgan Willcock, Érico Porto, Laura Topakian, Gunnar Harboe, Khris, Deabriel, Irene, Dida.



#8
Baffled by the lack of a "pause audio" function in AGS and the lack of any modules addressing this (as far as I know), I've decided to make a very simple module that provides pause and resume functionality for all currently playing audio, for example in case you want to pause everything that's playing when your Options/Pause menu comes up, and maybe play a different music piece while the menu is up, or whatever.

You can download it from here.

Usage is extremely simple, just use PauseAudio() to pause and ResumeAudio() to resume.

The only catch is that you need to set AudioPriority and RepeatStyle for each clip in the editor. So if for example you have a clip that you sometimes want to play looped and sometimes as a one-off, you'll need to import two copies of the same clip and set different attributes for each instance. Same if you want to change the priority of an audio clip.

I'm working on a more "robust" version that can actually store AudioPriority and RepeatStyle, for which you can find the (untested) code below, BUT the trade-off in this case would be that in order to play audio, you would have to use an extender function, CustomPlay, rather than the built-in Play function. Feel free to check out the code below if you want. If I find time to test it properly and it works, I could provide another variant of the module, or replace the previous one entirely.

Thanks a lot to Crimson Wizard for his infinite patience helping me figure this out!

Spoiler


Code: ags
struct ChannelAttributes {
    int channelvolume;
    int channelpanning;
    AudioClip * channelclip;
    int channelposition;
    int channelprio;
    int channelrepeat;
    int channelspeed;
};

ChannelAttributes runningchannel[8];  // if the maximum number of channels changes in the future, this will need to be updated


We also need a global bool:

Code: ags
bool isthisframeaudio = false;


This would be the extender/wrapping function that replaces the regular Play:

Code: ags
function CustomPlay(this AudioClip*, AudioPriority prio, RepeatStyle repeat)
{
    this.Play(prio, repeat);
    for (int i = 0; i < System.AudioChannelCount; i++) {
        AudioChannel* tempchannel = System.Audiochannels[i];
        if (tempchannel != null && tempchannel.PlayingClip == this) {
            runningchannel[i].channelprio = prio;
            runningchannel[i].channelrepeat = repeat;
            runningchannel[i].channelclip = this;
        }
    }
}


Pause and resume functions proper:

Code: ags
function PauseAudio() 
{
    for (int i = 0; i < System.AudioChannelCount; i++) {
        AudioChannel* tempchannel = System.Audiochannels[i];
        if (tempchannel != null && tempchannel.IsPlaying) {
          runningchannel[i].channelvolume = tempchannel.Volume;
          runningchannel[i].channelpanning = tempchannel.Panning;
          runningchannel[i].channelposition = tempchannel.Position;
          runningchannel[i].channelspeed = tempchannel.Speed;
         // here we check if the clip that is playing is the same one we played manually; if it's not, it's frame-linked audio
          if (tempchannel.PlayingClip != runningchannel[i].channelclip) isthisframeaudio = true;
          else isthisframeaudio = false;
          runningchannel[i].channelclip = tempchannel.PlayingClip;
          tempchannel.Stop();
        }
    }
}




Code: ags
function ResumeAudio() 
{
    for (int i = 0; i < System.AudioChannelCount; i++) {
        AudioChannel* tempchannel = System.Audiochannels[i];
        if (tempchannel != null) {
          AudioClip* tempclip = runningchannel[i].channelclip;
          // if the clip playing is frame-linked audio, we use the Play command with no attributes so the AudioPriority and RepeatStyle values set in the editor are used
          if (tempclip != null) {
            if (isthisframeaudio) tempchannel = tempclip.Play();
            else tempchannel = tempclip.Play(runningchannel[i].channelprio, runningchannel[i].channelrepeat);
          }
          tempchannel.Volume = runningchannel[i].channelvolume;
          tempchannel.Panning = runningchannel[i].channelpanning;
          tempchannel.Speed = runningchannel[i].channelspeed;
          tempchannel.Seek(runningchannel[i].channelposition);
        }
    }
}


[close]
#9
Let's say somebody wants me to proofread their game, so they create a new Translation (let's call it "RevisedText"), dump all their game text into the RevisedText.trs file, and they send it to me. I review the text, fix any mistakes I find, and send it back.

What would be the best way for them to now update their game text with the file I just sent them?

For the record, I tried a couple of approaches that don't seem to work:

- For starters, the translation file won't compile if there aren't any translated lines, so I need to insert a dummy "translated" line somewhere.

- Using Game.ChangeTranslation("RevisedText"); in game_start does nothing.

- Right-clicking on the RevisedText file in the project tree and choosing "Make default language" doesn't seem to work either.

So is there any actual way to more-or-less automate the whole process and re-import the revised text so that it replaces the original game text?

Thanks as always in advance!

(Note: this assumes for simplicity there is only one language, and that no actual translations are being used.)
#10
I would like to make some small suggestions that might hopefully bring some quality-of-life improvements to working with frame-linked audio:

1) Having some kind of visual indicator for frames with linked audio, like a simple dot above the frame, or an "x", or a music note symbol, or something of the sort, would make it so much easier to identify at a quick glance which frames have audio linked to them, something that can be a huge nuisance when you have views with a lot of long loops and you need to find that *one* frame with a specific audio clip.

2) More engine- than editor-related, but having the audioclip DefaultVolume property be accessible and modifiable by script would be incredibly useful; for example, to be able to easily do fading footsteps, among many other situations.

3) Maybe this one is a bit more complicated, but would it be possible to make it so that, when an animation is played in the preview panel, the frame-linked audioclips play too?
#11
Advanced Technical Forum / Overlay Z order?
Fri 28/08/2020 19:45:55
Hi all,

As mentioned in another thread, I have created a lantern effect using a GUI with a transparent "hole" in the middle.

When my player character speaks, his lines appear on top of this GUI, as expected. However, when I use SayBackground for another character, their lines appear under the GUI, making them illegible. I have also tried using Overlay.CreateTextual, but unfortunately, with the same results.

(Click below if you don't mind spoilers if you want to see what I mean).

Spoiler
[close]

My question, then, is obvious: is there any way to assign some Z-order of sorts to an overlay, or are overlays always drawn on the background? Is my only option to put this character's lines in a label on a second GUI with a higher Z-order than my lantern?
#12
I'm aware that this is such a random issue that maybe I won't get a solution, but I'm posting it anyway just in case somebody happens to have any galaxy-brain insights...

For context:

- In my game I have 1 channel reserved for Music, and 2 channels for Ambient audio. Since AGS automatically reserves channel 0 for speech, this means I have 4 channels left for other sounds (I don't use any Custom audio types).

- Because I made myself a very simple audio debugging GUI, I can always know which channels are playing audio, and what type of audio is playing.

ok, so in one room, I have a "Sound" type audio clip playing on an audiochannel I defined for this room script only:

Code: ags
Audiochannel* mrwilliams = aManCoughing.Play(eAudioPriorityNormal, eRepeat);


When I open my audio debug GUI, I see that this clip is playing on channel 4 and that all other channels are free.

Then, another sound gets triggered when a certain condition in repeatedly_execute_always() is met:

Code: ags
neighbours = aNeighboursArguing.Play(eAudioPriorityNormal, eOnce);


(the neighbours Audiochannel pointer was created through the Global Variables panel, because I need to do stuff with it in more than one room.)

And for some reason, sometimes (but only sometimes!) this clip decides to play on the same channel that the previous clip was playing, even when the audio debug GUI shows me clearly that there are three free slots and both sounds have the same eAudioPriorityNormal.

Anybody have any idea why this could be happening?
#13
My player character is in room 10 and I want to change to a different one in room 51 for testing purposes. If I do the following:

Code: ags
function hHotspot13_Interact()
{
  gBigBlackGUI.Transparency = 100;
  gBigBlackGUI.Visible = true;
  gBigBlackGUI.TweenTransparency(1.0, 0, eEaseLinearTween, eBlockTween);
  SetNextScreenTransition(eTransitionInstant);
  cTestCharacter.SetAsPlayer();
}


The GUI fades in, and then... nothing happens. The room change never takes place.

But if I do simply:

Code: ags
function hHotspot13_Interact()
{
  cTestCharacter.SetAsPlayer();
}


Then it works normally and I get sent to room 51 as expected. And of course, it also works if I do:

Code: ags
function hHotspot13_Interact()
{
  gBigBlackGUI.Transparency = 100;
  gBigBlackGUI.Visible = true;
  gBigBlackGUI.TweenTransparency(1.0, 0, eEaseLinearTween, eBlockTween);
  SetNextScreenTransition(eTransitionInstant);
  player.ChangeRoom(51, 348, 217, eDirectionLeft);
}


I have no idea what could be making a GUI block a room change, and furthermore, only when I use SetAsPlayer. Any insights? ???
#14
I've been obsessively listening to Gazpacho's "Demon" (seriously, what kind of band name is that) these last couple of weeks and for some reason, while the rest of their discography just doesn't stick with me, this album blows my mind. This got me thinking of some other albums I love even though I don't care at all for the rest of the band's/artist's output.

For example:

- The Gathering, Nighttime Birds. Their music has always sounded kind of bland to me, like they don't know if they want to be metal or pop or who knows, but this album is just one glorious earworm after another, and Anneke van Giersbergen's vocals are intense af.

- Bruce Springsteen, Nebraska. I've always been quite indifferent to "The Boss" save for the odd song here and there, but the bleakness and starkness of this album make it one of a kind.

- Slipknot, Iowa. Unfuckwithable.

- Massive Attack, Mezzanine. Blue Lines and Protection are patchy at best, 100th Window sounds like a collection of uninspired Mezzanine B-sides, and Heligoland is... ok, but it's too poppy and not dark enough for me.

What are some of your "lightning in a bottle" moments of bands you otherwise don't care for?
#15
Like the subject says, I want to trigger an event at a certain point of an audio clip (in this specific case, at the very end). I thought it would be simple enough and that this would do the job:

Code: ags
function room_RepExec()
{
  if (neighborsarguing != null && neighborsarguing.PlayingClip == aNeighbors3 && neighborsarguing.PositionMs == neighborsarguing.LengthMs) {    
    player.Think("I should have some peace and quiet now... at least for a while.");
  }    
}


However, it doesn't seem to be working, as the player's line never gets triggered. I've also tried triggering it at other positions that are not exactly the end of the clip (e.g., neighborsarguing.LengthMs - 1000), but no success either. What could I be doing wrong?

(P.S.: the audio clip is an .ogg file.)
#16
General Discussion / Learning Python
Sat 30/05/2020 09:21:20
Hi everybody.

I'm thinking of dipping my toes in the fantabulous world of Python, but there are so many online tutorials, courses, introductions and books out there that I'm overwhelmed by choice and don't even know where to start.

Could anybody recommend a good starting point? I'm a very hands-on learner, so I would definitely prefer tutorials that give you stuff to do with what you've learned.

In case this helps, I would like to focus eventually (when and if I achieve certain proficiency) on QA testing automation. I guess this is not really relevant right now that I'm just starting off, but maybe it can help determine what I should focus on the most.

Thanks in advance! :)

EDIT: Couple more questions: Python 2 or 3? And which IDE would be best to start with?
#17
Hey all,

My situation is the following:

- My game has its Main Menu in Room 1.

- I have a Pause Menu with, among others, a "Back to Main Menu" button.

- When you click on this button, you get a warning saying "Save progress?" and two buttons for Yes and No. Clicking on any of these buttons takes you to Room 1.

I have no idea, however, how to save the game before changing to room 1. Since SaveGameSlot is always executed at the end of the script, the room change will take place before that, and the Save command will never get executed.

Any hints? Is this even possible? ???



#18
Hey everybody,

Acts I and II of our upcoming Very Mysterious Narrative Anthology Adventure, If On A Winter's Night, Four Travelers, are finished and ready to play, and we would love to have some volunteers give them a spin!

We're looking for feedback related to:

- Bugs. Game breaking bugs, NPEs, audio glitches, soft locks, etc. I have QA'd and played through both chapters like 1,847,493 times and I'm, like, 99.9999% confident there are no such bugs, but as we all know, as soon as you give your game to somebody else, in five minutes they'll be like "so I got stuck behind a plant...", so it never hurts to check :D

- General gameplay. Are the puzzles/tasks solvable, or are they obtuse? Do you know what you're supposed to do in every moment, or do you find yourself walking around and pixel hunting, searching for a clue as to what you need to do next? This is the kind of stuff that's super hard to judge when you're the one who's designed it, so actual players' impressions would help a lot here.

The game is still missing a main menu, save system, cutscenes, intro, interludes, etc etc (and the Esc/Pause menu is just an ugly grey box with Quit, Cancel and a Volume slider xD), so basically you just get a plain chapter selection screen, with no other bells, whistles, or context.

Act I (The Silent Room) should take about 15-20 minutes to complete, and Act II (The Slow Vanishing of Lady Winterbourne) around 30-40 minutes. The full game will be released for free, so offering a copy for your effort is not really an option, but your name will of course go in the credits and the AGS database, as a little "thank you" :)

If you're interested, shoot me a message and I'll send you a Wetransfer link!

#19
Hey all,

Apologies in advance for throwing three issues into a single post, but since two of them are pretty short questions and they're all kind of related, I thought I would save time this way.

1) How do I properly check for null pointers?

For example, let's say I have this in room 2 of my game (tickingclock has already been defined through the global variables panel):

Code: ags
tickingclock = aClock.Play(eAudioPriorityNormal, eRepeat);
tickingclock.Volume = 50;


And this in room_load() in room 3:

Code: ags
if (tickingclock != null) tickingclock.Volume = 10;


I still get an NPE if tickingclock has not been initialized (for example, if I teleport from room 1 directly to room 3 via the debug key combo Ctrl+x). Is this not the correct way to check if an audiochannel is null? I seem to recall I've done it this way before and it worked ???


2) This section of the manual confuses me (talking about the Play command):

QuoteThis command searches through all the available audio channels to find one that is available for this type of audio. If no spare channels are found, it will try to find one that is playing a clip with a lower or equal priority, and interrupt it to replace it with this new sound.

So if I have reserved 2 max channels for "Ambient sound" audiotype clips and I do this (again, assuming myatmo1, myatmo2 etc are defined in the global variables panel and all these audio clips are "Ambient sound" types):

Code: ags
myatmo1 = aAtmos1.Play(eAudioPriorityHigh, eRepeat);
myatmo2 = aAtmos2.Play(eAudioPriorityHigh, eRepeat);


And later in the game I do this:

Code: ags
myatmo3 = aAtmos3.Play(eAudioPriorityNormal, eRepeat);


I would expect for aAtmos3 not to play at all, since the two slots for ambient sounds are already occupied and both have a higher priority. However, what I gather from the quote above is that AGS will simply look for another empty slot and play it there. Am I reading this correctly? Doesn't this defeat the purpose of limiting the amount of clips of a certain type that can be played simultaneously?


3) Creating an audio debug GUI

In order to help me sort out these issues, I'm trying to create a simple GUI that I can bring up with a key (say, F2) which will display which clip, if any, is playing in each of AGS' audio buses. So I would simply have 8 labels saying "Channel 0", "Channel 1", etc, and next to each, a label that would be populated with either the name of the clip (aAtmo1, aMusicTrack, aClock, etc) or "Nothing" if there's nothing playing.

But I'm totally lost, as I have no idea how I would get the audio clip that's playing on each channel and then display its name in the label. I tried this (in my global script's repeatedly_execute_always)

Code: ags
if (gAudioDebugUI.Visible) {
  for (int i = 0; i < 8; i++) {
      if (System.AudioChannels[i].PlayingClip == null) gAudioDebugUI.Controls[i+8].Text = "Nothing";
      else gAudioDebugUI.Controls[i+8].Text = System.AudioChannels[i].PlayingClip;  // (using "i+8" because the relevant label indexes go from 8 to 15)
  }
}


...but I'm getting a "GlobalScript.asc(249): Error (line 249): must have an instance of the struct to access a non-static member" error. What am I doing wrong?

Thanks in advance for any tips you can give me!


EDIT: I found this post by Snarky in which he does something similar, and apparently it's not possible to get the name of an audio clip? If that's the case then... I guess what I want to do is simply not possible? (I have several dozen audio clips in my game, I'm not going to index them one by one like Snarky does in this example.)
#20
Hey all.

I have a sound (e.g., aSound) that I want to use in two different animations, triggering it from a specific frame. From what I gather, the volume this sound will play at when it's triggered will be the DefaultVolume value I've set in the audio clip's Properties panel.

My problem is that when animation 1 runs, there is very little background noise, so aSound is perfectly audible, but when animation 2 runs, there is music and other stuff playing, so aSound kind of gets lost in the background and I would need to increase its volume a bit.

My question is: is there a way to change the volume of a frame-linked audio clip when it's triggered, or would my only solution be to create two copies of aSound, each with its own DefaultVolume?

In other words, is it possible to modify an audio clip's DefaultVolume property from script?


Edit: I also know I could work around this by creating an audiochannel on the fly and doing something like this, but if there's a less convoluted way, of course I'd love to hear about it:

Code: ags
oMyObject.Animate(0, 6, eOnce, eNoBlock);  // make the animation non-blocking so I can insert stuff while it's running
while (oMyObject.Frame < 15) Wait (1);  // frame in which I want the sound to trigger
Audiochannel *tempsound = aSound.Play(eAudioPriorityNormal, eOnce);
tempsound.Volume = 40;
while (oMyObject.Frame < 30) Wait (1); // last frame of the animation

SMF spam blocked by CleanTalk