2 beginner's questions (one "important" *g*)

Started by , Wed 07/04/2004 00:39:06

Previous topic - Next topic

Woof!

I've actually have two problems testing to create our (a group of 2 graphic "freaks", 2 designers+testers, and me as "coder")  first game with AGP:

1st) the more important one: How the hell do I create a sound.vox file?! I can rebuild as much as I want, nothing is seen in the game folder. (A sound0.wav does exist)

2nd) I'd like to add an effect like in many lucas games, that screen fades out, a message like "Hours later..." appears for a while and then the screen fades back in. It's no problem to fade it in and out with the corresponding script commands, but if I add a displaymessage (or similar), the screen is fully shown again. Not even the raw-commands could solve the problem completely, because all objects in the room are visible during the mesage is displayed.
As the visible objects in the room have a wide variety and depending on several events happened or not (the same for 2 other characters), I don't like to ask for every special event happened or not (I would drown in if's, though...), *please* tell me, that there is an easier way! :-)

Please excuse my english, I'm german and left school 17 years ago... :-)

Scummbuddy

youre english is darn pretty good.  ;D

2) have it be a fade out to another room, on that room, display an object, a text object that you'll create in, say, adobe photoshop, or some program, and when youre done displaying it for a few seconds, fade back out, and return to the other room.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

ElectricMonk

Quote
1st) the more important one: How the hell do I create a sound.vox file?! I can rebuild as much as I want, nothing is seen in the game folder. (A sound0.wav does exist)

I think the number 0 is not recognized by AGS. "0" means no sound is played.
Your first sound file should be named "sound1.wav".

Quote
Please excuse my english, I'm german and left school 17 years ago... :-)

Kein Problem, zur Not kann ich Dir das Zeug auch per Privat-Message auf Deutsch erklären ;D

Ginny

#3
1) I dunno about 0, but I think it should be allowed. The music.vox file however is in the Compiled folder afaik. Check there. Does the music play in the game?

2) Yes, use a room for all your messages of this sort (with an overlay or an object for the text), and you can create a custom FadeIn function for the object (and possibly the overlay?) using SetObjectTransparency. I dunno where I put my custom function, otherwise I'd post it, but I'm sure you'll figure it out. :)
Try Not to Breathe - coming sooner or later!

We may have years, we may have hours, but sooner or later, we push up flowers. - Membrillo, Grim Fandango coroner

Scorpiorus

Quote from: Woof! on Wed 07/04/2004 00:39:061st) the more important one: How the hell do I create a sound.vox file?! I can rebuild as much as I want, nothing is seen in the game folder. (A sound0.wav does exist)
Afair, the sound files are attached to the game .exe file and there is no a separate sound.vox in the compiled folder.

Basically AGS sorts them as follows:
Sound  : included into game.exe
Speech : speech.vox (optional speech pack)
Music  :
         MIDI/MOD/XM/S3M included into game.exe
         WAV/MP3/OGG a separate music.vox (optional music pack)


Just make sure you can hear the sound playing.

~Cheers

Dusty D.

First of all thx for your fast and qualified replies! I'm overwhelmed :)

Nevertheless, the problems still exist, so I think, I have to go a little bit more into detail:

Concerning question #1, I (surely) tried already with sound1.wav as I thought 0 might have a "special" meaning (although my tutorial says, -1 is to stop a sound). I get a warning "(in room 2): Sound sample load failure: cannot load sound 1" - whatever I try, when the script reaches the PlaySound() command. Up to now the game has no other sounds except an mp3-file which is played with the PlayMP3file (and works fine).

@ q#2:
Loading a new room also doesn't solve the problem, because AGS quits with an error message, if I try, saying that changing the room within a script is not possible (and that's exactly what the tutorial says).

Any other ideas/suggestions?!


PS: I just registered here and decided to use the nick I use in other forums also... I just used "Woof" yesterday, because the scene I'm now hanging is a scene with dog *gg*. I now will be "Dusty D.".

ElectricMonk

Quote
@ q#2:
Loading a new room also doesn't solve the problem, because AGS quits with an error message, if I try, saying that changing the room within a script is not possible (and that's exactly what the tutorial says).

Could you give us the script and the exact error message?
NewRoom(<insert room number here>);
should work perfectly fine within a script.

Gilbert

g1:
Check whether your windows' explorer is set to "hide known file extensions", if this checkbox is checked and you see the file as "sound1.wav" in the explorer, its actual name is "sound1.wav.wav", in that case remove the ".wav" part of it and retry. Check also that the file is INDEED a sound file in WAVE format. If none of the above works, try also throwing the sound file into the compiled folder and see if it plays.

q2:
Where did you put that NewRoom()? if it's in "Player enters screen before fade-in" it's not allowed.

