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

Topics - mitlark

#1
Editor Development / Bug report
Fri 28/02/2014 02:38:35
This is not a bug, but here it comes.

This is an error I've found a lot in the forum this day, as I was trying to resolve it. I'm pretty sure you've heard of it in German, and other languages that aren't English (that sole fact led me to some conclusions, but sadly I didn't got to a solution).
Quote---------------------------
Error
---------------------------
An unexpected error occurred trying to start up the AGS Editor. Please consult the details below and post the error to the AGS Technical Forum.

System.IO.FileLoadException: No se puede cargar el archivo o ensamblado 'AGS.Native, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ni una de sus dependencias. No se pudo iniciar la aplicación porque su configuración es incorrecta. Reinstalar la aplicación puede solucionar el problema. (Excepción de HRESULT: 0x800736B1)

Nombre de archivo: 'AGS.Native, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.Runtime.InteropServices.COMException (0x800736B1): No se pudo iniciar la aplicación porque su configuración es incorrecta. Reinstalar la aplicación puede solucionar el problema. (Excepción de HRESULT: 0x800736B1)

   en AGS.Editor.NativeProxy..ctor()
   en AGS.Editor.ApplicationController..ctor()
   en AGS.Editor.Program.startupTimer_Tick(Object sender, EventArgs e)
   en System.Windows.Forms.Timer.OnTick(EventArgs e)
   en System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
---------------------------
Aceptar   
---------------------------
The solutions I've heard are that maybe the editor is missing some files, however that doesn't seems to be the case, or not in the regular way. AGS.Native.dll is there, and I actually made AGS3.3.0 run by changing the Native dll by the one from AGS3.2.1 (obviously it "exploded" when I tried to compile a game but I knew it was going to).

Yesterday it was working fine, but today I had an issue and had to reinstall WindowsXP (it needed some cleaning after all, it was such a mess ahahaha!).
I have .NET from 1.0 to 4.0 installed (both 4.0 to be precise). But it seems that there is something I'm missing at my system. So, my question is, if there is other dependency the editor uses. Something like Microsoft VisualC/++ libraries (2008, 2010...).

By now, I've taken my game back to 3.2.1, because it works fine (with some effort I've manually managed to migrate). I can't stand a day without AGS <3. But if anyone knows something of this issue, please share your thoughts.

Thanks.
#2
AuxiliaryFunctions
Supported AGS Version: 3.3

Introduction:
A very small contribution to the site, mostly to try out sharing something. It also is a learning experience, since I'm a VERY BAD programmer. VERY. VERY. BAD. And evil.

This little module encapsulates some functions that I've made that I think can be useful for some people.
These functions cover audio playback, scripted colour "picking" and character's screen position instead of room position.

Code Preview:
If anything happens to the download, you can grab the code from here. It's pretty short.

HEADER
Spoiler
Code: ags
// Mit's Auxiliary Functions (MitAF for short)
//============================================
//A bunch of things I found useful to have, and may be useful for others. Or may not.
//This work is done with the hope of giving something to the community. Either as some
//example code or... anything.

/*
DOCUMENTATION
	Usage: Open your project and import this module. Yeah.
	
	Available functions on this module.
	'''''''''''''''''''''''''''''''''''	
	MitAF.rgbToCol(int r, int g, int b)
		Returns a colour number as an integer, based on numerical values given for 
		red (r), green (g) and blue (b).
		Red goes from 0 to 31. Green from 0 to 63. Blue from 0 to 31.
		
	MitAF.playAudio(AudioClip *audio, int repeat)
		  Plays an audio clip. Difference between this and the regular AudioClip.Play() 
		is that this one is meant for more control under channel volume by audio type.
		  It also makes sure replaying a music/ambient sound type doesn't restarts the 
		audio file.
		
	MitAF.playerScreenX()
		Returns the player screen X co-ordinate based on its room X co-ordinate.
		
	MitAF.playerScreenY()
		Returns the player screen Y co-ordinate based on its room Y co-ordinate.
		
	MitAF.characterScreenX (Character *source)
		Returns any character screen X co-ordinate.
		Returns MitAF.playerScreenX() if source character is same as the player.
		
	MitAF.characterScreenY (Character *source)
		Returns source character screen Y co-ordinate.
		Returns MitAF.playerScreenY() if source character is same as the player.
	MitAF.updateAudioChannelVol()
		Updates all channels volume accordingly to their playing audio type.
		You can call this function after changing a volume value (options panel, etc),
		so all playing audio clips reflect the change.
	
	Available static properties (no need of instantiation).
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''
	Mit_ambientChannel
		Pointer to a channel playing ambient sounds. If there has not been played any
		ambient sound at all, it returns null.
	Mit_musicChannel
		Pointer to a channel playing music. If there has not been played any music at 
		all, it returns null.
	Mit_AmbientVolume
		Volume value for Ambient Type audio clips. You can change it at your options panel.
	Mit_MusicVolume
		Volume value for Music Type audio clips. You can change it at your options panel.
	Mit_SFXVolume
		Volume value for SFX Type audio clips. You can change it at your options panel.
*/

// MIT License
// ===========
// (This license it's not mine).

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

#define MitAF_VERSION 100 // current version

//For saving channel references.
import AudioChannel *Mit_ambientChannel;
import AudioChannel *Mit_musicChannel;
//Channel volume.
import int Mit_AmbientVolume;
import int Mit_MusicVolume;
import int Mit_SFXVolume;

//Channel volume.
struct MitAF {
	//Available functions.
	import static int rgbToCol(int r, int g, int b);
	import static function playAudio(AudioClip *audio, int repeat);
	import static int playerScreenX();
	import static int playerScreenY();
	import static int characterScreenX (Character *source);
	import static int characterScreenY (Character *source);
	import static function updateAudioChannelVol();
};
[close]
SCRIPT
Spoiler
Code: ags
// Mit's Auxiliary Functions (MitAF for short)
//============================================
//A bunch of things I found useful to have, and may be useful for others. Or may not.
//This work is done with the hope of giving something to the community. Either as some
//example code or... anything.

// MIT License
// ===========
// (This license it's not mine).

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

// Available static properties (no need of instantiation).
// '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
// Mit_ambientChannel
// 	Pointer to a channel playing ambient sounds. If there has not been played any
// 	ambient sound at all, it returns null.
AudioChannel *Mit_ambientChannel;
// Mit_musicChannel
// 	Pointer to a channel playing music. If there has not been played any music at 
// 	all, it returns null.
AudioChannel *Mit_musicChannel;

// Mit_AmbientVolume
// 	Volume value for Ambient Type audio clips. You can change it at your options panel.
int Mit_AmbientVolume;
// Mit_MusicVolume
// 	Volume value for Music Type audio clips. You can change it at your options panel.
int Mit_MusicVolume;
// Mit_SFXVolume
// 	Volume value for SFX Type audio clips. You can change it at your options panel.
int Mit_SFXVolume;

//Exports.
export Mit_ambientChannel;
export Mit_musicChannel;
export Mit_AmbientVolume;
export Mit_MusicVolume;
export Mit_SFXVolume;

// MitAF.rgbToCol(int r, int g, int b)
// 		Returns a colour number as an integer, based on numerical values given for 
// 		red (r), green (g) and blue (b).
// 		Red goes from 0 to 31. Green from 0 to 63. Blue from 0 to 31.
static int MitAF::rgbToCol(int r, int g, int b){
	return ( (r*2048)+(g*32)+(b) );
}

// MitAF.playAudio(AudioClip *audio, int repeat)
// 		  Plays an audio clip. Difference between this and the regular AudioClip.Play() 
// 		is that this one is meant for more control under channel volume by audio type.
// 		  It also makes sure replaying a music/ambient sound type doesn't restarts the 
// 		audio file.
static function MitAF::playAudio(AudioClip *audio, int repeat){
	int vol=100;
	AudioChannel *channel;
	if (audio.Type == eAudioTypeAmbientSound) {
		if (Mit_ambientChannel != null){
			if (Mit_ambientChannel.PlayingClip != null) {
				if (Mit_ambientChannel.PlayingClip == audio) return;
			}
		}
		vol = Mit_AmbientVolume;
	}
	else if (audio.Type == eAudioTypeMusic) {
		if (Mit_musicChannel != null){
			if (Mit_musicChannel.PlayingClip != null) {
				if (Mit_musicChannel.PlayingClip == audio) return;
			}
		}
		vol = Mit_MusicVolume;
	}
	else if (audio.Type == eAudioTypeSound) vol = Mit_SFXVolume;
	channel = audio.Play(eAudioPriorityNormal, repeat);
	channel.Volume = vol;
	if (audio.Type == eAudioTypeAmbientSound) Mit_ambientChannel = channel;
	if (audio.Type == eAudioTypeMusic) Mit_musicChannel = channel;
}

// MitAF.playerScreenX()
// 		Returns the player screen X co-ordinate based on its room X co-ordinate.
static int MitAF::playerScreenX(){
	int sHalf = (System.ScreenWidth/2);
	int rX = Room.Width - sHalf;
	if (player.x <= sHalf) return player.x;
	if (player.x > rX) return (player.x - (rX-sHalf));
	return sHalf;
}

// MitAF.playerScreenY()
// 		Returns the player screen Y co-ordinate based on its room Y co-ordinate.
static int MitAF::playerScreenY(){
	int sHalf = (System.ScreenHeight/2);
	int rY = Room.Height - sHalf;
	if (player.y <= sHalf) return player.y;
	if (player.y > rY) return (player.y - (rY-sHalf));
	return sHalf;
}

// MitAF.characterScreenX (Character *source)
// 		Returns any character screen X co-ordinate.
// 		Returns MitAF.playerScreenX() if source character is same as the player.
static int MitAF::characterScreenX (Character *source){
	int pSX = MitAF.playerScreenX();
	if (source.ID==player.ID) return pSX;
	return ( (source.x - player.x) + pSX );
}

// MitAF.characterScreenY (Character *source)
// 		Returns any character screen Y co-ordinate.
// 		Returns MitAF.playerScreenY() if source character is same as the player.
static int MitAF::characterScreenY (Character *source){
	int pSY = MitAF.playerScreenY();
	if (source.ID==player.ID) return pSY;
	return ( (source.y - player.y) + pSY );
}

// MitAF.updateAudioChannelVol()
// 		Updates all channels volume accordingly to their playing audio type.
// 		You can call this function after changing a volume value (options panel, etc),
// 		so all playing audio clips reflect the change.
static function MitAF::updateAudioChannelVol(){
	int i=0;
	int vol=100;
	AudioClip *audio;
	AudioChannel *channel;
	
	while (i<System.AudioChannelCount){
		channel = System.AudioChannels[i];
		audio = channel.PlayingClip;
		if (audio != null) {
			if (audio.Type==eAudioTypeAmbientSound) vol=Mit_AmbientVolume;
			else if (audio.Type==eAudioTypeMusic) vol=Mit_MusicVolume;
			else if (audio.Type==eAudioTypeSound) vol=Mit_SFXVolume;
			channel.Volume = vol;
		}
		i++;
	}
}
[close]

Module download:
- Download link -

SPECIAL THANKS
To whoever wrote the manual <3. And to the community, for this extensive experience database known as forum.
#3
Hello! This is not a ground breaking issue, but more of an inquirity with a thing that I've observed.

Thing is like this. I wanted to control separately volume for SFX (normal sounds), ambient sounds and music. So I did this little audio playing helper
Code: ags
int playAudio(AudioClip *audio, int repeat){
	int vol=100;
	AudioChannel *channel;
	if (audio.Type == eAudioTypeAmbientSound) vol = AmbientVolume;
	else if (audio.Type == eAudioTypeMusic) vol = MusicVolume;
	else if (audio.Type == eAudioTypeSound) vol = SFXVolume;
	channel = audio.Play(eAudioPriorityNormal, repeat);
	channel.Volume = vol;
}
It adjusts volume to the resulting channel depending on the audio type. That works fine.

But crossfading screws it up completely. Let's say, music crossfades, it automatically resets volume and crossfades from 0 to 100, so changing volume before playing the audio file is pretty much worthless.

Question is, is there a workaround for this? Ideas?
There is the option to define an auxiliary Audio Type named "crossfading music" and do the crossfade manually when needed, but I assume it should be more costy for the engine. And nasty (?).

Anyway, I'm not in a hurry, by now crossfade is off, but I really like the effect. So for that, I just ask in case someone here knows something I don't. Because "communityKnowledge > me".

Thanks for reading.
#4
Critics' Lounge / Orochii Spriting
Sun 16/05/2010 21:00:45
Hmmm well, here it is. I have not much to say, so I will start showing some sprites made for my project in AGS. Also note that I have started this week, so I don't have done a lot of sprites xd.
For informational purposes, I will say that the project in which I am working on is supposed to be an Adventure RPG game (mostly Adventure, but with RPG influences and features), as I wanted to make some hard modification to the gameplay. I know that I'm not that experienced with the AGS, but for now it doesn't seems bad anyway ;D, as my experience is based in other game making editors and I am exploring and learning as the time passes.
Said everything, let's start!

In work...


Just started




Redesigning

(here are the two designs that i have thinked, both not being to be the final form as I'm redesigning the costume).

Best regards,
L'ark Mitsinikos
SMF spam blocked by CleanTalk