Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Best on Tue 14/09/2004 22:08:09

Title: Two probs solved - now THIRD ONE
Post by: Best on Tue 14/09/2004 22:08:09
I want to ask you this: I want to play a sound, but just sometimes. Do I have to use timer? And how? For example there is a forest and I want to use one sound (bird) just ocasionaly (FE: every 30 seconds).
And one more question: If I have the name of my game XXX and I want to rename it to YYY, will it change anything? I do not mean the  name in Global Settings, but the name of the compiled file, which also show up when I want to edit the game (in load game at the startup of AGS). Hope its not too chaotic. And one more ques:f) I have my own GUI inventory and the items are just jumbled up on one place. How do I do that so they are separated in the inventory?
Thanx alottttttt!
Title: Re: enable dialog option
Post by: Skio on Tue 14/09/2004 22:18:59
In the first dialog, put under the dialog option which will enable the option in EGO2 the command:
    run-script 1

In the dialogue_request function in the global script (create it if you haven't already - check the HELP) put:
    if (var==1) SetDialogueOption(EGO2 dialogue, option, 1)

Title: Re: GUIs - sound
Post by: Albert Cuandero on Thu 16/09/2004 19:52:53
The command is surprisingly: PlaySound (int sound_number)Ã,  ;)

to play on click just set your button to "run script" then edit script to):

if (inerface == 0) {Ã, 
Ã,  if ( button == 0) {
Ã,  do_something ();
Ã,  PlaySound (0);
Ã,  }
}

to play on hovering I wouldÃ,  have to look up (guess whereÃ,  ;))


Ã, 
Title: Re: Two probs solved - now THIRD ONE
Post by: Best on Fri 17/09/2004 14:39:40
THANX !
Title: Re: Two probs solved - now THIRD ONE
Post by: Radiant on Fri 17/09/2004 18:15:44
Renaming the executable would invalidate any existing saved games, as well as the associated SETUP.EXE file, but other than that there are no problems.

As to your inventory question, look under game. variables in the help, there's something like inv_item_size that should help.
Title: Re: Two probs solved - now THIRD ONE
Post by: Scorpiorus on Fri 17/09/2004 20:09:09
Quote from: Radiant on Fri 17/09/2004 18:15:44Renaming the executable would invalidate any existing saved games, as well as the associated SETUP.EXE file, but other than that there are no problems.
Yep, so to rename your game you have to rename its folder name and recompile.

QuoteAs to your inventory question, look under game. variables in the help, there's something like inv_item_size that should help.
Also take a look at the SetInvDimenstions command in the manual.
Title: Re: Two probs solved - now THIRD ONE
Post by: Best on Sun 19/09/2004 15:48:39
Thanx guys and whatta bout tha sound repeating?
Title: Re: Two probs solved - now THIRD ONE
Post by: Radiant on Mon 20/09/2004 12:30:26
Put 'SetTimer (1, 1200)' in the enter_room script.
Then, in repeatedly_execute, add
if (IsTimerExpired (1)) { PlaySound (42); SetTimer (1, 1200); }

There are a bunch of other methods but this should work. 1200 = 30 * 40, since you wanted 30 seconds and there's 40 frames to a second on the default speed setting.
Title: Re: Two probs solved - now THIRD ONE
Post by: Best on Mon 20/09/2004 21:16:24
Thankye
Title: Re: Two probs solved - now THIRD ONE
Post by: Raider on Tue 21/09/2004 03:12:47
um I'm no moderator, but watch the spelling and spell words properly.
(I used to spell words like texting but got told to spell properly). I sound bossy now but I don't mean to, just trying to help.  :-[

- Raider