Dusty D.

@Q1: I'm still trying and will report, but it's definitely not a problem with the file extensions (I'm familiar with that).

@Q2: After reading more carefully (sorry *g*) I noticed that the problem is, that I have to change the room TWICE in the script, what is not supported by AGS. The script looks like this at the moment:

if (geschlafen<3) {
 if (KnastAuf==0) MoveCharacterBlocking(0,360,140,1);
 [...]
 FadeOut(3);
 NewRoomEx(3,0,0);
 WaitKey(40);
 NewRoomEx(1,360,140);
 FadeIn(3);
 MoveCharacterBlocking(0,300,145,1);
 }

where "room 3" is the message to be displayed. There are some more IF's in the [...] section, that make it pretty complicated to devide the whole thing into two scripts. In addition, the script continues afterwards... Also, in the "real" script I added RawSave/RestoreScreen commands (just in case... *g*)

From tomorrow 'til monday night we have a "developper's meeting" with the persons included in the project. Nevertheless I will have a look in here from time to time to see if you kind guys can help me bringing the game to success and I'm already looking forward to presentate it to you all (will be freeware, for sure).

Let me say, that we already have a lot of fun using AGS! All in all it's pretty simple - I just have to become more familiar with it (the last time I coded an adventure game was in 1990 and completely "hand made" using TB *gg*).

Scorpiorus

#9
Quote from: Dusty D. on Thu 08/04/2004 19:21:56@Q1: I'm still trying and will report, but it's definitely not a problem with the file extensions (I'm familiar with that).
Then it's worth, as Gilbert mentioned, to check if AGS understands that wav at all.
Also try renaming it to music1.wav and then PlayMusic(1) in the script. Btw, music.vox should be builded in that case.
In case all above won't help what if you try to play another wav file?

Quote
@Q2: After reading more carefully (sorry *g*) I noticed that the problem is, that I have to change the room TWICE in the script, what is not supported by AGS.
You'd have to call NewRoom(3) then return;. Put WaitKey() on player enters room 3, next call NewRoom(1). etc.

But what if you create a totally black fullscreen GUI and put a label saying "Hours later...":

if (geschlafen<3) {
if (KnastAuf==0) MoveCharacterBlocking(0,360,140,1);
[...]

FadeOut(3);
GUIOn(GUIBLACK);
Wait(1); // just updating the screen to show a GUI
FadeIn(3);

WaitKey(40);

FadeOut(3);
GUIOff(GUIBLACK);
Wait(1);
FadeIn(3);
MoveCharacterBlocking(0,300,145,1);
}

Akumayo

1.) sound1 should be called SOUND1 by what i've found
"Power is not a means - it is an end."

Phemar

Right, for #2, I had a similar problem with a game I never released.

Your code should look something like this:

 FadeOut (10);
 Wait (40);
 SetObjectGraphic (0,41);
 SetObjectGraphic (1,41);
 SetObjectGraphic (2,41);
 SetObjectGraphic (3,41);
 SetObjectGraphic (4,41);
 SetCharacterView (ZOR, 3);
 SetBackgroundFrame(1);
 Display ("Hours later...");
 SetBackgroundFrame(0);
 SetObjectGraphic (0,36);
 SetObjectGraphic (1,33);
 SetObjectGraphic (2,37);
 SetObjectGraphic (3,38);
 SetObjectGraphic (4,39);
 ReleaseCharacterView (ZOR);
 FadeIn (10);
 Wait (40);

All the SetObjectGraphics sets all the objects to a black sprite (sprite #41 is that sprite) and then the second time it comes around it sets it back to it's original sprite. ZOR is the player CHAR, and N.B. At the Player Enters Screen command, put SetBackgroundFrame (0);, and create another BG frame which is totally black. THERE YOU HAVE IT! Should be bug free.

As for #2:

QuoteSound  : included into game.exeSpeech : speech.vox (optional speech pack)Music  :         MIDI/MOD/XM/S3M included into game.exe         WAV/MP3/OGG a separate music.vox (optional music pack)

I think that pretty much wraps it up!

Dusty D.

Okay... thank you guys for all your help. I'm just returning from a 4 days "developper meeting" and we made pretty good progress with the game (at least we think so!).

The sound problem is solved - for what reason ever AGS is not able to import that sound file. Other waves work fine, so don't care about it any more. The "hours later" problem still exist.

The idea Zor brought up I already had by myself, but as I wrote in my first or second posting in this thread there are too many conditions in that room, that make it almost impossible to do it this way. With the GUIs I haven't worked at all up to know (the game uses the default GUI at the moment). However, I will check it out and tell you.

SMF spam blocked by CleanTalk