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

#2941
AGS Games in Production / Re: The Witch House
Thu 07/09/2017 12:26:09
Hey rongel! I like this game premise a lot! Re read the Cthulu mythos in a pretty book recently last week and I really like your screenshots. Your art reminds me of  Edward Hopper's Nighthawks. You seem to be advancing fast, which is awesome! I really want to play your game! :-D
#2942
AGS Games in Production / Re: Lamplight City
Mon 04/09/2017 17:41:38
Hey this game looks pretty and I like this colorful greenhouse! ;-D
#2944
Thanks CW, my Global Script is getting kinda long because I have lot's of GUI in my game - basically lots of different computers and stuff - and I though about separating them in modules, I didn't get Build errors, but they stopped working too. :(

So I guess I will keep adding lots of comments in the Global Script. :-\
#2945
Is it possible to make an event on a GUI point to a function not on GlobalScript.asc ? Is it normal that if I click on the three dots (...) it doesn't lead to my function?
#2946
Hey CW!

I was trying to understand everything and apparently understood what I was supposed to do at the same time you wrote the answer... :-[

I marked the thread as solved. I never thought about looking in the project tree... I get so used to coding... :X
#2947
Hello!

I am trying to understand if it's possible to have separate audio controls for music and sound effects. My first approach was to implement two modules, one to deal with music and another to deal with sound effects. The sound effects module is very simple so I will show it below.

SFXPlayer.asc
Spoiler
Code: ags

AudioChannel *acSound;
int gloabalSoundVol;

static void SFXPlayer::play(AudioClip * soundClip){ 
  acSound = soundClip.Play(eAudioPriorityNormal, eOnce);
  acSound.Volume = gloabalSoundVol;
}

static void SFXPlayer::stop(AudioClip * soundClip){
  soundClip.Stop();  
}

static void SFXPlayer::setGlobalVolume(int soundVolume){
  gloabalSoundVol = soundVolume;
  if(acSound != null){
    acSound.Volume = gloabalSoundVol;
  }
}

static void SFXPlayer::setVolume(int soundVolume){
  if(acSound != null){
    acSound.Volume = FloatToInt(IntToFloat(soundVolume) * IntToFloat(gloabalSoundVol)/100.0);
  }
}

static int SFXPlayer::getGlobalVolume(){
  return gloabalSoundVol;  
}

function game_start()
{
  gloabalSoundVol=100;
}
[close]

So the idea was that manipulating the volume of the returned audioChannel I could set it's volume to the appropriate one from a previously set volume. So this approach kind of works, but some sounds are not passed through neither my MusicPlayer module or my SFXPlayer module. I am talking about the sounds originating from view frames, like the sounds of the main character walking and the sounds in between complex animations... So my question is, is there any way to set those sounds volume?

I know there is a variable called System.AudioChannelCount that tells me the number of SystemChannels, and I can access them using System.AudioChannels[ i] ... But I couldn't find out how to use this information to create a sounds volume control. I think if I could understand which audio channel is currently holding the current music, I could assume all other are dealing with the SFX, but I have no idea what to do with this information...

EDIT:

Maybe I need to do something like this, but I don't know where yet.

Code: ags

//AudioClip * currentMusic;
//this variable holds the current playing music

int i = 0;
AudioChannel *ac;

while (i < System.AudioChannelCount)
{
  ac = System.AudioChannels[i];
 
  if (ac.PlayingClip != currentMusic)
  {
    System.AudioChannels[i].Volume = globalSoundVolume;
  } else {
    System.AudioChannels[i].Volume = globalMusicVolume;
  }
  i++;
}


EDIT2:

Apparently the AGS Manual says the following:

QuoteAGS 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.

So, when I play and audioClip, how do I specify it's a music or an ambient sound so it attaches to the correct audio channel?

EDIT3:

Apparently I am an idiot... Ok, so each audio clip has a type, on the interface you can set each of the audio clips type. You can even create a folder and set the default type for the audio clips in that folder. Now if you do this correctly, and it's pretty easy, you can then set the volumes for the audio types using:


Code: ags

  Game.SetAudioTypeVolume(eAudioTypeAmbientSound, 100, eVolExistingAndFuture);
  Game.SetAudioTypeVolume(eAudioTypeMusic, 100, eVolExistingAndFuture);
  Game.SetAudioTypeVolume(eAudioTypeSound, 100, eVolExistingAndFuture);


So... Yeah... That's it, it doesn't require all my ramblings on there...
#2948
AGS Games in Production / Re: Future Flashback
Thu 31/08/2017 22:49:24
Hey guys! So here's a small update, this time I wanted to show the game music! ;)

#2949
Whoa!! Thanks! I am so happy! :D I didn't knew the format changed :)

Edit: Hey Slasher, I just finished seeing the video... Great X-Files references (laugh)
#2950
Site & Forum Reports / Embedded Youtube Videos
Thu 31/08/2017 15:17:41
Hello,

Is the embedded youtube video of the forum broken? To me they appear as text now instead of being embedded ?

"[embed=x,y] video link [/embed]" are the ones I am referencing... Like here: Blackwell Epiphany trailer embedded.
#2951
Site & Forum Reports / Re: Bug reports
Wed 30/08/2017 22:04:56
Hey,

is it just me, or the embedded youtube videos appear as text now instead of being embedded ?

"[embed=x,y] video link [/embed]" are the ones I am referencing... Like here: Blackwell Epiphany trailer embedded.
#2952
I am still waking up, but for me Linux build wasn't working and I had to manually copy the Linux engine and the .so files in the game folder. Can you test the Linux version and verify that your game executable isn't indeed executing under Linux?
#2953
Thanks arj0n ! Just downloaded both modules! :]
#2954
Thanks! Just sent him a message.

About the game Drowning In The Bitstream, the source is not available, am I missing something here?

Edit:

It seems Chicky didn't use any distortion, apparently it's all pre-made, as stated here.

Edit 2:

Holy Cow you guys are amazing! Thanks!
#2955
Hey, does someone has a backup of this code somewhere? I am really interested in the code :). Also the FakeScreen module, I couldn't find it's topic. :~(
#2956
Hey Crimson Wizard! Great module, that's the kind of thing I am looking for, distortion of the image while being able to move the character around and the character itself being effected by the distortion!

Unfortunately, the link to this underwater module is offline, so I couldn't check it's code. :/

Here is an example that I made, but I am using screenshot and it only works with stills, I would like to advance this effect:

Example video rewind effect

The messages on the forum tells something about a module called FakeScreen.
#2957
I really want the new OpenGL render and the risk it won't work two years from now.
#2958
Hey, these blend modes, what blocks them from moving into the main engine code? They would be very useful for my game.
#2959
Critics' Lounge / Re: Monster in a jar
Fri 11/08/2017 04:05:09
I think the jar is too squared. If you look up on Google Images for the terms Futurama+head+in+a+jar you will be met with a simplistic depiction of heads in a jar. Notice how in every scene they appear, the borders are rounded to imply the cylindrical shape.

Other than this, the purple look more witch/mage oriented while the yellowish look more mad bio scientist oriented.
#2960
NormRnd

NormRnd is a tiny (2.1kB) module adding a standard normal random number function. It uses Box-Muller method, which should be reasonably fast.

It exposes two functions:

float normrnd_unitary()
Returns a standard normal random number, as a float, with median 0, and variance 1.

int normrnd_asint(int median, int sigma, int clamp_ceil,  int clamp_floor)
Returns a standard normal random number, as a int, requires passing a defined median and sigma. It also allow clamping to restrict the possible returning values. If clamp_ceil and clamp_floor are equal, clamping is disabled.

NormRnd.asc

Spoiler
Code: ags

// normrnd
//
// This module allows returning standard Normal random number.
// This code is based on Box-Muller method, implemented in C
// by Prof Darren Wilkinson here:
//
// http://www.mas.ncl.ac.uk/~ndjw1/teaching/sim/transf/norm.html
//
// My work was porting to AGS and giving utilitary functions
// Author: Erico Porto
//

float surand()
{
  return ( IntToFloat(Random(1000))/1000.0 );
}

float urand(float low, float high)
{
  return(low+(high-low)*surand());
}

float genexp(float lambda)
{
  float u,x;
  u=surand();
  x=(-1.0/lambda)*Maths.Log(u);
  return(x);
}

float gennor()
{
  float theta,rsq,x;
  theta=urand(0.0,2.0*Maths.Pi);
  rsq=genexp(0.5);
  x=Maths.Sqrt(rsq)*Maths.Cos(theta);
  return(x);
}

//normrnd_unitary
//
// returns a float that is a standard Normal random number
float normrnd_unitary(){
  return gennor();
}

// returns an int that is a standard Normal random number
// first paramter, median, is the median of the distribution
// second parameter, sigma, is proportional to the variance of the distribution
// third and fourth parameter allow clamping the result if a hard limit is desired
int normrnd_asint(int median, int sigma, int clamp_ceil,  int clamp_floor){
  int return_value = FloatToInt(gennor()*IntToFloat(sigma)+IntToFloat(median));
  if( clamp_ceil != clamp_floor && clamp_ceil > clamp_floor){
    if (return_value > clamp_ceil){
      return_value = clamp_ceil;
    }
    if (return_value < clamp_floor){
      return_value = clamp_floor;
    }
  }
  
  return return_value;
}
[close]

NormRnd.ash

Spoiler
Code: ags

// normrnd
//
// This module allows returning standard Normal random number.
// This code is based on Box-Muller method, implemented in C
// by Prof Darren Wilkinson here:
//
// http://www.mas.ncl.ac.uk/~ndjw1/teaching/sim/transf/norm.html
//
// My work was porting to AGS and giving utilitary functions
// Author: Erico Porto
//
import float normrnd_unitary();
import int normrnd_asint(int median, int sigma, int clamp_ceil = 0,  int clamp_floor = 0);
[close]

Download NormRnd.scm here

Doc website

Github Repository
SMF spam blocked by CleanTalk