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

Messages - kyodai

#1
Actually not impossibly hard to do. You will need to work with loads of variables, as you already found out yourself, you will need to add checks against tehse variables in your code to see if some announcement has become invalid, i.e. your passengeronfire=true.
Also you'd need to check against the current room of the player if you wanna use that information to direct playback as well. I would not put too much work into the logic to "only play when no other sound is playing". Just give it a channel with low piority and you should be fine. If you hear character footsteps while the announcement is playing i'd think it only adds to the realism. In the end the work depends a bit on how many announcements and variables you use, but with like 20 of them i still think you could be done in an hour or 2, most work will just be writing down all if....then conditions for all variables.


Mixed bitrates are no problem for AGS and while i already learned from khris that the image size does not affect game size i believe that the ogg files do matter.
#2
For your images - check their size. If you convert them to jpeg with a tool like GIMP you can chose the compression rate and thus dramatically reduce file size. For music try to use midi instead of wave or so. If you have to use wave sounds then try to reduce the quality. For my games the wave music and sounds took up most space. Just reducing the game colors from 32bit to 16 bit will not do anything - you need to reduce your images and sprites color to 16bit before you import them into AGS.
#3
I suggest reading the chapter "sound effects" in the manual. Let me quote just a short paragraph:

"AGS currently has an 8-channel audio system, which means that up to 8 sounds can be playing at the same time. With the default Audio Types settings, one channel is reserved for speech, one for music and one for ambient sounds; thus leaving 5 available for sound effects.

If you try to play an audio clip and there are no channels available, then an existing one will be stopped and the new one will take its place. However, this will only happen if the new audio clip has an equal or higher priority than one of the currently playing sounds.

"


There is also a seperate paragraph about how to define chanels. Also make sure the maxchannels property is not lower than the number of files you want to play simultaneously.
#4
Okay, i managed to "fix" my bad midi files, so i thought i would post a little tutorial here if anyone else has the problem, at least unless that "bug" (???) in AGS gets fixed. I call it "bug" as the midi file plays fine in several players.


OK so here is what i did:

1. Use the command line app "midi2txt" to make a text file out of your bad midi
2. Edit the text file. Pretty much on top you see something like "unit -7681" or so. That cause it to not work. I had to set unit to 30 to have the file being at the correct speed. If your resulting midi is too slow or fast then its this parameter.
3. run txt2midi and BANG you have a midi file that works in AGS




Heres a zip with a "bad" midi file, the tools and output files.



http://www.tankraider.com/userup/1333432003.zip



In the end the "good" and the "bad" midi files just differ a few characters, but what counts is that i now have a midi that plays fine in AGS. Dun ask me what the actual problem is with the "bad" ones, i got NO idea. But this is how you fix it.
#5
Ah yeah, here is the midi file:

http://www.tankraider.com/userup/1333431433.zip


Actually all midi files i ripped from Space Quest 6 suffer from that problem. I even tried the Roger Whistling which is just 1 1KB midi, around 15 seconds long and all other files i tried have the same problem as well.

I used SCIViewer to rip these - mainly because it's the only tool that i had luck with using the Sierra VGA games.

I experiemented a bit with the midis, i downloaded converters that convert Midi 0 to Midi 1, i tried to add a copyright comment (Had hoped that this was the "null" problem), i tried midi repair tools, but all without success. The midi files play well in Windows media player and VLC (Have to pick a sound font in VLC first as with all midi files) but they all get AGS to cough on them.

I have tried some random midis i downloaded from the web, like the zelda tune and stuff and these work well in AGS. Its just the ones ripped with SCIViewer that AGS hates.
#6
Ah Khris to the rescue! Excellent info as usual. Took me a moment to find the setting, but in my around 60 frames there were indeed 2 of them that included the sound setting. I imported the view so i did not check it much, but now i think the original view was referencing to sound "1" and as the midi was the first sound i imported the midi was obviously sound number 1, so i think that is solved. Thanks so much!!!!!

Why the midi file is not compatible with AGS is till a riddle to me personally. I don't really know much about midis. It plays fine in windows media player, but in AGS it results in a "divide by zero" error on preview and in weird glitched sound when played in game. I have read that there are at least 2 midi types. It seems midi type 0 is some super old standard from stone age and that most more recent midis are probably Type 1, maybe that is the problem? Would be cool if i could use the midis in my game, so i hope there is a way to convert them into some type (well NOT wave, hopefully) that allows usage in AGS. I have seen many AGS games use midi without problems, so hopefully there is a way.
#7
Okay i fixed it myself, but it seems this is a little bug in AGS 3.2 i think.

What actually fixed everything was removing the "dead" midi file. Although it is not used in any scripts (I also got no warning as it should appear when you delete an item used by scripts) deleting the midi from my "Music" tree in AGS fixed everything. A bit weird. SO lesson learned: Kids if you have bad midi files then get rid of them or they start haunting you. ;)



If someone is interested in the problem with the midi file - i have uploaded it for reference.


http://www.tankraider.com/userup/1333431433.zip



To reproduce the errors just add it to your "music" tree in AGS and try a preview or play it somewhere in the game.
If anyone knows how to fix this i would still be interested as WAVE files are considerably larger, so not the coolest workaround ever.
Also i would be interested why it affects the game even when the audio is not played or referenced in any scripts, i thought that should not happen.
#8
OK my first fight was with a midi file that i ripped from Space Quest 6. Imported it into AGS and on preview AGS practically crashed (Actually it came up with an error message but you could not get rid of it as the message constantly re-appears, so killing the task was the only way...). Okay i thought maybe its just the preview and played it in a room without fumbling around in the preview - that only resulted in weird glitched glibberish coming from the speakers.


