Tumbleweed ~ default door sounds | [SOLVED]

Started by Nahuel, Wed 31/08/2022 12:50:54

Previous topic - Next topic

Nahuel

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

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

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
Life isn't a game. Let's develop a life-like-game.

Khris

Go to the  game_start  function in the VerbGUI script (VerbGui.asc).

In there, append lines like
Code: ags
  verbsData.openDoorSound = aMyCustomOpenDoorSound;

etc.

Nahuel

Appreciate your help Khris. That was exactly what I wanted to do. Thread can be closed.
Life isn't a game. Let's develop a life-like-game.

SMF spam blocked by CleanTalk