The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
 
Thread Tools
  #1    
Old November 28th, 2013, 02:58 AM
Derxwna Kapsyla's Avatar
Derxwna Kapsyla
X-Class Project, Derxwna, #003
 
Join Date: Jun 2011
Location: Margate, FL
Age: 21
Gender: Male
Nature: Lax
Like in the Pokemon games proper, this script modification will allow you to have background sound for when weather is going on. After hours of Trial and Error, we got it working decently. Credit goes to Mugendai for getting the script working.

To get the script working, go to the Script Section "Game_Screen", and look for the following line: def weather(type, power, duration). Once you find it, that entire section needs to be overwritten with the following code.
Code:
def weather(type, power, duration)
    @weather_type_target = type
    if @weather_type_target == 0 # None
      pbBGSFade(duration)
    elsif @weather_type_target == 1 # Rain
      pbBGSPlay("Rain")
    elsif @weather_type_target == 2 # Storm
      pbBGSPlay("Storm")
    elsif @weather_type_target == 3 # Snow
      pbBGSPlay("Snow")
    elsif @weather_type_target == 4 # Sandstorm
      pbBGSPlay("Sandstorm")
    elsif @weather_type_target == 5 # Sunny
      pbBGSPlay("Sunny") # is this one honestly even necessary? What could possibly play for Sunny Weather? Ah well, it's there if needed.
    end
    if @weather_type_target != 0
      @weather_type = @weather_type_target
    end
    if @weather_type_target == 0
      @weather_max_target = 0.0
    else
      @weather_max_target = (power + 1) * 4.0
    end
    @weather_duration = duration
    if @weather_duration == 0
      @weather_type = @weather_type_target
      @weather_max = @weather_max_target
    end
  end
Do note, you will need sound files for "Rain", "Storm", "Snow", "Sandstorm", and "Sunny". I've provided a download link to the Rain audio file I have. It's free to use, made off an online generator. This way you can test it in-game proper without needing to create a new file.

I would suggest putting a fade in for the audio file, as the audio starts playing right away as soon as the map loads. However, due to it being BGS, the audio file will loop.

Small defect: it may cause some lag on older machines when transitioning between maps. On newer machines, no errors were reported.

I don't think I forgot anything. If I did, I'll be sure to have Mugendai include it in a follow-up post.

The script is, as expected, free to use. Make use of it how you will. Enjoy!
__________________
Development Blog:
For more information future news and updates to any projects, the following blogs are where I post information. You can usually hit me with a message there when it comes to bug reports or feedback, or general conversation about something.
Game Projects:
In Progress:
  • Touhoumon Essentials Development Starter Kit for RMXP - Version 1 finished and released.
    The following version is outdated a great deal. Do not bother downloading it. I will have a new, revised version up eventually. If you really want the engine, I can provide you with the current engine Faith & Prayer version uses.
  • Touhoumon: Faith and Prayer Version - Demo 3.1 Released
Reply With Quote
  #2    
Old November 28th, 2013, 07:48 AM
Worldslayer608's Avatar
Worldslayer608
ಥдಥ
 
Join Date: Mar 2008
Location: San Diego
Age: 24
Gender: Male
Nature: Calm
Very nice of you to transfer your answered question into a resource for others
__________________


Pokemon Pillars of Destiny - Starters
To vanquish without peril is to triumph without glory...

Voted Best Game Designer 2011 on PC
Reply With Quote
  #3    
Old November 28th, 2013, 08:29 AM
Derxwna Kapsyla's Avatar
Derxwna Kapsyla
X-Class Project, Derxwna, #003
 
Join Date: Jun 2011
Location: Margate, FL
Age: 21
Gender: Male
Nature: Lax
Coincidentally enough, Luka answered the thread after I posted the tutorial. I even told Mugendai about it last night, and we laughed it off:
[07:13:46] <Derxwna> Wow
[07:13:49] <Derxwna> Mugendai
[07:13:56] <Derxwna> An alternate method to getting weather working
[07:14:01] <Derxwna> AFTER I post the tutorial

So when I posted it, it was still unanswered. Nevertheless, it would be wrong to amend this post with Luka's idea, since it was his method. Mugendai devised this method of his own time and knowledge, and gave me permission to post it up here.
[05:45:56] <Derxwna> Mugendai
[05:46:02] <Mugendai> ?
[05:46:12] <Derxwna> You don't mind if I post the tutorial about how to get Weather Sounds working, do you?
[05:46:21] <Mugendai> go ahead

Honestly, for me, I just like giving back to the community. If I have an answer to one of my own questions, even if it's not a big deal, I like to post the answer for people who may potentially run across the scenario in the future. This seemed like a potential thing people would be curious about, so I dropped the method Mugendai crafted here on the forums to benefit others.
Sorry if I seemed a bit defensive in this post, I probably misinterpreted the tone of your post, but I also don't want people to think I'm taking credit for something Luka came up with - the last thing I want to do is be branded a thief in this community!
__________________
Development Blog:
For more information future news and updates to any projects, the following blogs are where I post information. You can usually hit me with a message there when it comes to bug reports or feedback, or general conversation about something.
Game Projects:
In Progress:
  • Touhoumon Essentials Development Starter Kit for RMXP - Version 1 finished and released.
    The following version is outdated a great deal. Do not bother downloading it. I will have a new, revised version up eventually. If you really want the engine, I can provide you with the current engine Faith & Prayer version uses.
  • Touhoumon: Faith and Prayer Version - Demo 3.1 Released
Reply With Quote
  #4    
Old November 28th, 2013, 09:19 AM
Luka S.J.'s Avatar
Luka S.J.
S.J.Ware HD
 
Join Date: Dec 2008
Age: 20
Gender: Male
Nature: Adamant
Quote:
Originally Posted by Derxwna Kapsyla View Post
Sorry if I seemed a bit defensive in this post, I probably misinterpreted the tone of your post, but I also don't want people to think I'm taking credit for something Luka came up with - the last thing I want to do is be branded a thief in this community!
Timestamps prove everything man. I didn't see this thread when I posted the stuff in your Question thread. I did see it later though, and I saw that you posted this like an hour before I gave my answer, I just left my post up anyway. So don't worry, it's all good
Reply With Quote
  #5    
Old November 28th, 2013, 10:34 AM
Derxwna Kapsyla's Avatar
Derxwna Kapsyla
X-Class Project, Derxwna, #003
 
Join Date: Jun 2011
Location: Margate, FL
Age: 21
Gender: Male
Nature: Lax
Quote:
Originally Posted by Luka S.J. View Post
Timestamps prove everything man. I didn't see this thread when I posted the stuff in your Question thread. I did see it later though, and I saw that you posted this like an hour before I gave my answer, I just left my post up anyway. So don't worry, it's all good
I like to keep things timestamped for good reason, documentation of events and chronicling purposes. They also come in handy when proving events dd happen when they happened.
Your method you posted on the thread was a valid suggestion. Had we not already figured something out, I'd probably have given it a whirl. Didn't wanna make a comment about how we already figured it out, I thought it'd be rude if I pointed it out. Nevertheless, more than one method is always good.
__________________
Development Blog:
For more information future news and updates to any projects, the following blogs are where I post information. You can usually hit me with a message there when it comes to bug reports or feedback, or general conversation about something.
Game Projects:
In Progress:
  • Touhoumon Essentials Development Starter Kit for RMXP - Version 1 finished and released.
    The following version is outdated a great deal. Do not bother downloading it. I will have a new, revised version up eventually. If you really want the engine, I can provide you with the current engine Faith & Prayer version uses.
  • Touhoumon: Faith and Prayer Version - Demo 3.1 Released
Reply With Quote
Reply
Quick Reply

Sponsored Links


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 03:47 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.