Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Nahuel on Wed 31/08/2022 12:50:54

Title: Tumbleweed ~ default door sounds | [SOLVED]
Post by: Nahuel on Wed 31/08/2022 12:50:54
Hi there, I'm trying to get default sound to the code using default sound for doors.

I see there's default values but I don't get it where I need to change that.

Code (ags) Select

    // Default door sounds
    AudioClip*  openDoorSound,
                closeDoorSound,
                unlockDoorSound;


I've already created those sounds with script names and the only way that I could use those sounds is inside AnyClickSpecial to set the value to the particular sound.
I don't know if I'm doing it incorrectly.

Code (ags) Select

static int Doors::AnyClickSpecial(int door_id, int obj, int x, int y, CharacterDirection dir, int nr_room, int nr_x, int nr_y, CharacterDirection nr_dir, AudioClip *opensound, AudioClip *closesound, int key, int closevalue) {
  // key = -1: masterkey - even locked doors will be opened
  // key = -2: door can't be unlocked (like rusted)
  AudioChannel *chan;
  int result=1;
 
  verbsData.openDoorSound = openDoorSound;
  verbsData.closeDoorSound = closeDoorSound;
  verbsData.unlockDoorSound = unlockDoorSound;


Any help is welcome.

Thanks all
Title: Re: Tumbleweed ~ default door sounds
Post by: Khris on Wed 31/08/2022 13:16:41
Go to the  game_start  function in the VerbGUI script (VerbGui.asc).

In there, append lines like
Code (ags) Select
  verbsData.openDoorSound = aMyCustomOpenDoorSound;
etc.
Title: Re: Tumbleweed ~ default door sounds
Post by: Nahuel on Wed 31/08/2022 13:27:48
Appreciate your help Khris. That was exactly what I wanted to do. Thread can be closed.