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

#101
That totally works!
Thank you very much all for your help!
:) :) :) :) :) :) :)
#102
Quote from: Crimson Wizard on Wed 24/02/2021 15:10:53

This code takes the channel that engine chose, and stores its pointer in your variable. It's engine that puts music to *some* channel which it decided to, and then tells you what it is.

If this is what you expect to have, then it's working properly of course.

Ok, so we are back to the the first point. So AGS is doing it, ok.
Now, I need to tell AGS to assign a second channel for music.

Code: ags

AudioChannel *bgm;
AudioChannel *bgm2;
}

Then I guess that with this how it is done, right?

Now, how I would be able to enum these information in order to set them in a struct?
#103
Quote from: Crimson Wizard on Wed 24/02/2021 14:55:49
I was suspecting you may be planning something like this, this is a common mistake. In AGS currently you cannot tell which channel to play clip on, AGS chooses one automatically and then Play returns which one was chosen.
If you reserve only 1 channel for music this is where it will play all the time, if you have more reserved it will take free one or replace a clip if new one has higher priority.

What you can do though is to assign resulting channel to your variables, this way you will at least know where the clips are playing and still may control their volume etc.
EDIT: Or maybe I misunderstood and this is actually what you are doing? ...

If I'm not able to do asign music to a channel, then what is this code doing?
Because it worked so far.

Code: ags
AudioChannel *bgm;
void SetBGM.Play(AudioClip *music) { //Canal secundario de música
  if (bgm == null || bgm.PlayingClip != music) {
   bgm = music.Play();
  }
  else if(music == null) {
    music.Stop();
  }
}
#104
Quote from: Laura Hunt on Wed 24/02/2021 14:38:42
Quote from: eri0o on Wed 24/02/2021 11:21:32
AGS does have crossover, if you have a single music channel, you can set it to do crossover everytime a new music is played - it's buried somewhere in sound clip properties.

Just wanted to point out that this is not correct; you actually need two channels (since a crossfade requires both tracks to be playing at the same time). If you only have one music channel, you will not be able to perform a crossfade and what will happen instead is that the first track will fade out and then the next track will fade in.

Yes, that's the point. I don't want to crossover or merge one audio to another, I want to crossfade two audios with the same song and different acoustic sound in order to create more realistic ambiance.
#105
Quote from: Crimson Wizard on Wed 24/02/2021 13:59:52
In some function, for example you may use game_start for that.
Ok, I'll try if it works.

Quote from: Crimson Wizard on Wed 24/02/2021 13:59:52
If that's the case, then there's no point in assigning bgm and bgm2 to array at all, as that will just copy "null" values to array.
Mmm, ok. So the array is not a solution.

Quote from: Crimson Wizard on Wed 24/02/2021 13:59:52
Note that you cannot create audio channel objects yourself. Only engine creates them. These objects are found in System.AudioChannel[] array. System.AudioChannelCount property tells how many are there.
Also, when you call audioclip.Play() that function returns audio channel pointer on which audio clip ended up.

So, when you are using AudioChannel* pointers either you assign your pointers to one of the System.AudioChannel elements, or you assign them to result of Play() function. Depending on what exactly you are trying to do.
Ok. What I'm trying to do eith this script is to manage two music channels. So I want in my functions to be able to asign a chanel.
Let me share with you part of the struct, so you will understand it better.

Code: ags
struct SetBGM {
  import static void Play(AudioClip *music, SetBGM_Channel = 1, int initialvol = 100, SetBGM_FadeIn fadeinmusic = Direct, int time = 0);
  import static void SetPosition(SetBGM_Channel = 1,  int time);
  import static int GetPosition(SetBGM_Channel = 1);
  import static void CrossFade(SetBGM_FromTo,  int time);
}


So this SetBGM_Channel parameter is the one that says the function which Channel is going to be used for that.
That is the reason I want to set this as an enum, to be more easy to write.

Regards.
#106
Quote from: Crimson Wizard on Wed 24/02/2021 12:24:35
This would be normally a proper code, but where exactly do you put it? For example, if you put this outside of a function that would create error.

The pointers were declared outside of any function in the firsts rows of the script.
Code: ags
AudioChannel *bgm;
AudioChannel *bgm2;


If it is an array then where I'm supposed to enter them?

Quote from: Crimson Wizard on Wed 24/02/2021 12:24:35
Also, do you assign bgm and bgm2 to anything before that? If you just declare AudioChannel* pointer that does not create a channel.

I'm  not assigning bgm or bgm2 before that.

Quote from: Crimson Wizard on Wed 24/02/2021 12:24:35
AGS has a fixed number of audio channels that are always created and present. They may be accessed with System.AudioChannels[] array.
Here's an explanation of AGS audio channels that I once wrote, I am linking it to every such discussion just in case:
https://www.adventuregamestudio.co.uk/forums/index.php?topic=54062.msg636546051#msg636546051

Thank you very much!
#107
Thank you very much, Khris.

Quote from: Khris on Wed 24/02/2021 12:53:31
But again, this is pretty pointless, since you can just use a named pointer instead of the array.
So if I use them as pointers then I don't know how and where can I define them as AudioChannel objects, because I'm not able to define pointers in the enum.

Quote from: Khris on Wed 24/02/2021 12:53:31
In the context of a module you would probably want to provide functions that allow the user to conveniently manage background music without worrying about channels at all. The first step to design something like that is to write the code you want to be able to use, like this:
Code: ags
  Room.AddBGM(discoTrack1);

