HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Custom Weather

View previous topic View next topic Go down 
AuthorMessage
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 377
Join date : 2011-10-20
Age : 31
Location : everywhere

PostSubject: Custom Weather   Sat Jun 11, 2016 1:43 am

For the moment, I'm going to go over just the basic steps. I haven't made a custom weather in a long while so I don't actually have any examples at this exact time. I'll be sure to go over it all in much better detail and grab some screenshots afterwords.


Step1 is to create the files you will be working in. Duplicate the existing Weathers.cfg and WeatherCycles.cfg files and rename them as CustomWeathers.cf and CustomWeathercycles.cfg
If your new weather is similar to an existing one, duplicating that will cut down on some of the work. (for example: gently blowing leaves are similar to gently falling show)

(I was going off memory before but went to doublecheck lolz and most of this step is already in the source media files. but just incase, i'm leaving this here anyways)

From this point onward, you'll be naming your weather so be sure to keep the spelling consistent. For the time, i'm going to call it "NuWeather". Rename the weather you chose to duplicate so that it matches your new one. (ie snow.weather becomes NuWeather.weather)

Step2 is where you open the customweathers.cfg for editing. do you still remember which weather you'd chosen to use as the base for your new one? good. remove everything except the information for that weather and then rename it for your new weather.
repeat this renaming step for the data inside of your new weathers.weather file.
save the changes.

at this point, you technically have a new weather, it's just a renamed duplicate of whatever you picked for the base. lets make it really new, shall we?

Step3 I am sending you into the particles folder for the weather.particle file. if you do not already have a particle created, you can copy/paste on of these and alter them to your whims. else-wise, just paste your custom particle for your custom weather in here.
don't forget to link the materials via the particle.material file.

At this point, assuming I didn't forget something important, you should have a completely new weather which you can call up from the /world file of any map.
Any additional finagling will require a test map so pick one to be the guinea pig and apply your weather to it. (most errors that can occur up to this point should be fairly easy to remedy [as example, an error saying a particle already exists means you forgot to rename you new weather particle])

Some values you can alter particle-side to make your weather look nicer or flow better are

particle_width 10 <-the size of the particles.

particle_height 10 <-same

cull_each false <-not sure how but it reverses directions. don't ask. I'm figuring this all out as i go along XD

quota 100 <-number of particles 'alive' at one time.

emission_rate 25 <-how many particles are 'born' at a time.

time_to_live 7 <-how long the particles stay on the screen.

direction 0 -1 -1 <-which way the particles move. particularly this makes the image drop and move to the west.

velocity_min 50 <-slowest possible speed the particle moves.

velocity_max 100 <-fastest possible speed.

height 2500 <-not sure but it improved the overall look of the weather so I'm not complaining XD

force_vector 100 0 0 <-a force that causes the particles to change direction. in this case, it's causing some falling leaves to speed up in a westerly motion, making them look windswept.



there are also modifiable values in your new weather.weather file

[Rain] <-weather name

Start=100 <-what time of day the weather starts

End=7000 <-how long the weather lasts

SkyShader=0.5 0.5 0.5 <-apply a custom color to the sky

Weather=Rain <-calls up the weathers.cfg values

Rate=1000 <-how heavy or light the weathers presence is

Effect=Lightning <-causes a quick blue flash on the camera

Effect=Thunder <-causes the thunder.mp3 to play

Effect=LightningThunder <- causes both

EffectFrequency=0.0008 <-the probability for a given effect to be used by the weather at an point of time. (ie, the randomness of thunderclaps and lightning flashes)

More effects could be created but these are hardcoded goodies you can only find in the source.

some other values that work in this file are:

Constant=true <-instead of running on a timer, the weather effect is constant

SkyAdder=0 0 0 <-similar to fader, it changes the color of the sky by adding the value to the existing sky

You can set multiple weather types to run from a single weather.weather file and give them each their own time to run in. this effect is best shown via the 'weirdsky.weather' where it is used to change the sky color based on the time.

[Weirdsky 1]
Start=900
End=1500
SkyShader=1.0 0.7 0.5

[Weirdsky 2]
Start=1800
End=2400
SkyShader=0.5 1.0 0.5

[Weirdsky 3]
Start=2700
End=3300
SkyShader=0.5 0 0.5

[Weirdsky 4]
Start=3600
End=4200
SkyShader=1.0 1.0 0

[Weirdsky 5]
Start=4500
End=5100
SkyShader=0.5 0.7 1.0

[Weirdsky 6]
Start=5400
End=6100
SkyShader=0 0 0

lovely, isn't it?


MOAR changeable values exist in the weathers.cfg file!

[Rain] <-the weather name that your weather.weather file is looking for

Weather/Rain <-the particle name the weather will be using

0 400 0 <-where the weather originates in the camera (uh...maybe...actually i'm a little fuzzy on this one, sorry)

rain1.wav <-the soundfile, if any, that will play when the weather effect begins until it ends


The last thing you'll want to take a look at more closely is the weathercycles.cfg file. This is where you give your weather a call-name. you cannot summon a weather in the .world files without giving it a call name.

A quick look shows you something very important. If you want your custom weather to play alongside another weather, you need to make a whole new set of .weather file for it and give it it's own call-name.

[Rain] <-the call-name for your weather. the name you will use to trigger the weather via a .world file

rain.weather <-the weather file that the call-name will trigger to start

examples of combined weathers. if you look in their weather files, you will see the have two distinct weather value sets.

[ThunderstormRain]
thunderstormRain.weather
[RainStarfall]
rainStarfall.weather



if i missed something, and i wouldn't be surprised if i did, let me know <3
Back to top Go down
Skyia

avatar

Game username : Skyia
Server : Royal Elements
Female Posts : 144
Join date : 2014-09-14
Age : 16
Location : In your mind

PostSubject: Re: Custom Weather   Sat Jun 11, 2016 2:19 am

Thank youu
Back to top Go down
ZombieKitteh

avatar

Game username : Zombie
Server : Mythical Realms (Co-Admin), Dawn of Eternity (Dev)
Female Posts : 38
Join date : 2013-01-26
Age : 26
Location : Snowdin & Alternia

PostSubject: Re: Custom Weather   Sat Jun 18, 2016 9:26 am

Ahhhh bless you. <3 This is exactly what I needed.

How many effects can I add maximum in the .weather file? And if I wanted a weather to cycle through various stages like WeirdSky, is it possible to add different sound effects for each one; I'd just put it as a effect right? Would i just slap the name of the sound file there, or does it need to be added somewhere else in the games coding?
Back to top Go down
http://zombiekitteh.deviantart.com
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 377
Join date : 2011-10-20
Age : 31
Location : everywhere

PostSubject: Re: Custom Weather   Sat Jun 18, 2016 5:21 pm

hmm...it may be possible...I'm just thinking out-loud here....but maybe if you created each segment of the weather as it's own weather and then gave each of those segments it's own mp3 in the weathers file and then combined them all in a weather and then set that combined weather into the weather cycles....it's...convoluted but MIGHT work....would need a literal arse-tun of trial and error though.

as for effect sounds..that's done in the code. I haven't played with created new effects yet so that's unfamiliar territory for me. i'd assume it's a healthy mix of copy/paste and trial-and-error (as most things tend to be lol)

as for maximum effects....some of them have 3...so i'm going to assume you can set as many effects as you have available to you (5 with the source) though i think the effect frequency rules all set effects so...lol use multiple unrelated effects with caution i guess.

known effects:

Thunder (sound)
Lightning (blue flash)
LightningThunder (sound and blue flash)
Earthquake (yes, that earthquake. it's an effect and coded in the weather effects section of the weather source codes, it should be able to be used here)
Earthquake2 (ditto)
Back to top Go down
ZombieKitteh

avatar

Game username : Zombie
Server : Mythical Realms (Co-Admin), Dawn of Eternity (Dev)
Female Posts : 38
Join date : 2013-01-26
Age : 26
Location : Snowdin & Alternia

PostSubject: Re: Custom Weather   Sat Jun 18, 2016 9:57 pm

Hrmm yeah that popped up in my mind as potential things to do. One last question i promise and i'll be out of your hair. xD

What numbers can i use for time in a map? Like how long is a day in game and how do I convert that into the code.
Back to top Go down
http://zombiekitteh.deviantart.com
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 377
Join date : 2011-10-20
Age : 31
Location : everywhere

PostSubject: Re: Custom Weather   Sun Jun 19, 2016 12:07 am

time for the game/server/maps themselves is 0-2400
time for the weather cycles goes 0-7000

i have no idea why these are so very different and separate values though....

Code:
if(skyDayTime>=2400)skyDayTime = 0;
if(weatherTime>=7000)weatherTime = 0;

wwhhhyyy???

lol so to set the weather time to start well....work in that 0-7000 time-frame. going further than 7000 will either create the same effect as setting a weathertime to constant or...start the count over. my money would be on the 'turns it into a constant' thing since that's how its already used in a few of the weathers that came with the media folder.....

um..there is a +100 and -100 hardcoded to the source that controls the weather fading in/out and the start/end of a cycle. if you're doing complex timing...might be important to note ^^;;





aw man, i wonder if i can change that ridiculous 7000 to a more manageable 2400......




Code:
dayTime = 500;
weatherTime = 0;

those are setting i found in magixmainserver. this is what the server starts at the moment it's turned on. so if you are timing any weather to match a point in daytime...either change the 0 to 500 (lol im modifying this all now yay!) or just...add 500 to whatever starttime youd wanted i guess...lol


Last edited by Hamilton on Sun Jun 19, 2016 12:14 am; edited 1 time in total (Reason for editing : i found more stuff)
Back to top Go down
ZombieKitteh

avatar

Game username : Zombie
Server : Mythical Realms (Co-Admin), Dawn of Eternity (Dev)
Female Posts : 38
Join date : 2013-01-26
Age : 26
Location : Snowdin & Alternia

PostSubject: Re: Custom Weather   Sun Jun 19, 2016 12:14 am

Oh man so that's why it wasn't working. Thankyou so much for that explanation. I was doing 1 - 2400 and wondering why it wasn't working quite as I had planned.

So for the weather the span between 0 - 7000 marks a single in game day?
Back to top Go down
http://zombiekitteh.deviantart.com
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 377
Join date : 2011-10-20
Age : 31
Location : everywhere

PostSubject: Re: Custom Weather   Sun Jun 19, 2016 12:42 am

uh...actually...i don't think so. it may still be somewhat similar to the daytime (just off by that first 500) and goes to 7000 so that it's just shy of 3 days worth of weather before it re-cycles. probably intended to make it seem a little more 'random' lol (oh snap or maybe it compensates for those 100 timed fadein/outs! why is this so complicated?!).

i've mathed (with a calculator lulz) and checked and scratched my head a few times at at least the original weathers and they seem to follow that kind of pattern. so i guess if you wanted to set a weather for a specific time of day...you probably... first remember that servertime and weather time are mismatched by 500, so a noon shower (1200) would happen at like....1700 weather time...but start fading in at 1600...and then if you wanted it to skip a day or two you'd add 2400 to that...but possible also remove 100 because 3 days is 7200 not 7000...(this is why i just changed my weather time to go to 7200 and the server start on weathertime 500. XD easy maths!)


unfortunately...i've long since changed my daytime to take 2 hours before it re-cycles so....waiting for a test weather to cycle and re-cycle....*meme-face* ain't nobody got time for that! *sobs in the corner*
Back to top Go down
 
Custom Weather
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: SUPPORT :: Tutorials-
Jump to: