Forum

> > CS2D > Scripts > [CS2D Real Weather] Idea
Forums overviewCS2D overview Scripts overviewLog in to reply

English [CS2D Real Weather] Idea

27 replies
Page
To the start Previous 1 2 Next To the start

Poll Poll

What do you think? Good idea?

Only registered users are allowed to vote
Definitly!
19.23% (5)
It's OK.
53.85% (14)
No, i think its unnecressary.
26.92% (7)
26 votes cast

old Poll [CS2D Real Weather] Idea

Marcell
Super User Off Offline

Quote
Hello,

Well, i dunno why, but i always wanted to get work real weather in 2D Well, we just talked with user SQ: about his project, when i got the real idea. I would like to share my currently small project and idea for you guys and get suggestions or opinions by you.

To get the real weather for 2D is very easy.

IMG:https://www.weatherforecastmap.com/img/openweather.png


• Service Provider is OpenWeather

> API Example:

api.openweathermap.org/data/2.5/weather?q=London,uk&appid=2de143494c0b295cca9337e1e96b00e0

• There is a cron.php file, which need to be executed every mins by a simple cron job.
• This PHP file edits a weather.dat file, which read by a simple LUA script.

Currently it just display a simple text every minute:

IMG:https://xde.hu/images/2015/12/07/xde.png



INFO
- Please keep in mind that i used Budapest which was Mist and had 5 Celsius when i made the screenshot.
To provide that see this pic.



> The main idea is the next:

• Weather widget which tells the currently weather and display it, which example a nice pic and with other informations
• The game changes's the weather accordingly which is the currently weather in your city.

Please share your opinions.

The script just requires some work and its done.
edited 3×, last 08.12.15 03:48:26 am

old Re: [CS2D Real Weather] Idea

Marcell
Super User Off Offline

Quote
Well currently nothing, just want to see what you guys saying.. I also waiting for light engine v2 because i will implement some dynamics sounds for like sunrise. (Roosters) frogs at clear night.

Thanks anyway!

old Re: [CS2D Real Weather] Idea

Pagyra
User Off Offline

Quote
This old idea is good, but at this moment is difficult to implement it in game - with using Lua is not possible to change or create entity of weather effects.
There is only possibility is to create a lot of entities on map, and enable or disable it depending on weather parameters.

old Re: [CS2D Real Weather] Idea

_Yank
User Off Offline

Quote
What does the cron script do ? Because it this point you could just use luarocks51, install luasocket and load it with require("socket")

old Re: [CS2D Real Weather] Idea

Nekomata
User Off Offline

Quote
I was planning to make something similar. The weather would affect the player, i.e slow him down, make him faster. Humidity and Cold can have a nice gfx over the player's screen and so on. Sadly we can't alter a bullet's projectory otherwise it would've been more fun. But yes, it'd be best to utilize the upcoming light engine.

old Re: [CS2D Real Weather] Idea

GeoB99
Moderator Off Offline

Quote
Sounds interesting and a great idea I can say. With some effects such as affecting the player by the weather as user Nekomata said and such, would be a great option! Hope you won't let it unfinished this project.

old Re: [CS2D Real Weather] Idea

BcY
Reviewer Off Offline

Quote
it would be really nice with some lighting effects and weather sounds for sure.im excited to see some gameplay vids.

old Re: [CS2D Real Weather] Idea

Marcell
Super User Off Offline

Quote
Guys, a little bit help, is there any way to remove
a simple image?

1
local id=image("gfx/moon.png",0,0,2)

or should i use freeimage instead?

old Re: [CS2D Real Weather] Idea

GeoB99
Moderator Off Offline

Quote
Just use the cs2d lua cmd freeimage to free it and after set the variable manually to nil to prevent any further error. Otherwise if you don't, the image itself is removed but the stored ID it's still there which this is the main factor that causes problems.

old Re: [CS2D Real Weather] Idea

Nekomata
User Off Offline

Quote
If you're going to have some main weather elements I suggest keeping a constant image ID for them and not using freeimage on them but hiding them as user Yates said so.

About the player on-screen images, it would get a little tricky if a player enters a room where the "weather" inside is null and you'd want to fade out the on-screen image. If only cs2d had a image2 type function. >.>

old Re: [CS2D Real Weather] Idea

MikuAuahDark
User Off Offline

Quote
If the server hoster has bad connection, the server will be paused. So, I don't agree.

user Yates has written
How are you requesting a http uri without the dedicated server being "paused"?


I also have a same question. AFAIK it's not possible without external shared library file in the current version (like using external Lua HTTP API).

old Re: [CS2D Real Weather] Idea

Marcell
Super User Off Offline

Quote
@user MikuAuahDark: You still cannot read.. I told to Yates already on skype, its using simple Cron Job and PHP, thats all...

The lowest shitty servers usually able to use php at least..

It requires only PHP and CS2D server.
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview