ID:261313
 
Can any one leave me an "Example" of a code that makes it rain randomly. If i seem anxious i oppologise but i really want to get the weather feautures of my game done and dusted.
Super saiyan3 wrote:
Can any one leave me an "Example" of a code that makes it rain randomly. If i seem anxious i oppologise but i really want to get the weather feautures of my game done and dusted.

A quick look at the Demos link came up with this:

http://www.byond.com/hub/ hub.cgi?qd=hubIndex;hub=707;channel=1183
In response to Deadron
Deadron, i thank you very much for replying to help me.

I already have the demo but the Demo explains adding it in like a verb; i need it random.

Thanks in advance for any help i get.
I already gave you an example of how to do it randomly at [link]

You need to include the SetWeather() proc from the OutsideArea Demo.
In response to Shadowdarke
proc
daycycle()
lit = 1 - 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(1) // pause a moment
overlays -= 'black25.dmi' // remove the dither
else
overlays += 'black25.dmi' // add a 25% dither for a fading effect
sleep(1) // pause a moment
overlays -= 'black25.dmi' // remove the dither
overlays += 'black50.dmi' // add the 50% dither
switch(pick(prob(5); 1, prob(25); 2, prob(70); 3))
if(1) SetWeather(/obj/weather/rain)
else SetWeather()
spawn(1000) daycycle() // change the 20 to make longer days and nights



SetWeather(WeatherType)
if(Weather) // see if this area already has a weather effect
if(istype(Weather,WeatherType)) return // no need to reset it
overlays -= Weather // remove the weather display
del(Weather) // destroy the weather object
if(WeatherType) // if WeatherType is null, it just removes the old settings
Weather = new WeatherType() // make a new obj/weather of the right type
overlays += Weather // display it as an overlay for the area

i get these errors for the code above.




error:/obj/weather/rain:bad path
SamuraiJackAku's Revenge.dm:39:error:Weather:undefined type: Weather
SamuraiJackAku's Revenge.dm:40:error:Weather:undefined type: Weather
SamuraiJackAku's Revenge.dm:41:error:Weather:undefined type: Weather
SamuraiJackAku's Revenge.dm:42:error:Weather:undefined type: Weather
SamuraiJackAku's Revenge.dm:44:error:Weather:undefined type: Weather
SamuraiJackAku's Revenge.dm:45:error:Weather:undefined type: Weather


In response to Super saiyan3
Super saiyan3 wrote:
i get these errors for the code above.
error:/obj/weather/rain:bad path
SamuraiJackAku's Revenge.dm:39:error:Weather:undefined type: Weather

What's your guess about what they mean?
In response to Deadron
yeah, there is no code for the obj/fire.
In response to Super saiyan3
Super saiyan3 wrote:
yeah, there is no code for the obj/fire.

Wrong.

There is no path for "Rain"

Thats why it says "/obj/weather/rain: bad path"

You need to make this path available for Rain.

obj
weather
rain
icon = 'weather.dmi'
icon_state = "rain"
snow
icon = 'weather.dmi'
icon_state = "snow"


Something like that, that there shows the path for "rain" which your missing.

<font color="grey">-~=</font><font color="#FF0000">Lee</font><font color="grey">=~-</font>
In response to Mellifluous
thanks
In response to Mellifluous
thanks
In response to Super saiyan3
Super saiyan3 wrote:
thanks
No problem mate