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

#141
You'd have to crop each frame so that the center of the sprite was always centered on the character - and then you'd have to send a move command as the animation runs. I think it's probably simpler just to keep the animation you have, and use x,y coordinates directly. Perhaps hiding the character (the On property, cCharacter.On = false; ) would help prevent it from showing up in the wrong place for that instant when you change the view and move him.
#142
And there's an even bigger issue if using scripting to start the other track - with a game speed of 40 fps, that's 25 ms per frame, so that limits the accuracy of starting a track to +- 12 ms or so; and it wouldn't matter if it's a WAV or MP3.

This (again) points towards using a plugin instead. But perhaps it could play digital sound instead of using directmusic producer?
#143
Just out of curiosity, how come you need the sprites to be smaller as they go down?
#144
Well, to me 600 MB doesn't seem like that much, but my latest drive has 200 GB :)

I am thinking of an alternative method that might work if the MP3/OGG always plays at the correct rate. For example:

----
PlayMusic( some MP3 file # here)

StartPreciseTimer //A plugin could do that - precise timing to better than ms precision. AGS' GetTime function is only precise to seconds.

//Somewhere in RepEx:
If (PreciseTimer >= some position) PlayMusic( the other music file #)
----

A significant caveat there is that if the player switches (Alt-Tab) out of the game, the music is paused, so your timing would be way off. But perhaps then GetMP3PosMillis() could be used to check the other timer's validity?
#145
Quote from: modgeulator on Wed 26/10/2005 05:50:26
I re-uploaded the old file to the same location so the link should now work again.

Not sure how much use it will be. It was some hacked about code I adapted specialised to loading DirectMusic Producer runtimes. It was never intended for playing back normal sound or music files.
Thank you for making it available again. From my quick reading of the DirectX documentation, it says that DirectMusic basically contains all the features of DirectSound, like playing back audio files. So I think that it might be expanded for more general use; but I don't know enough about it for now...
#146
I agree - odds are that to implement speech loops, a new variable would need to be added to the character struct anyway, presumably "cCharacter.SpeechLoop" to go with cCharacter.SpeechView.
#147
Quote from: modgeulator on Thu 19/08/2004 07:42:07
Here's where I'm stuck at the moment:
CJ added a "GetDirectSound()" which hopefully should be able to be used to initialize the DirectMusic stuff inisde the AGS stuff and have everything working together. But unfortunately the newer code for "GetDirectSound()" in the updated "agsplugin.h" conflicts with an include file I need for the DirectMusic code. The LPDIRECTSOUND object in "agsplugin.h" causes a redefinition error with the LPDIRECTSOUND object in "dsound.h" (an include file the DirectMusic code requires.) I'm too crappy a programmer and haven't been able to figure out a way to fix this.

Changing the order of the include files only changes where the redefinition error is raised, the only way I can compile is by commenting out the DirectSound code in "agsplugin.h"

If anyone wants to have a look over the source code I've posted it here:

http://iinet.net.au/~snderson/DirectMusic_plugin_source.zip

I know this is an ancient thread, but I'm very interested in seeing how you got direct music to work in the plugin. Unfortunately the link to the source seems to no longer be valid, could you possibly make it available again (or email it to me at jzikovsky at hotmail dot com)?

I have tried using "GetDirectSound" but for some reason it always returns NULL - even though the sound works. It does not matter if I set the game to use DirectSound, WaveOut, No sound, etc. And I don't know anything about initializing/using direct sound or directmusic myself - so your source would be great!

Thanks!
#148
Completed Game Announcements / Re: CAVERNS
Tue 25/10/2005 02:28:53
Quote from: Kal-El on Fri 21/10/2005 13:19:15
I'm totally stuck by the way, all I've done is picked up two rocks!
I'm stuck too (two rocks as well). Is there anyplace to get hints/walkthrough?
#149
Well, in C this would have been a valid construction, (x -= a) both changes x and returns the result. I don't think that's what you wanted to do anyway...
#150
Thanks for considering it! I saw in one of the AGS pages that you used AASTR for anti-aliasing. I also found this, AASTR2:

http://www.allegro.cc/resource/resource-view.php?id=61&session=c62d3eca3b510ec775df9275e4319732
Direct link to the library:
http://bitblaze.com/allegro/aastr2-0.71.tar.bz2

The readme file gives a list of improvements:
QuoteAASTR2 is a modified version of AASTR that adds new features, like
dithering, alpha blending, non-integer destination rectangles,
adjustable background color, etc..

(Emphasis mine :) )

I hope this helps!
#151
That was a really nice little game. Very simple (one room, one/two item slots) but a very clever concept, and well made too.

I think the game works as is, very short but fun. It doesn't need to be longer - sometimes it's fun to sit down, download, and finish a game in one sitting (see, for example, many of the RON games).
#152
I ran into the same problem with the template. If you change the global script here:

Quotefunction show_inventory_window () {
  if(game.num_inv_items > 0) {      // ** CUSTOM INVENTORY WINDOW

to

Quote
  if(game.num_inv_items >= 0) {      // ** CUSTOM INVENTORY WINDOW

it will show the window, but for some reason game.num_inv_items seems to return 0 even if you have 1 item, so you don't get the "You are not carrying anything" message.

Edit:
Here's a better solution.
Go to the GUI named INVENTORY.
Select the box where inventory is displayed
In the properties, double-click Script Name and say "gInvWindow"
Your global code becomes:
Quote
  if(gInvWindow.ItemCount > 0) {      

And it works as intended. My guess is that since game.num_inv_items is now obsolete, it may have gotten broken slightly.
#153
The problem: 32-bit sprites with alpha channel don't get anti-aliased (smoothed) when they are scaled. I think that this is an old issue, but I could not find anything in the bug tracker, so perhaps it had slipped through the cracks.

I think it would be a great addition : my character sprites have an alpha channel for smoothing the edges and also for their shadow - it looks great, but when scaled down, the body of the sprite suffers a lot from the aliasing. When I make the same sprite w/o the alpha channel (24-bit color), the body looks great scaled, but the edges are not as nice and the shadow can't be done :(

If it makes it any simpler, the alpha channel itself really doesn't need to be anti-aliased - I mean that a nearest-neighbor rescaling algorithm for the alpha + bilinear blending for the color channels would give great results.

Thank you CJ!
#154
Thanks for that sample code you posted, scotch - it was a great help for a plugin I am working on at the moment. I think it could be made part of the official plugin documentation.

Managed objects look like a very useful addition. They certainly made life easier for my plugin. I imagine that for the many people working on AGS RPGs, creating a custom object for a character's stats etc. would be a godsend.  :=
#155
Quote from: modgeulator on Fri 21/10/2005 06:55:22
Janik, I'd be very interested to see how to do that too. I spent a couple of weeks trying to make an audio plugin that worked alongside the AGS sound without success.
What did you try? Did you use DirectSound?

I'll have to read up more on DirectX and DirectSound before trying. I imagine it's possible. There is even "3D" sounds, using the forward/back channels in addition to left/right, that would be cool to have (though this wouldn't make so much sense in a 2D Game ;D). I will give it a shot.
#156
Quote from: esper on Thu 20/10/2005 10:41:17
Ah, I see. I'm just not that great with AGS scripting, and I don't know how "clean" I could get it to look, whereas I already know exactly how it would look with VB (since I already made it for another game before I ever found AGS). But if you don't suggest making a plugin, and I already said I'm not that good with AGS scripting, I should probably listen to you.
If you know Visual C++ reasonably well, then you can make a plugin. If you start with the template, plugins aren't that hard to make. You should probably forget about making the plugin in VB, though; as much as I like VB, it can't handle something like that.

Conceivably, though, you could make a small "wrapper" plugin in VC++, and all it does is launch your separate executable (made in VB or whatever). I haven't tried it, but I can't see why it wouldn't work.

#157
Fair enough, thanks for clearing that up.

Would it be possible for me to work around it in another way - namely by using the GetDirectSound() call? I don't want to use DisableSound() and take over all audio functions; but could I add an extra sound using the DirectSound functions, while AGS does the rest of the audio handling?
#158
I am trying to make a plugin where you can control how much sound plays in the left/right speakers (to make the effect of sound shifting from left to right as you pass by). I am using AGS 2.71.624 (beta)

The code I used is:

Code: ags

engine->RequestEventHook (AGSE_AUDIODECODE);

// and

int AGS_EngineAudioHook(int channel, char *buffer, 
						int len, int freq, int bits, int stereo)
{
//Rest of code goes here
}


But I get a message saying "Error: Plugin requested AUDIODECODE, which is no longer supported". I don't quite get it, the AudioHook seems to have been introduced not so long ago, (v.2.61), and it is still in the plugin documentation - why is it not supported anymore? Is there another way to use AGS_EngineAudioHook in the current version?

Thanks!

#159
Ok, at least I'm not crazy!  ;D

You can probably guess what's coming - would it be possible to add an option to the Tint call to skip the colourise step? Something like:

Character.Tint(int red, int green, int blue, int saturation, int luminance, optional int luminanceonly)

So that by setting luminanceonly to 1 (or true), the RGB values would be ignored and only the luminance + saturation would do anything?

Thanks!
#160
Hi,

I'm trying to code a script where the brightness of the player changes smoothly with position (getting closer to a light source and such). So, instead of using a region's LightLevel, I am using the Character.Tint function call. But I can't get it to do what I want (that is, no color change, just a luminance change).

The game is 32-bit color, the sprite was also 32-bit with alpha channel. Here is what I have tried (LuminanceInt here varies from 0 to 100 depending on position of the player):

player.Tint(255, 255, 255, 0, LuminanceInt); //No change at all
player.Tint(255, 255, 255, 1, LuminanceInt); //No change at all either
player.Tint(255, 255, 255, 100, LuminanceInt); //The lighting works as intended - but all colors are gone!
player.Tint(0,0,0, 0, LuminanceInt); //No change at all
player.Tint(0,0,0, 1, LuminanceInt); //No change at all
player.Tint(0,0,0, 100, LuminanceInt); //Again, the luminance changes but all colors are gone.
player.Tint(0,0,0, 50, LuminanceInt); //Works half-way: Half the color is gone, and setting Luminance to 0 is only half-brightness.

This does not seem to correspond to the manual:
QuoteThe LUMINANCE parameter allows you to adjust the brightness of the sprites at the same time. It ranges from 0-100. Passing 100 will draw the sprites at normal brightness. Lower numbers will darken the images accordingly, right down to 0 which will draw everything black.

Any ideas? Am I missing something?
SMF spam blocked by CleanTalk