AGS Awards nominations close at 13:59 GMT on Saturday 10 February 2018. You haven't yet nominated, so you've got 19 days and 19 hours left to play the games and decide which to nominate!

Author Topic: PLUGIN: Snow/Rain 2.02  (Read 45365 times)

Scorpiorus

  • 100101101010b
Re: PLUGIN: SnowRain plugin
« Reply #20 on: 28 May 2005, 15:46 »
I see what you're asking for. Currently, drops/flakes are seen through the standart camera. It's usually enough as most background images for AGS games are drawn in a similar perspective but there are exceptions (like a top-down view) or a free camera view (like in Alone in the Dark).
So, I thought about having a way to change the camera position/orientation for a future version.

EDIT:

p.s. Are you after some starfield simulation or what? :)
« Last Edit: 28 May 2005, 15:54 by Scorpiorus »

skw

  • stuck in the 90s
    • I can help with backgrounds
    •  
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with web design
    •  
Re: PLUGIN: SnowRain plugin
« Reply #21 on: 11 Jun 2005, 17:12 »
Hi, great plugin I must say!

Does it always works with both snow and rain, or can you choose between rain and snow? Let's say I want only the rain, but have foggiest idea about scripting. What should I do? ;)
a.k.a. johnnyspade

Cyberion

  • Master Of Orion
    • I can help with play testing
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Re: PLUGIN: SnowRain plugin
« Reply #22 on: 12 Jun 2005, 00:27 »
well you have script commands, which need to be run. Plugin has two seperate commands for snow and rain effect. Just check with the readme file.

And ya, Scorpiorus is an amazing coder ;)

Re: PLUGIN: SnowRain plugin
« Reply #23 on: 20 Jun 2005, 12:15 »
I see what you're asking for. Currently, drops/flakes are seen through the standart camera. It's usually enough as most background images for AGS games are drawn in a similar perspective but there are exceptions (like a top-down view) or a free camera view (like in Alone in the Dark).
So, I thought about having a way to change the camera position/orientation for a future version.

EDIT:

p.s. Are you after some starfield simulation or what? :)

Sorry, I didn't notice this before now. Thanks for the reply Scorpiorus. Well, yeah, technically I suppose it would work like a starfield simulation :) except that scaling/rotation of raindrops would be a bitch, so I'm not really asking for that. In my case, I'd probably put the center of gravity well below the screen area itself, just to make it fit the perspective and avoid the "curtain" look that it sometime has now, falling straight down.

Re: PLUGIN: SnowRain plugin
« Reply #24 on: 06 Jul 2005, 09:10 »
Ehmmm...this plugin seems very interesting....but i've difficulties making it work in my game....

I've read the attached file with the instructions...but i dont know how to do the script in a certain room. :-[ Sorry if my question is banal...but i really need to put every rain/snow setting in the room script or what?

For examble...if i want to see begin to rain in a certain room....what main function i've to use?

EDIT: ignore the message above...i solved the problem myself...i've only another question:

If i put this script...

srChangeRainAmount(100); wait(50);
srChangeRainAmount(200); wait(50);
srChangeRainAmount(300); wait(50);


...inside the "if" where timer is expired, every time that rain change amount my game goes in cutscene mode for few seconds...why?

Oh...btw...this plugin is really awesome!  ;D
« Last Edit: 07 Jul 2005, 08:52 by Jade »

Re:AGS: SnowRain PlugIn [v2.0]
« Reply #25 on: 07 Jul 2005, 09:02 »
No, not for everyone drop. :) Actually if you would play a sound for every drop you don't hear much because of limited number of sound channels. But having a function that returns is there specified amount of drops have fallen could help to organize sounds. Like srIsDropsFallen(int amount) returns 1 if there is 'amount' of drops or less have fallen right now. So you could check it repeatedly to change the sound to play:

repreatedly_execute() {

 if (srIsDropsFallen(30) )
    PlaySound(1); // for about 30 drops
 }
 else if (srIsDropsFallen(200) )
    PlaySound(2); // for about 200 drops
}
etc.

or maybe using an interval as usual: srIsDropsFallen(int min_amount, int max_amount). :P yep, that's probably better.


Hey Scopiorus....i was thinking to arrange the sounds effect testing the rain amount...

for example:

in my case i set rain amount randomly...so...i've this script:

int ran=random(400);
if (isTimerExpired(i)){
 srChangeRainAmount(ran);
 if (ran > 100) {
 PlayAmbientSound(1, 6, 50,0,0);
 }
 if (ran > 200){
 PlayAmbientSound(1,6,100,0,0);
 }
 if (ran > 300){
 PlayAmbietSound(1,6,200,0,0);
 }
 settimer(1,1000);
}


In this way i got a nice and credible sound effect that only increase volume with the rain amount.  :)

Scorpiorus

  • 100101101010b
Re: PLUGIN: SnowRain plugin
« Reply #26 on: 11 Sep 2005, 18:35 »
Does it always works with both snow and rain, or can you choose between rain and snow? Let's say I want only the rain, but have foggiest idea about scripting. What should I do? ;)

You can have it only rain, snow or both at the same time -- there is different functions for rain and snow, look them up in the plugin reference file.

As for an example, the plugin demo game provides with some basic script code to make it work. You can comment out (remove) parts of it responsible for the snow, such as srSetSnowAmount(...) or srChangeSnowAmount(...).


Sorry if my question is banal...but i really need to put every rain/snow setting in the room script or what?

For examble...if i want to see begin to rain in a certain room....what main function i've to use?
Quote
EDIT: ignore the message above...i solved the problem myself...

I'm glad you solved it; still to mention for anyone may having the same question: typically, you should invoke the initialization functions (such as srSetSnowView, srSetSnowTransparency, srSetSnowFallSpeed etc...) when game starts, that is within the body of the game_start() script function;
and whenever you are going to actually start snow/rain just call srSetSnowAmount or srChangeSnowAmount. You can of course change weather properties at anytime of game's running -- just invoke the init functions again whenever you need.


Quote
If i put this script...

srChangeRainAmount(100); wait(50);
srChangeRainAmount(200); wait(50);
srChangeRainAmount(300); wait(50);


...inside the "if" where timer is expired, every time that rain change amount my game goes in cutscene mode for few seconds...why?

That's due to how Wait() works -- it actually blocks the script from executing further for the specified amount of time.

What you need is to restrain from using Wait() in that particular case, for example:

at the top of room (or global) script:
Code: Adventure Game Studio
  1. int weatherTimer = 15; // any number available within 1..20
  2. int rainAmount = 0; // amount to begin with
  3.  

room (or global) repeatedly execute:
Code: Adventure Game Studio
  1. if (IsTimerExpired(weatherTimer))
  2. {
  3.     if (rainAmount < 300)
  4.    {
  5.         rainAmount = rainAmount + 100;
  6.         srChangeRainAmount(rainAmount);
  7.         SetTimer(weatherTimer, 200);
  8.    }
  9. }
  10.  

some event function (to start the timer ticking for the first time):
Code: Adventure Game Studio
  1. SetTimer(weatherTimer, 200);


Quote
i was thinking to arrange the sounds effect testing the rain amount
Yeah, that should make it. :)
« Last Edit: 11 Sep 2005, 18:51 by Scorpiorus »

Snow/Rain plugin not working
« Reply #27 on: 21 Nov 2005, 03:26 »
Does the Snow/Rain plugin no longer work with AGS 2.71 RC3? It looked great in 2.7, but now that I've ported up I can't see my rain anymore...?

Has anyone else had this problem?

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: Rain/Snow plugin does not work with AGS 2.71
« Reply #28 on: 18 Jan 2006, 14:42 »
Yes, this is known. Scorpiorus will have to fix this and he's not aroudn at the moment. However, there is the SimpleSnow moudle by me and Akumayos' weather module

Scorpiorus

  • 100101101010b
Re: PLUGIN: SnowRain plugin v2.01
« Reply #29 on: 29 Jan 2006, 00:04 »
Oops, seems like the plugin has some sort of a conflict with the new version of allegro that comes along with AGS 2.71, as I see. It's probably some special functionality I used that hadn't been available via the plugin API at the time I wrote it.

Sorry about that, I'll get it fixed (will probably manage to reduce its size a lot as well).

Klytos

    • I can help with AGS tutoring
    •  
    • I can help with publishing
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Klytos worked on a game that was nominated for an AGS Award!
Re: PLUGIN: Snow/Rain plugin v2.02
« Reply #30 on: 02 Feb 2006, 23:54 »
Seems to work great now, well done. Thanks.

