ID:261312
 
Is there any way in which i can add weather such as rain with a .wav file?

I have looked a Shadowdarkes Tuturial but it only gives you a verb for rain i want the rain to be random.

Any help would be great.
Thanks, Super saiyan3
Super saiyan3 wrote:
Is there any way in which i can add weather such as rain with a .wav file?

I have looked a Shadowdarkes Tuturial but it only gives you a verb for rain i want the rain to be random.

The verb was a demonstration of one way you could change the weather effects. You could easily stick random effects into the day/night cycle if you wish. Check out the prob() and rand() procs. ;)
In response to Shadowdarke
Can you leave me and example, because at the moment i am completely lost.
In response to Super saiyan3
Super saiyan3 wrote:
Can you leave me and example, because at the moment i am completely lost.

I assume you are using the overlay version of daycycle. If not, make the appropriate changes:

daycycle()
lit = !lit // toggle lit between 1 and 0
if(lit)
overlays -= 'black50.dmi' // remove the 50% dither
overlays += 'black25.dmi' // add a 25% dither for a fading effect
sleep(3) // pause a moment
overlays -= 'black25.dmi' // remove the dither
else
overlays += 'black25.dmi' // add a 25% dither for a fading effect
sleep(3) // pause a moment
overlays -= 'black25.dmi' // remove the dither
overlays += 'black50.dmi' // add the 50% dither
<font color=#ffffa0>switch(pick(prob(5); 1, prob(25); 2, prob(70); 3))
if(1) SetWeather(/obj/weather/snow)
if(2) SetWeather(/obj/weather/rain)
else SetWeather()
</font>

spawn(20) daycycle() // change the 20 to make longer days and nights

The yellow addition to the daycycle() proc will make it select a random type of weather each time the light changes. 70% of the time, it's normal weather, 25% of the time it rains, and 5% of the time, it snows.

You can add as many types of weather as you like. I have the weather set up as objs instead of just sending the icon because I was going to build on the system to allow each weather type to have special effects on anyone entering an area with that weather type active.

(Ok, so I didn't use rand() in the routine, but I was just responding off the top of my head the first time.)
In response to Shadowdarke
Thanks you very much!

But there is still one thing i need to add and that is for that chance that it may rain a .wav file


Thanks again for any help i recieve.
In response to Super saiyan3
Nice little way to write that. Thats how HTML should be used.
In response to Super saiyan3
When you SetWeather() to rain, play your rain wav for everyone in the area. I think
contents << sound('rain.wav')
should do the trick.
In response to Shadowdarke
I added in the code for the weather and i get this error.

SamuraiJackAku's Revenge.dm:32:error:SetWeather:bad proc
SamuraiJackAku's Revenge.dm:33:error:SetWeather:bad proc



NOTE: I did not add any of the weather code from the lib beacause i did not want a verb but random chance of rain.
In response to Super saiyan3
SetWeather is an area proc from the OutsideArea demo. You should really examine the code and try to understand what parts cause what effects. That's why it is a demo. It is supposed to teach you a concept. It's not intended for you to plug it into your code like a library.
In response to Shadowdarke
Ok, i will but can you give me an example, as the demo really deals with the weather as a verb and having it kep out of inside areas.

Thanks.