Auto Weather Change weather-utils

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
Andredron
Miko-Class Veteran
Posts: 727
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Auto Weather Change weather-utils

#1 Post by Andredron »

Written by @LegendKiller21 and @multimokia

If used, please leave credit to the creators above or link the repository.

Please do not claim the code in these files as your own.

With that said: These utilities offer an interface with the openweathermap API to be used within Ren'Py.

https://openweathermap.org/api

These utilities offer connection checking, getting weather observations, sunrise and sunset times, and a way to (while simplified) convert them to a form your game can use.

In order to be able to use this, the user must generate an API key from the link above. (Alternatively you can do this and release it with your game, but it's free if you generate it yourself and on a per user basis)

In order to get weather observations for your desired location, you'll need to either prompt the user for what city they live in, or alternatively use geocoder and get their location via their ip (libraries are included to do so)

NOTE: It is possible that there are cities missing from citylookup.txt. If this is the case, please feel free to submit a pull request adding the location, simply add a line in the form of city_name,country_code,latitude,longitude,state_or_province (Your help is appreciated)

NOTE: Some sys.path manipulation may be needed to import some of these libs.

All of these functions are initialized before init 0. They're ready to be used from init -17.

Instruction - https://github.com/multimokia/Renpy-Wea ... /README.md

Github - https://github.com/multimokia/Renpy-Weather-Utils
Last edited by Andredron on Thu Dec 19, 2019 7:57 pm, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3801
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Auto Weather Change weather-utils

#2 Post by Imperf3kt »

Interesting, I can think of a few uses for this feature.

Thanks for posting it.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: No registered users