Scorpiorus

  • 100101101010b
Re: PLUGIN: Snow/Rain plugin v2.02
« Reply #31 on: 04 Feb 2006, 06:29 »
No problem, thanks for letting me know that it works now.

Just want to point it out once more that the last version of plugin doesn't require the "alleg40.dll" file so you may safely remove it from your game's folder *unless*, of course, there is another plugin using that library.

Radiant

  • AGS Baker
  • Mittens Knight
  • Return once more to the Two Kingdoms!
    • I can help with publishing
    •  
    • I can help with story design
    •  
    • Radiant worked on a game that was nominated for an AGS Award!
      Radiant worked on a game that won an AGS Award!
Rain & Snow plugin with latest beta
« Reply #32 on: 19 Mar 2006, 12:53 »
Using the R&S plugin with the current v2.72 beta produces a lot of warning messages like this one:

(in room 42): RawDrawImage: Sprite 155 colour depth 16-bit not same as background depth 32-bit

(where the background color depth is in fact 16-bit, just like everything else in the game).
« Last Edit: 19 Mar 2006, 14:44 by strazer »

Scorpiorus

  • 100101101010b
Re: PLUGIN: Snow/Rain plugin v2.02
« Reply #33 on: 16 Apr 2006, 18:49 »
I just tried the plugin's demo game (it uses 16bit sprites on a 16bit background) with the currently latest AGS v2.72 beta7 and it works fine.

Are you sure it is plugin-related? Because this kind of warning message is usually common for the RawDrawImage() ags script function. The plugin doesn't produce any warnings explicitly. It may be a result of calling into some plugin API function but I'm not quite sure it's the reason.

Don't you have a RawDrawImage call in your room 42 by any chance, do you?

Goldmund

  • Mittens Baronet
  • Be a man, goddamit!!! Grow some 'stache!!!!
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: PLUGIN: Snow/Rain plugin v2.02
« Reply #34 on: 06 Jun 2006, 13:32 »
Are you still working on this?

I'd like to use this great plugin in my game, but are you planning to make it possible to set horizontal boundaries like you can do with vertical? It would be perfect, because using guis to cover "dry" areas makes it impossible for other animations to display correctly (they get covered with guis as well).
« Last Edit: 06 Jun 2006, 13:35 by Goldmund »

Scorpiorus

  • 100101101010b
Re: PLUGIN: Snow/Rain plugin v2.02
« Reply #35 on: 13 Jun 2006, 18:06 »
You mean some sort of a viewport functionality? Yeah, that definitely would be possible, and handy. I made a special version of the plugin for someone in the past to support that. It's kind of an unofficial one though, I doubt it's compatible with the latest version of AGS and I don't have the source code for that branched out version anymore.

I'll see about adding it into the official version, as time permits.

Re: PLUGIN: Snow/Rain plugin v2.02
« Reply #36 on: 14 Jun 2006, 09:50 »
I've tried the plugin, and then I open the demo game included, but I got this error and testing the game. I thought the alegro.dll has not needed.

Before I got this illegal exception, I got an error saying that alleg40.dll has not found.

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x004341A6 ; program pointer is +9016, ACI version 2.72.915, gtags (0,0)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.

Gilbert

  • Local Moderator
  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
    •  
Re: PLUGIN: Snow/Rain plugin v2.02
« Reply #37 on: 14 Jun 2006, 10:12 »
A word about installation:
The plugin uses Allegro library which I included to zip file. To use the plugin you have to copy file alleg40.dll to your Windows folder. However I strongly recommened copy this file to the COMPILED folder of every game that uses SnowRain plugin because it must be included in the final game pack!


Did you read this?

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: PLUGIN: Snow/Rain plugin v2.02
« Reply #38 on: 14 Jun 2006, 10:44 »
Gilbert, did you read this:  ;) ::) :P

Just want to point it out once more that the last version of plugin doesn't require the "alleg40.dll" file so you may safely remove it from your game's folder *unless*, of course, there is another plugin using that library.

« Last Edit: 14 Jun 2006, 10:44 by strazer »

Gilbert

  • Local Moderator
  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
    •  
Re: PLUGIN: Snow/Rain plugin v2.02
« Reply #39 on: 14 Jun 2006, 10:51 »
Maybe he's still using V2.0 then?