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

#1
Thanks for the suggestion SilverWizard, but I am using the code in a module and it will be very ugly to use a character to do that, plus i don't know if it will work.

There is an easier and a tad less ugly workaround for this that uses only the module code.

function b() {
      ... some stuff before c ...
      c();
      ... some stuff after c ...
}

function c() {
      ... some stuff before b ...
       b();
      ... some stuff after b ...
}


can be done like this:

function stuffbeforeb()
{
      ... some stuff before b ...
}

function stuffafterb()
{
     ... some stuff after b ...
}


function b() {
      ... some stuff before c ...

       stuffbeforeb(); \
       b();                }   This simulates function c()
       stuffafterb()    /

      ... some stuff after c ...
}

function c() {
       stuffbeforeb();
       b();
       stuffafterb()
}


This way it works and the code duplication is reduced to a minimum.

And I did a check and recursive functions (functions that call themseves) work just fine in AGS.

Mishel.
#2
I didn't understand your last sentence but this may help.

PlayVideo function from the Manual:
http://www.adventuregamestudio.co.uk/manual/PlayVideo.htm
#3
it works for me also in the repeatedly_execute function with an Esc button hiding pop up gui and space bar showing and hiding pause gui.
#4
Well, KhrisMUC,
when the code file gets large, optical reasons are really not that weird. I have several structs to gather my functions in groups that handle different dialogs. I don't want the functions scattered around all over the file.
This is a standard issue in any programming language so the weird things is NOT being able to do that.

I have a workaround for my specific situation, I just asked a general question, in case there is a way to define the function before actually declaring it.

I guess recursion is out of the question :-)
I know, I am spoiled.

Thanks,
Mishel.
#5
Hi,

I have a module in which a few functions call each other:

function A()
{
   ...
}

function B()
{
   ...
   C();
   ...
}

function C()
{
   ...
   A();
   ...
}

Now AGS tells me that it doesn't know function C() from the code of function B(). There is an import in the header but it hasn't stummbled upon the function itself.
I know that if I switch the places of function B and C the problem will be solved but I want to keep this order. Can I?
I know that in C or C++ I can just declare the function at the top and use it everywhere I want.
Can I do this in AGS?

And is there a way to get over this situation in AGS:

function A()
{
   ...
   B();
   ...
}

function B()
{
   ...
   A();
   ...
}


Thanks,
Mishel.
#6
Quote from: BunnyMilk on Sun 02/07/2006 12:41:22
Now onto a few things I didn't particularly like. Inconsistencies in the voice acting. Also whenever someone spoke you could hear the on off of the microphone and the feedback/squeeling whatever was going on which did my head in a little bit at the beginning. I got used to it but I still thought I should mention it...

Lizo, about the on and off of the microphone, I have stumbled upon the same problem and solved it, you can see my thread here:
http://americangirlscouts.org/bbc.com/yabb/index.php?topic=28552.msg362992#msg362992

Good Luck!
Mishel.
#7
Ok, I should be carefull next time.
It just really bugs my eye to see it like this.

Good thing I have backups...

Thanks.
#8

This is embarresing, I can add new options to a topic by clicking the 'new option' button, but what if I added a few more options than I needed? Am I destined to see them empty there for the rest of the games development life?

I guess I can restore to a backup of the game fiiles but this is stupid, there must be something I am not seeing here...
#9
Matt, it did convert the sound back with it, that's how I knew the convertion of the wav to mp3 was the one generating the soft tick.

I looked for a way to remove the offset with Sonar 3 but I still didn't find one. I am sure it has one since it is such a big program. I allso tried recording with the speakers off and it did not change anything. A friend of mine recorded some of her lines in her computer which has a much more advanced sound card and she got it perfect without even knowing the problem so I guess a better sound card is the solution if we want to tackle the source of the problem.

Thanks guys,
I should just record on her computer from now on :-)
#10
modgeulator, there is an offset.
That is why I faded in and out the noise, so at least there wouldn't be that tick and it worked in the wav files. Since the speech is over a background music the noise is not heard at all, but the ticks were heard.

I converted the mp3 back to a wav and compared the source wav with this one and you can clearly see a little tick just around the middle of the fade in and out.

I guess though, I was just patching things, I need to find a way to record without that DC offset and I believe it will solve the problem for mp3s and oggs.

Maybe the offset was because I did not turn of the speakers while recording...
#11

Hi all,
After recording all the speech files for a little thingy in AGS I noticed that each time a speech file is played by AGS, there is a distinctive tick at the beginning and end of the speech sound. When you have several lines of text in a dialog, this can get annoying really fast.

