Jump to content

[REL] Snow 1.0.3


Remp

Recommended Posts

Posted (edited)

This resource creates a fully customisable snowing effect

1233.png

Download: https://community.multitheftauto.com/index.php?p= ... ils&id=538

Example video (with "cartoon" type snow):

To activate the snow, hold down ctrl and press s (or type /snow). Do this again to stop the snow

To access and manipulate the snow settings, hold down shift and press s (or type /snowsettings)

If you experience lag with snow, reduce the settings to a more comfortable level

Settings:

- Snow density

- Snow type ("real" or "cartoon")

- Snow wind direction

- Snow wind speed

- Snow fall speed

- Snowflake size

- Snowflake jitter

Exported functions (clientside):

- updateSnowType(type) - "real" or "cartoon"

- updateSnowDensity(new_density, blend) - blend indicates whether the new density should blend into the old density, rather than just appear all at once

- updateSnowWindDirection(x, y) - between 1 and 0

- updateSnowWindSpeed(speed)

- updateSnowflakeSize(min_size, max_size)

- updateSnowJitter(true/false)

- startSnow()

- stopSnow()

- setGuiEnabled(enabled) - true or false (this controls whether players will have access to their own snow settings gui, also available in the meta.xml)

- setSnowToggle(enabled) - true or false (this controls whether players will be able to turn the snow on and off, also available in the meta.xml)

Edited by Guest
Posted

really really cool, even better, just awesome! now i agree that someone has to create a resource which replaces all the sextures of gta to make them snowy :D

the only thing i've noticed which could be done better is: it seems when you look from above the falling flakes stay at the same size. they would need to get smaller. opposite when looking up from below.

edit: but in the video you stretched 4:3 to wide screen :/

Posted (edited)

Hankey: in my experience of snow (which being a brit is about once every 3 years :) ) this doesnt actually happen. i did briefly toy around with writing some code to automatically generate wind patterns to give it a bit more energy, so theoretically you could add horizontal waving through the exported functions if you wanted

Dragon: yes, 4:3 on youtubes HD setting looks silly, it barely takes up half the available space so i stretched it to fill a little better. currently there are no size alterations at all based on distance/perspective, id have liked to add them in but its a question of speed over features. the less things we compute every frame the higher snow density people will be able to have (this is also why things like ground detection and seeing snow through objects are not very accurate)

Edited by Guest
Posted

There's an interesting feature you have, that i.e being under the bridge, there is no snow. However, then you can't really see snow in the area where there should be. You probably knew that already, though.

Posted

unfortunately this is a limitation of the method i used for creating snow and i cant think of any feasible way around it. feel free to play around with code if you (or anyone) can think of a way to do it

Posted

Adding a dxDrawBatch (or similar) function would probably speed thing kind of thing up, as the repeated calls to dxDrawImage are probably fairly costly.

I'd really be interested to see if you could develop this into a real particle system - it'd be a great thing to have and a good learning experience :)

Posted

This is just so people have a little more control and can toggle it on and off whenever they want. You could make the snow start automatically when you join the server with a simple edit to the code:

Open snow.lua (in the unzipped snow resource folder), copy and paste this onto the bottom of the file, then save it and then restart the resource:

addEventHandler("onClientResourceStart",resourceRoot,startSnow)

this will automatically start the snow whenever the snow resource starts or the person joins the server

you can also use the exported functions to control the snow if you wanted, but this is probably the easiest way to do it

  • 1 month later...
  • 2 weeks later...
  • 9 months later...
Posted

Version 1.0.2 uploaded

- added a horizontal jitter effect to the snow to give it more energy (can be toggled in the settings / via the exports)

- some misc performance improvements (which pretty much counter the jitter, so this version should be roughly as intensive as the last)

- changed to use dxDrawImageSection, so this version only works with mta 1.0.4+ (so only run it on your server if you enforce 1.0.4 clients)

  • 9 months later...
Posted

Version 1.0.3 uploaded.

This fixes an error so the snow will work on the latest mta, please update to use this on 1.1 (or if you can script and want to just update yourself, lines 285/286 in snow.lua: remove the penultimate argument in isLineOfSightClear, 'true')

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...