Okay i thought - maybe bad midi. So i fixed the problem using a WAVE file as the music which works actually fine.

Now what I am doing is using room 1 as my intro screen (Also startup screen of my character), added a nice intro GUI to select "New", "load", quit", which works pretty well.

On New i just beam my character to room 2 which works fine.

The weird thing is that as soon as the character starts walking some weird glitched sounds come from my speaker.

I was a bit surprised as i stop the sound upon clicking "new", but i thought maybe its related to the intro sound. As a cross check i edited out the whole intro music but still i get the weird sound as soon as i walk around.


The funny thing is i had no problems while walking around in my original room 1 (Which was just a playground for testing before i made it my intro screen).


I searched a bit for stuff like "AGS sound glitch" "AGS weird sound" and so on, but no usable results so far. Does anyone have a clue what I am doing wrong?
#9
You could also make the bullet an object or character as you already realized.

Or if ya wanna make it realistic don't draw the bullet at all - because in reality bullets are so fast ya can't see them anyways.
#10
Ah Khris, you're a genius!

Actually i had a similar problem and used a room that was simply a copy of the original room with the picture painted on top. Obviously way too much work if you have loads of rooms, khris' solution is much better.


On a side note - i fumbled a lot with my starting screen which was a similar problem, but as it is actually a 60 frame fullscreen animation (640x480) i ran into the problem that a room animation can only be 4 frames at max.

So what i did was making a view with 60 frame ani and just carefully centered an invisible object in a dummy room that i called the view upon. It works for my title screen, but i wonder if there was a more intelligent workaround than mine.
#11
I have had that as well, in my case it were pixels that were "white" which i had used as transparency, but on close inspection they were not perfect white, just a few shades off, not really visible to the human eye. What i did was using the filling tool to fill the "white/nearly white" areas with a "perfect" white in gimp.
#12
Ahhhh omg, now i realized the capital "S" in String did the trick. That's really a good trap for beginners. XD

I was missing the string name in the import and i just wrote string lowercase. I was not aware that AGS makes a difference between uppercase/lowercase.


Now it's working as i expected it. Thanks to both of you!
#13
Quote from: Khris on Thu 22/03/2012 19:17:08
Code: ags
import function TextOut(string myText);


You're wondering why you have to import stuff from _another_ script...?


Yeah, i fell for the "suggestive" term "Global script". I thought "Global" equals to "accessible from everywhere, yay". I dun get why you have to import it into a header first.

But anyways, i dun wanna discuss about that, it is at it is. I accept that. Maybe if i was a C++ programmer i would understand it, but alas from a VB6 point of view i was indeed surprised.



Anyways, i really just wanna be able to call my function from all room scripts. The manual states that you just have to import the function into the global header. SO whats the trick with the "const string" to "string" conversion?
#14
OK, so what i wanted to do seems to be fairly easy, make a global function for my Text output to be displayed in a textbox in my GUI, to have a neat way of calling it.


So i go to GlobalScript.asc, place my function which looks like this:

Code: ags

function TextOut(string myText) 
{
  txtMainGUI.Text = myText;
}




So after a while when trying to call it i noticed the global script is "not so global" as my room script cant find the function in the global script. After reading a bit i see i have to "import" it in the header. God knows why. Anyways, so I am trying the import im my Globalscrip.ash.


Code: ags


import function TextOut (string);




And now i get the error "Error (line 80): Type mismatch: cannot convert 'const string' to 'string'"



Damn it, where did i say const? Can it really be so hard? I am out of ideas. I hope some gurus can enlighten me how to just make a simple global function. It should be very easy, but although i can program a bit VB6 and .net I am biting in my keyboard here.

#15
I am currently trying to port the Space Quest 6 GUI to AGS 3.2.

One thing that is really bothering me is the font. I was able to import the original SQ6 font which looks really neat, but I am unable to scale it in any way. Is there a trick to scale imported "non truetype" fonts? I am just not so experienced with fonts.

I guess the only workaround i can think of now is to paint each Button in photoshop and put the text there instead using the TEXT property of the button in AGS. Has anyone run into this? Any alternate ideas on this?
#16
I have already spent hours trying to get this looking neat. I followed the help file and created a new Text Window in my GUI tree. I managed to find out the correct text number (1536), also i edited the general settings to use my new Text Window for text Output.

The reason is that i have a part for Text in my GUI that i would like to use for the main text output with a Space Quest 6 alike GUI. So far i worked with "Display At", but i thought a Text Window would be what i need. However, i can't find a way to scale it and set the font, it always appears on the middle of the screen with "Display()".


So can a Text  Window be alligned and the font changed?


Or am I using the totally wrong function for this? I am getting a feeling that Text window is not what i am looking for...


Ideally i would want to have a text box on the bottom, integrated in my GUI that catches all standard text or comes with a function similar to "display" or "DisplayAt", that would be very convenient. Like in Space Quest 6 i would also love to have a vertical scrollbar and have the text be "non blocking". I am sure this is technically possible, but so far I am just not so experienced with AGS 3. Is a vertical scrolling textbox possible? Or could a Listbox be abused for that?



On another side note - I am having problems with the font anti-aliasing. If i use anti-aliasing then my DisplayAt font looks very nice but the text of my buttons disappears. Is that a bug or is there some reason i haven't found out yet?
SMF spam blocked by CleanTalk