I looked at the sound clips and figured they are not properly recorded and that the natural noise of my cheap microphone is the reason, which was true.

So I worked three hours to fade in and out each clip individually and now when I play them in any sound clip playing tool there is no ticks at the beginning and end of the clip.

All happy and excited I placed the files in the proper directory and to my surprise I still heard those ticks, albeit somewhat softer.

I tried several things and after a while I noticed that the ticks did not sound when I was using wav files for the sound clips. They still do sound if I use ogg files or mp3 files.

I thought maybe it has something to do with having to decode the files before playing them but I just checked on my computer and the mp3 files are also ticking with other media playing applications so the only one to blame now is the program that converts the wav files to mp3 or ogg files.

Has anyone encounted this before? I checked with two converting programs and it still happened. I know that when converting to mp3 or ogg you loose data but I never thought it could add ticks :-)

Any suggestion for a convertion program that may solve this problem for me? Using wav files is takes alot of space...
#12
Mind you, alimpo that if you want something in one room to affect things in another room you have to use global variable. Check the manual for Global Variables.
#13
Well, there is nothing on screenshots in the forum rules plus this only has two rooms and I don't think a screenshot will show you anything about FingerPuller.

As for not downloading a virus. Since you don't know me, probably nothing I say will convince you this is not a virus.

But thanks for replying!
Mishel.
#14
Completed Game Announcements / Finger Puller
Mon 18/09/2006 08:53:09
Hi all,
This is not quite a real game, I would put it under the Joke games category.
It is my first creation with AGS and was meant more as an experiment with a nice result.
I think the idea is nice :-)

You can Right Click and Save Target As on this:
FingerPuller

Make sure you slap me before and after the fact...

Mishel.
#15
Thanks Ashen!
It worked like a charm!

I now understand what the Wait function really does... it is so cool!

When I talked about the big loop I reffered to the loop that runs all the frames of the game. Each game has a main loop that recieves input and outputs whatever is needed.
We do not actually see the loop or can control it since it is already handled by the engine but we get to run our scripts at certain points within the loop.
Each pass of the loop is a game cycle.

Now I see that calling the Wait command holds the rest of the script to be executed on the next cycle, or after 200 cycles, whatever we put on the Wait function parameters. This is really a cool feature, it saves us a really big and cluttered repeatedly_execute funtion.
By the way, that function is called strait from the big loop every pass of the loop and that is why the code there will be executed every cycle and not just when some event happens.

Anyway, Thanks again, it is a joy to see this work so beutifully with so little effort programatically.

Mishel.
#16
I tried it and it did't quite work.
But I am probably missing something since I still don't quite know what the different Speech Modes do and how to work with them.
They all end up exactly the same when I try them.

But this global variable does seem to be the thing I am looking for, if I could only make it work :-)

Thanks,
Mishel.
#17
I noticed that when I use PlaySound it runs the sound effect and continues doing other stuff on the list of thigs to do. I want the game to wait for the sound to end and then continue.

I have tried this code:

PlaySound(1);
while(IsSoundPlaying())
{
  // Do nothing
}
DisplayMessage(6);
cEgo.ChangeRoom(3);


but the game encounters an internal error with this description:
Error: run_text_script1: error -6 running function 'hotspot1_a':
Error: Script appears to be hung (15001 while loop iterations without an update in Room 2 script (line 11)


While writing this message I realized that this code can not wait for the sound to end since this code is run in the big game loop so the solution probably lies in an event that singnals the end of the sound effect.

But that is just a guess.
I also saw the wait functions and though that as I know the time length of the sound clip I can wait as many loops as neccessary to end the sound.
But I am looking for the cleaner, more generic solution.
I remember reading about some function that runs each loop, I could in theory wait for the sound to finish on that loop and call a function to continue the execution of my script, I am sure that will work, but still I keep thinking there is a simpler solution which must be in this wonderful tool.

So, how do I wait for the end of a sound effect and do some stuff after it?

Thanks,
Mishel.
#18
Well, id does seem to reverse all the text, meaning the text "Mishel" would turn up "leshiM" in both the dialog window and speech, but the text is still aligned to the left in the dialog window.

Any more clues?

Is it possible to make a gui element for the dialog window and control how the text is shown there?
#19
I am thinking of creating a game in Hebrew and for this I need the Dialog window to display the text in a right to left direction. Is that possible?

How can I change the way the Dialog Window displays the text?
SMF spam blocked by CleanTalk