Next you write the functions that provide these commands, while implementing the necessary data structure.

The problem is that some songs should be sounding in different rooms, so that is why I want to manage the Channel itself.
#108
Thank you, but the Tween module has different functionalities that I'm trying to create.
Also I understand the methods of AudioChannel, I make them work them all.
What I'm trying to do now it to optimize the code I had already written.
I think that the solution comes from what Crimson Wizard mentioned.
#109
Hello.

What I'm trying to do is creating a script with some functions to manage what is played in two dedicated channels for music out of the room's thread.
Why I want to do this? Because I'm trying to do some post production arangements in order to make the video game sounding like a real movie.

For example:
We have the character in one room, and that room is the entrance of the disco, so the music sounds as if it was being in next room, so when the door is opened (there's an animation for it),
the sound of the next room enters gradually.
So I have different music tracks:
-Next room with the door closed (Channel 1)
-Next room with the door opened (Channel 2)
Both songs are played as the character enters in the room, but Channel 2 Volume is set as 0.
So while the door is being opened it Channel 1 gradually changes to 0, and Channel 2 gradually changes to 100.
So it should sound as a real crossfade in audio.
When the character enters in this room it will sound a new track, but for this is only necessary one channel, but I need to send the position of this track in order to make it sound as if it was the same song being played. Do I make myself clear?

This is one of the functions that this script has. When I have this script finished I will share it with you.

I think that the array solution would work. How can I do it? Because I guess this should be the way to define it.
Code: ags
AudioChannel *myChannels[2];

But I'm not able to give them value.
Code: ags
myChannels[0] = bgm;
myChannels[1] = bgm2;

I'm always getting Parse eror: unexpected 'myChannels'
I'm getting the same error if I use it in this way:
Code: ags
myChannels[0] = *bgm;
myChannels[1] = *bgm2;

#110
Advanced Technical Forum / enum of pointers
Tue 23/02/2021 22:27:02
Good evening, community.

I'm trying to create an enum for a script that manages audio chanels.
In the header(ash) this is the enum created.

Code: ags
enum SetBGM_Channel {
  Channel1 = *bgm, 
  Channel2 = *bgm2, 
};


This enum is used in a struct created below.
These pointers are refered in the asc page as

Code: ags
AudioChannel *bgm; //Channel 1
AudioChannel *bgm2; //Channel 2


I'm getting the following error: enum list must be set to literal value
Any idea about how I can do it?

Thanks and regards.

#111
Good morning all.

In the second project we are experiencing new bugs approaching 7GB in acsprset.spr. Yes 7GB, this game is being developed in 640 x 400.
Now it is able to save the project but when you open it back again the project tells you that there are sprites missing, and I had any problem while saving it (just that it takes a while to save it).
I have search for these missing sprites but everything seems to be ok as far as I tested the views, and everything seems to work. I tried to redo it again, and if I delete the last sprites added I go back to normality, but the threshold seems to be now somewhere near 7 GB.
Maybe we are try to do something beyond of what is expected in AGS capacity and it is showing errors where there is no error at all.
Any idea?

Regards.

Update:

Wait, now I am receiving this error when I reopen AGS.

QuoteAn error ocurred whilst trying to load your game. The error was:

getSpriteAsBitmap32bit: Unable to find sprite 0

If you cannot resolve the error, please post on the AGS Techinical Forum for assistance.

If I restore the backup I go back to a version where it just says that there are sprites missing, but at least now I received an error message.

acsprset.spr >= 6,967,015 KB - OK
acsprset.spr = 6,981,384 KB - It says when opening the project that there are sprites missing, but all the sprotes are there
acsprset.spr <= 6,984,112 KB - It shows the error shared above and it doesn't allow you to open the project.
#112
BTW to who may concern. An OGA file is an OGG file. If anyone has an OGA file he can just change oga to ogg extension and it works perfect in AGS.

Regards.
#113
Yes, this is the same game that has the problem, but also we are developing a second one in bigger resolution that reached that problem aswell (not yet annonced).
Black Rain is runing in 320x200. Yes, these cutscenes are made from sprites. We discarded to do it by video, because the result is not the same. When we switch from video to sprites we notice the difference.
Our other project it is 640 x 400. BTW, I entered new sprites to this last project and I didn't get that error anymore. Now the acsprset.spr file is 5,9 GB.

Thanks and regards.
#114
Hello.

The screenshots are already updated to my personal website.
So, they won't expire. :)

Regards.
#115
Quote from: Cassiebsg on Fri 15/01/2021 18:19:25
Uhm, all I get from your pics is "image not found"  :(
Sorry, the links are dead. Do you know any place where the screenshots are available for ever?
#116
Quote from: eri0o on Thu 14/01/2021 21:37:50
Hey, you got some cool devstreams recorded in your YouTube, it would be cool to get some updates here when them happen!
Hello.
We will do that.
I have included a new one.
Here we have more videos in Twitch(Spanish).
https://www.twitch.tv/dru609

#117
Thank you in the name of my whole team for your help and being so fast.
;-D ;-D ;-D ;-D ;-D ;-D
We are going to test your solution.
We will provide you feedback about it asap.

Kind regards.
#118
Hello.

How can I use dynamic sprites in order to asign it as a view into an object in a room?

Regards.
#119
Hello all.

Seems that the download link is broken.
Is anybody available to provide me the module?

Regards.
#120
32470/90000 sprites
845 sprites folders
446 views
14 GUIs
56 characters
SMF spam blocked by CleanTalk