Search Unity

[RELEASED] UniStorm 5.2 - AAA Volumetric Clouds, URP Support, Weather, Sky, Atmospheric Fog, & More!

Discussion in 'Assets and Asset Store' started by BHS, Jan 27, 2012.

  1. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Finaly find out what the problem is. jbooth's wind effect does not uses the ambient light to calculate the color for the wind.

    However, do you ever uses moon and sun lights at the same time in your standard setup? What I saw is, inyour standard setup, that the intensity is just applyed for the sun or the moon light, but with the intensity curves both lights can be activated. Is it so?
     
  2. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Something I've never really thought about but struck me recently.

    Right now (or ~9 months ago, the last time I used this asset--haven't had the chance to use it recently), the "seasons" are very "middle of northern hemisphere," in that you have the generic four. If this isn't still the case, please let me know.

    However, there are definitely other locations with not only a subset of those seasons (areas of great latitude like the poles are pretty much winter all year round), but also entirely different types of seasons altogether. Thinking mainly of something like a rainy or dry season location, which has the precipitation changes you've incorporated into the traditional seasons (to my recollection) but also has very different temperatures, and different weather patterns.

    Again, something like this may have been added. If not, can it be easily put in on our side of things?
     
  3. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi, I hacked around your code, now I disabled the moon light and instead at night just the ambient light exists. In the fixed update method I also changed the values to let the sun start at 5 degree earlier and disappear at 175 degree. In the code I just had have to disable the moon and the moonObject, it was strait forward. The solution would be better, if I had change the sun light properties to moon properties and let the sun (as moon) rotate around the terrain at night. Maybe you could implement a simple one light solution, and let us decide what version we need, or somehow make the sun-moon light transition better (maybe equalize the light with ambient light at the transition time) and never let 2 directional lights active at the same time, due to peformance reasons.
     
  4. Mythran

    Mythran

    Joined:
    Feb 26, 2013
    Posts:
    85
    With unistorm and behaviour designer how can it be made so that the NPC goes to waypoint a at x hour and to waypoint b at y hour?
     
  5. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Most weather types can happen at any time of year, excluding Thunderstorms. After Emerald 2.0 is submitted, which will happen within the next couple of days, UniStorm 2.5 will resume development. This update will open up a lot more possibilities related to customization. The 2.5 update will also have a new biome system that allows users to specify what weather happens for each biome. The option to customize each weather type that will be in each season is also planned. Lastly, the 2.5 update has a new procedural cloud shader.

    Hey there!

    Thanks for the suggestions. UniStorm will be getting a new update with 2.5 and the plan is to improve the transition between night and day. An option to have 1 light source can possibly be added. As soon as development is resumed with the 2.5 update, which should be sometime within the next week, I can better access what needs to be done to make that happen.
     
    EternalAmbiguity and C_p_H like this.
  6. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Hi There,

    I am using Unistorm (2.4.4.1) in Unity 2017 with MapMagic, MicroSplat, Vegetation Studio and ootii's Motion Controller and Camera Controller (with UMA DCS) and am trying to get them all working together nicely (all assets are up to date).
    So far, I have used Unistorm's Auto Player Setup to try to setup the camera and player setup correctly. It seems like it did all of the necessary setup (although I still need to setup the follow script for the player character). I get sound and light, but no weather effects currently (I hear the sounds of rain, but no cloud or rain effects); so, I am guessing I still need to setup some stuff correctly. I read through all or most of your online documentation but still can't figure out what I am doing wrong.
    Any suggestions on how I get the weather working?
     
  7. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208

    Wow, this is my *exact* setup. I haven't integrated Unistorm yet (I'm saving weather for dead last), but i'll be paying attention to the answer you get.
     
    boysenberry likes this.
  8. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Another question I have is I plan on switching between 3rd person and 1st person. Is there a way to do that dynamically in Unistorm?
     
  9. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I think my problem was on the first setup I had a direct light in the scene, maybe. I have removed it since and tried the setup again using APS then turning off fog (I'll figure out the post processing stuff in a bit). It now runs smoothly as far as I can tell, just need to tweak settings until I have it just right...


    Capture.PNG
     
    BHS and Jaimi like this.
  10. mdsmith98

    mdsmith98

    Joined:
    Feb 17, 2014
    Posts:
    9
    Hey again everyone.

    I am using Unistorm again, and I am wondering how I can make it snow in my game, or rather set the season to winter? I set the weather type to Thunder Storm Or Snow Storm Winter Only, and changed the month to december under time, but it still rains in my game. Can anyone advise?

    Thanks in advance!
     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I plan on updating UniStorm’s API to have the ability to switch cameras with one function with the next update. When I get the chance tomorrow, I will post a script that allows you to switch between cameras.


    Great to hear you figured it out! Please let me know if you have any questions with tweaking the settings.


    Hey there!

    It can actually snow at any time of year. What controls snow fall is the temperature. So, you need to make sure your temperature in December is at or below freezing. You can adjust the temperature by going to the Temperature Options.
     
    boysenberry likes this.
  12. Candac59

    Candac59

    Joined:
    Sep 18, 2015
    Posts:
    106
    Hello,

    I'm having a problem with fog (even on a blank project with only unistorm).

    As you can see on the screen, the color of the fog never changes (I also have the impression that the intensity does not change either ..)

    Yet I do not think I missed something?



    EDIT:
    Ooooh i found .... the problem comes from AQUAS / Underwater fog ...

    EDIT2:
    All of this brings me to another question. How to make the night darker, and that it has a slightly more significant impact than on that screen? I thought about intensifying the fog at night but I did not find any control over the fog intensity as a function of time.

     
    Last edited: Dec 22, 2017
  13. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    @BHS , I'd also like to talk about darkness at night time.

    After reading through a lot of the old posts I finally managed to darken my ground so that night time becomes very dark, but try as I might, I cannot make the clouds stop illuminating my scene.

    BHS, can you please make an itemised summary of how to make nights dark, which things to change and turn off?

    On a clear night, the skybox does not illuminate the terrain, but as soon as clouds or fog are added to my scene then I can see into the distance. I'd really like any suggestions to fix this?
     
    Candac59 likes this.
  14. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    @BHS, it looks like I have worked it out, it looks like the light coming fog cloud colours changes are dramatic and even though the default colours look dark, they are light when the moon illuminates them,
     
    Candac59 likes this.
  15. Candac59

    Candac59

    Joined:
    Sep 18, 2015
    Posts:
    106
    Hello,

    Have you managed to make the night darker than on my screens? If so, is it possible to explain roughly what you did?

    I also look for a long time and I think like you there is something that happens with the lighting of the night that influences the color of the fog.

    Regarding the cloud, I do not have my project unity at hand but if I do not say stupidity try to look to change the color of the clouds at night (I can be confused with Enviro Sky because I did test with this asset too)
     
  16. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Has anyone managed to integrate the Unistorm save system with the Plygame save system?

    I have been trying for roughly three months but this is what I can get it to do.

    If I link the Unistorm save system to Plygame, and I have three save slots, when I save in slot 1 it is fine. But when I save a game to slot 2, then the save data replaces the save data in slot 1. So I can have three saves in my game, but all of them have the last save data from Unistorm.

    I can't manage to figure out how to save multiple Unistorm saves.
     
  17. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
    new update?
     
  18. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    Hello @Candac59, I just reread my last post which I posted from my iphone and I must say I really dislike auto correct and autofill. That last post of mine barely makes sense.

    I'm at work at the moment so will I'll post again later today when I have Unistorm open. In the meantime, yes I have managed to make it so dark that you can't see your hands.

    My project setup with lighting and shaders only includes is CTS, Unistorm, Beautify and Post Processing Stack. I think the major difference was that the cloud colour in the cloud options looks dark, but they need to be darkened more, but in small increments. Also, the moon option tabs, the moonlight colour must be reduced to about 0 -10%. Anyway I'll post later today.
     
    Candac59 likes this.
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    You can make nights darker by having a darker color for your ambient light source. I recommend using the Color or Gradient options as they give you more precise control. Using the Skybox ambient source can often lead to scenes looking too light.

    Another suggestion would be to keep your moon intensity lower. Having it too high can also affect how dark your nights are. Also, keeping your Fog color dark can help distant land look darker.

    If you’d like an example, I can post a settings file for you to import with the UniStorm Import\Export Settings System.



    Great to hear you figured it out. You can refer to my post above if you are still looking for darker nights.


    Hey there!

    I’m not entirely sure how Plygame’s save system works, but I can reach out to the developer to see if we can figure out how to properly save UniStorm’s data.

    Are you using UniStorm’s API to help with saving and loading UniStorm’s data?


    A new update is planned that will have a new procedural cloud shader and a few more big features/improvements that I will be announcing within the next couple of weeks.
     
    C_p_H, Candac59 and TheSeawolf like this.
  20. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    In case this is useful for you, I zoom from third person to first person, thereby using the same camera. I do this with Invector TPC and Unistorm. I plan to add a line of code to the Invector zoom script to make the camera jump to first when it gets close to the head. I passes through right now.
     
    boysenberry likes this.
  21. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    What I tried was adding an empty object to my scene, which has a persistable object script from Plygame on it. Then I add this script which I wrote which in theory should save the information I want, but it is not working. I have tried about 25 different ways but I am not getting anywhere.
     

    Attached Files:

  22. DragonsanStudios

    DragonsanStudios

    Joined:
    Nov 6, 2017
    Posts:
    67
  23. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    That's what I am planning on too. I am using ootii's Third Person Motion Controller with his Camera controller. I still have to wire up the transition between 1st and 3rd as well though.
     
    wood333 likes this.
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Refer to UniStorm's save and load example below. There is API that will help with setting the date, time, and weather.

    Code (CSharp):
    1. //Black Horizon Studios
    2. //UniStormSystem Save Example
    3.  
    4. using UnityEngine;
    5. using System.Collections;
    6.  
    7. public class SavePlayerData_C : MonoBehaviour {
    8.  
    9.     Vector3 playerPosition;
    10.     Vector3 playerRotation;
    11.     UniStormWeatherSystem_C UniStormSystem;
    12.     int currentHour;
    13.     Vector3 rotationToSet;
    14.  
    15.     void Start ()
    16.     {
    17.         UniStormSystem = GameObject.Find("UniStormSystemEditor").GetComponent<UniStormWeatherSystem_C>();
    18.     }
    19.  
    20.  
    21.     void Update ()
    22.     {
    23.         if(Input.GetKeyDown(KeyCode.O))
    24.         {
    25.             PlayerPrefs.SetInt("Current Minute", UniStormSystem.minuteCounter);
    26.  
    27.             PlayerPrefs.SetInt("Current Hour", UniStormSystem.hourCounter);
    28.  
    29.             PlayerPrefs.SetInt("Current Weather", UniStormSystem.weatherForecaster);
    30.             PlayerPrefs.SetInt("Current Day", UniStormSystem.dayCounter);
    31.             PlayerPrefs.SetInt("Current Month", UniStormSystem.monthCounter);
    32.             PlayerPrefs.SetInt("Current Year", UniStormSystem.yearCounter);
    33.             PlayerPrefs.SetInt("Current Temperature", UniStormSystem.temperature);
    34.  
    35.             playerPosition = transform.position;
    36.             playerRotation = transform.rotation.eulerAngles;
    37.  
    38.             PlayerPrefs.SetFloat("Player Position X", playerPosition.x);
    39.             PlayerPrefs.SetFloat("Player Position Y", playerPosition.y);
    40.             PlayerPrefs.SetFloat("Player Position Z", playerPosition.z);
    41.  
    42.             PlayerPrefs.SetFloat("Player Rotation X", playerRotation.x);
    43.             PlayerPrefs.SetFloat("Player Rotation Y", playerRotation.y);
    44.             PlayerPrefs.SetFloat("Player Rotation Z", playerRotation.z);
    45.  
    46.             Debug.Log("Game Saved" + "\n" + " In-Game Time " + UniStormSystem.hourCounter + ":" + UniStormSystem.minuteCounter + " | "  + " In-Game Date " + UniStormSystem.monthCounter + "/" + UniStormSystem.dayCounter + "/" + UniStormSystem.yearCounter + " |  Current Weather " + UniStormSystem.weatherString + " | Current Temperature " + UniStormSystem.temperature);
    47.         }
    48.  
    49.         if(Input.GetKeyDown(KeyCode.L))
    50.         {
    51.             UniStormSystem.SetDateAndTime(PlayerPrefs.GetInt("Current Hour"), PlayerPrefs.GetInt("Current Minute"), PlayerPrefs.GetInt("Current Month"), PlayerPrefs.GetInt("Current Day"), PlayerPrefs.GetInt("Current Year"));
    52.             UniStormSystem.ChangeWeather(PlayerPrefs.GetInt("Current Weather"));
    53.             UniStormSystem.temperature = PlayerPrefs.GetInt ("Current Temperature");
    54.  
    55.             playerPosition.x = PlayerPrefs.GetFloat("Player Position X");
    56.             playerPosition.y = PlayerPrefs.GetFloat("Player Position Y");
    57.             playerPosition.z = PlayerPrefs.GetFloat("Player Position Z");
    58.  
    59.             playerRotation.x = PlayerPrefs.GetFloat("Player Rotation X");
    60.             playerRotation.y = PlayerPrefs.GetFloat("Player Rotation Y");
    61.             playerRotation.z = PlayerPrefs.GetFloat("Player Rotation Z");
    62.  
    63.             UniStormSystem.InstantWeather();
    64.  
    65.             transform.position = new Vector3 (playerPosition.x, playerPosition.y, playerPosition.z);
    66.  
    67.             rotationToSet = new Vector3 (playerRotation.x, playerRotation.y, playerRotation.z);
    68.             transform.eulerAngles = rotationToSet;
    69.  
    70.             Debug.Log("Game Loaded");
    71.  
    72.         }
    73.     }
    74. }
    75.  

    Users can use WAPI to write custom scripts. However, it is not currently integrated with UniStorm. I have plans to do this with the next update as I have done with CTS.


    When switching cameras, you will also need to update the position UniStorm's particle effects. Feel free to use this script I wrote a little while back for another custom to accomplish this.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class SwitchForms : MonoBehaviour {
    6.  
    7.     UniStormWeatherSystem_C UniStormSystem;
    8.  
    9.     //Get the UniStorm system
    10.     void Start (){
    11.         UniStormSystem = FindObjectOfType <UniStormWeatherSystem_C>();
    12.     }
    13.  
    14.     ///When switching to the human form, move all particle effects over using the HumanFormObject.
    15.     ///This can be set by sending the object as a parameter
    16.     public void HumanForm (GameObject HumanFormObject){
    17.         //Set the Rain to the human object
    18.         UniStormSystem.rain.transform.SetParent (HumanFormObject.transform);
    19.         UniStormSystem.rain.transform.position = new Vector3 (0,12,0);
    20.         //Set Snow to the human object
    21.         UniStormSystem.snow.transform.SetParent (HumanFormObject.transform);
    22.         UniStormSystem.snow.transform.position = new Vector3 (0,12,0);
    23.         //Set the Windy Leaves to the human object
    24.         UniStormSystem.windyLeaves.transform.SetParent (HumanFormObject.transform);
    25.         UniStormSystem.windyLeaves.transform.position = new Vector3 (0,12,0);
    26.         //Set Lightning Bugs (aka Butterflies) to the human object
    27.         UniStormSystem.butterflies.transform.SetParent (HumanFormObject.transform);
    28.         UniStormSystem.butterflies.transform.position = new Vector3 (0,12,0);
    29.         //Set Rain Mist to the human object
    30.         UniStormSystem.rainMist.transform.SetParent (HumanFormObject.transform);
    31.         UniStormSystem.rainMist.transform.position = new Vector3 (0,12,0);
    32.         //Set Snow to the human object
    33.         UniStormSystem.snowMistFog.transform.SetParent (HumanFormObject.transform);
    34.         UniStormSystem.snowMistFog.transform.position = new Vector3 (0,12,0);
    35.     }
    36.  
    37.     //When switching to the bird form, move all particle effects over using the BirdFormObject.
    38.     //This can be set by sending the object as a parameter
    39.     public void BirdForm (GameObject BirdFormObject){
    40.         //Set the Rain to the bird object
    41.         UniStormSystem.rain.transform.SetParent (BirdFormObject.transform);
    42.         UniStormSystem.rain.transform.position = new Vector3 (0,12,0);
    43.         //Set Snow to the bird object
    44.         UniStormSystem.snow.transform.SetParent (BirdFormObject.transform);
    45.         UniStormSystem.snow.transform.position = new Vector3 (0,12,0);
    46.         //Set the Windy Leaves to the bird object
    47.         UniStormSystem.windyLeaves.transform.SetParent (BirdFormObject.transform);
    48.         UniStormSystem.windyLeaves.transform.position = new Vector3 (0,12,0);
    49.         //Set Lightning Bugs (aka Butterflies) to the bird object
    50.         UniStormSystem.butterflies.transform.SetParent (BirdFormObject.transform);
    51.         UniStormSystem.butterflies.transform.position = new Vector3 (0,12,0);
    52.         //Set Rain Mist to the bird object
    53.         UniStormSystem.rainMist.transform.SetParent (BirdFormObject.transform);
    54.         UniStormSystem.rainMist.transform.position = new Vector3 (0,12,0);
    55.         //Set Snow to the bird object
    56.         UniStormSystem.snowMistFog.transform.SetParent (BirdFormObject.transform);
    57.         UniStormSystem.snowMistFog.transform.position = new Vector3 (0,12,0);
    58.     }
    59. }
    60.  
     
    boysenberry likes this.
  25. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    The script I wrote is based on your script. Plygame already saves the player position, so I took that out of the script. Like I said, in some attempts I tried I could get it to save the data, but if I had three saves, all of them would have the weather from the last save. I am not a good enough programmer to figure this out.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I see that the script you wrote is close to the save and load example that is included with UniStorm. However, you aren't using some of the API that save and load example uses. I believe this is where your issue lies. You cannot set the date and time directly. You need to use UniStorm's API.

    Below, I have modified your save script. I don't have the plyGame API, but I'm fairly certain this will work.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using plyGame;
    4.  
    5. public class UnistormSave : MonoBehaviour, IPersistable
    6. {
    7.     uniStormWeatherSystem_C uniStormSystem;
    8.  
    9.     int currentHour;
    10.     void Start ()
    11.     {
    12.         uniStormSystem = GameObject.Find("UniStormSystemEditor").GetComponent<UniStormWeatherSystem_C>();
    13.     }
    14.  
    15.     public void Save(string key)
    16.     {    
    17.         key = key + ".unistorm";
    18.         GameGlobal.SetIntKey(key + ".Current Minute", uniStormSystem.minuteCounter);
    19.         GameGlobal.SetIntKey(key + ".Current Hour", uniStormSystem.hourCounter);
    20.         GameGlobal.SetIntKey(key + ".Current Weather", uniStormSystem.weatherForecaster);
    21.         GameGlobal.SetIntKey(key + ".Current Day", uniStormSystem.dayCounter);
    22.         GameGlobal.SetIntKey(key + ".Current Month", uniStormSystem.monthCounter);
    23.         GameGlobal.SetIntKey(key + ".Current Year", uniStormSystem.yearCounter);
    24.         GameGlobal.SetIntKey(key + ".Current Temperature", uniStormSystem.temperature);
    25.     }
    26.  
    27.     public void Load(string key)
    28.     {            
    29.         key = key + ".unistorm";
    30.         //These are not needed because you cannot set the time and date directly.
    31.         //uniStormSystem.minuteCounter = GameGlobal.GetIntKey(key + ".Current Minute", uniStormSystem.minuteCounter);
    32.         //uniStormSystem.hourCounter = GameGlobal.GetIntKey(key + ".Current Hour", uniStormSystem.hourCounter);
    33.         //uniStormSystem.dayCounter = GameGlobal.GetIntKey(key + ".Current Day", uniStormSystem.dayCounter);
    34.         //uniStormSystem.monthCounter = GameGlobal.GetIntKey(key + ".Current Month", uniStormSystem.monthCounter);
    35.         //uniStormSystem.yearCounter = GameGlobal.GetIntKey(key + ".Current Year", uniStormSystem.yearCounter);
    36.  
    37.         //Instead, set the time and date using the UniStorm SetTimeAndDate function. More is required to set the time and date than just setting the variables directly.
    38.         //The SetTimeAndDate function does this automatically.
    39.         uniStormSystem.SetDateAndTime(GameGlobal.GetIntKey(key + ".Current Hour", uniStormSystem.hourCounter), GameGlobal.GetIntKey(key + ".Current Minute", uniStormSystem.minuteCounter),
    40.             GameGlobal.GetIntKey(key + ".Current Month", uniStormSystem.monthCounter), GameGlobal.GetIntKey(key + ".Current Day", uniStormSystem.dayCounter),
    41.             GameGlobal.GetIntKey(key + ".Current Year", uniStormSystem.yearCounter));
    42.  
    43.         uniStormSystem.weatherForecaster = GameGlobal.GetIntKey(key + ".Current Weather", uniStormSystem.weatherForecaster);
    44.      
    45.         uniStormSystem.temperature = GameGlobal.GetIntKey(key + ".Current Temperature", uniStormSystem.temperature);
    46.  
    47.         //After the saved weather has been loaded, InstantWeather is needed to instantly fade it in.
    48.         uniStormSystem.InstantWeather();
    49.     }
    50.  
    51.     public void DeleteSaveData(string key)
    52.     {
    53.         key = key + ".unistorm";
    54.         GameGlobal.DeleteKey(key + ".Current Minute");
    55.         GameGlobal.DeleteKey(key + ".Current Hour");
    56.         GameGlobal.DeleteKey(key + ".Current Weather");
    57.         GameGlobal.DeleteKey(key + ".Current Day");
    58.         GameGlobal.DeleteKey(key + ".Current Month");
    59.         GameGlobal.DeleteKey(key + ".Current Year");
    60.         GameGlobal.DeleteKey(key + ".Current Temperature");
    61.     }
    62.  
    63.     public void DisablePersistence()
    64.     {
    65.         // Ignore
    66.     }
    67. }
     
    Last edited: Jan 5, 2018
  27. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    I am getting this error.

    And thank you for helping with this! It is much appreciated.
     

    Attached Files:

    • 30.png
      30.png
      File size:
      20.7 KB
      Views:
      844
  28. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    @BHS Seems that the saving and loading isn't really working as intended. We are saving by storing the current Hour (unistorm.Hour) as an int and the minute (unistorm.Minute). However, using SetTime() is not working, and UniStorm reverts to the default start time. I've have tried this in Awake(), Start() and after Start() and none of these are working. Could you either tell me what I'm doing wrong here or push a fix?
     
  29. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    OK, all I had to do was change the "U" in UniStorm to a small letter. It is working perfectly. I will put up a guide in the plyGame forums so that if anyone else needs to integrate Unistorm with PlyGame they can use that.

    Thanks again for the help.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Hey there!

    Because UniStorm calculates everything on start, you may need to add a slight 0.1 second delay before you load your saved UniStorm time. It is most likely being rewritten by UniStorm's initialization function.


    You're welcome.

    Great to hear everything is working correctly. That would be great, thanks!
     
    Stormy102 likes this.
  31. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    I'm afraid your solution didn't work - I waited 10 frames, 0.1 seconds and 1 second and it doesn't appear to be working.
     
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Strange. How exactly are you saving and loading? Have you tried the example saving and loading scenes to see if they are working correctly? There is one manual save example and an auto save example.
     
  33. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    The saving example uses the old loading methods which are now depreciated.
    Our saving code:
    Code (CSharp):
    1. BinaryFormatter formatter = new BinaryFormatter();
    2.             FileStream stream = new FileStream(ServerConfiguration.ServerPath + "/world.savedata", FileMode.OpenOrCreate);
    3.             System.DateTime currentTime = uniStorm.GetDate();
    4.             WorldSaveData saveData = new WorldSaveData()
    5.             {
    6.                 currentMinute = currentTime.Minute,
    7.                 currentHour = currentTime.Hour,
    8.                 currentDay = currentTime.Day,
    9.                 currentMonth = currentTime.Month,
    10.                 currentYear = currentTime.Year,
    11.  
    12.                 currentTemperature = uniStorm.temperature,
    13.                 currentWeather = uniStorm.weatherForecaster
    14.             };
    15.             formatter.Serialize(stream, saveData);
    16.             stream.Close();
    Our loading code (this is called via Start()):
    Code (CSharp):
    1. if (File.Exists(ServerConfiguration.ServerPath + "/world.savedata"))
    2.             {
    3.                 WorldSaveData data = new WorldSaveData();
    4.                 BinaryFormatter formatter = new BinaryFormatter();
    5.                 FileStream fileStream = new FileStream(ServerConfiguration.ServerPath + "/world.savedata", FileMode.Open);
    6.                 data = formatter.Deserialize(fileStream) as WorldSaveData;
    7.                 fileStream.Close();
    8.  
    9.                 uniStorm.ChangeWeather(data.currentWeather);
    10.                 uniStorm.temperature = data.currentTemperature;
    11.  
    12.  
    13.                 uniStorm.SetDateAndTime(data.currentHour, data.currentMinute, data.currentMonth, data.currentDay, data.currentYear);
    14.                 Debug.Log("[Saving] Successfully Loaded World Settings");
    15.             }
    The temperature and weather load fine, just not the hours and minutes.
     
  34. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    There used to be a tutorial for working with multiple cameras, but I can't find it. Anyone have a link?
     
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I’ll look into this to see what’s causing the issue. When using PlayerPrefs, everything works as it’s supposed to.


    Hey there!

    The process for using two cameras changed so the guide was removed. You basically have 1 camera render your scene and the other camera render UniStorm. This is done by using layers. A new example scene was added that demonstrates using two cameras.
     
    Stormy102 likes this.
  36. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    OK. My game is a third person game. What I am trying to do is when my player interacts with an NPC (when he talks to them) it must switch to a first person camera, and when the interaction stops, it must switch back to a third person camera.

    What is happening is when the camera switches back to third person, it is playing a sound from my footsteps script through the Unistorm audio source.

    I will have a look at the example scene and see if I can get this sorted out.
     
  37. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Hi,

    First, the example scene for the two cameras is filled with errors, scripts that can't be loaded, etc.

    But that is not going to sort out my problem even it worked. The audio source is still on the player, and my footsteps script is conflicting with that. I need to find a way to make the footsteps script audio player and the Unistorm audio player not both be on the player.
     

    Attached Files:

    • 36.png
      36.png
      File size:
      39.3 KB
      Views:
      841
  38. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208

    Why switch cameras? Personally, I'd just move the camera, then move it back.
     
  39. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    It is a third person camera. If I zoom in on the interaction, it passes through the players head, which looks a bit odd.

    I also tried adjusting the zoom distance with a script, but that didn't work properly either.
     
  40. hsxtreme

    hsxtreme

    Joined:
    Apr 14, 2017
    Posts:
    55
    Volumetric Lighting ??
     
  41. C_p_H

    C_p_H

    Joined:
    Nov 24, 2014
    Posts:
    153
    Hi @BHS

    I know Unity betas aren't fully supported for various developmental reasons, and I understand that a UniStorm update is on the horizon; so just sharing an error that may stall a future release beyond 2017.2 just in case others may decide to tryout the new Unity 2017.3 or 2018.1.0b~ with UniStorm 2.4.1.2. (Metal API, .NET3.5 & 4.6)

    "Assets/UniStorm (Desktop)/Scripts (Desktop)/Editor/UniStormEditor_C.cs(1505,29): error CS0143: The class `UnityEngine.AudioClip' has no constructors defined".

    Code (CSharp):
    1.         //Error occurs on all code using:        self.List<AudioClip>.Add ( new AudioClip());
    Assets/UniStorm (Desktop)/Scripts (Desktop)/Editor/UniStormEditor_C.cs(34,34): Error CS1729: 'AudioClip' does not contain a constructor that takes 0 arguments (CS1729) (Assembly-CSharp-Editor)

    Assets/UniStorm (Desktop)/Scripts (Desktop)/Editor/UniStormEditor_C.cs(42,42): Error CS1729: 'AudioClip' does not contain a constructor that takes 0 arguments (CS1729) (Assembly-CSharp-Editor)

    /Assets/UniStorm (Desktop)/Scripts (Desktop)/Editor/UniStormEditor_C.cs(38,38): Error CS1729: 'AudioClip' does not contain a constructor that takes 0 arguments (CS1729) (Assembly-CSharp-Editor)

    /Assets/UniStorm (Desktop)/Scripts (Desktop)/Editor/UniStormEditor_C.cs(42,42): Error CS1729: 'AudioClip' does not contain a constructor that takes 0 arguments (CS1729) (Assembly-CSharp-Editor)

    /Assets/UniStorm (Desktop)/Scripts (Desktop)/Editor/UniStormEditor_C.cs(40,40): Error CS1729: 'AudioClip' does not contain a constructor that takes 0 arguments (CS1729) (Assembly-CSharp-Editor)
     
    gdp2 and boysenberry like this.
  42. ethanwgross

    ethanwgross

    Joined:
    Jun 25, 2014
    Posts:
    83
    I have an issue with the Auto Character Set up crashing Unity 2017.30f3.
     
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Here's a script to switch between first person and third person. You will need to call the appropriate function and assign the player object and the camera object for both camera types.

    I don't know your exact setup, but this should get you on the right track. Make sure both camera have a Far Clipping Plane of 18,000 and that there is a Sun Shafts Image Effect on both cameras. Copying the sun shaft component from your main camera should work.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class SwitchCamera : MonoBehaviour {
    6.  
    7.     UniStormWeatherSystem_C UniStormSystem;
    8.     Camera FirstPersonCameraRef;
    9.     Camera ThirdPersonCameraRef;
    10.  
    11.     //Get the UniStorm system
    12.     void Start (){
    13.         UniStormSystem = FindObjectOfType <UniStormWeatherSystem_C>();
    14.     }
    15.  
    16.     ///When switching to the first person object, move all particle effects over using the FirstPersonObject.
    17.     ///This can be set by sending the object as a parameter
    18.     public void FirstPerson (GameObject FirstPersonObject, Camera FirstPersonCamera){
    19.         //Set the Camera to the FirstPersonCamera
    20.         UniStormSystem.cameraObjectComponent = FirstPersonCamera;
    21.         //Set the SunShafts to the FirstPersonCamera's sunshafts
    22.         UniStormSystem.sunShaftScript = FirstPersonCamera.GetComponent<UnityStandardAssets.ImageEffects.SunShafts>();
    23.         //Set the Rain to the first person object
    24.         UniStormSystem.rain.transform.SetParent (FirstPersonObject.transform);
    25.         UniStormSystem.rain.transform.localPosition = new Vector3 (0,20,0);
    26.         //Set Snow to the first person object
    27.         UniStormSystem.snow.transform.SetParent (FirstPersonObject.transform);
    28.         UniStormSystem.snow.transform.localPosition = new Vector3 (0,12,0);
    29.         //Set the Windy Leaves to the first person object
    30.         UniStormSystem.windyLeaves.transform.SetParent (FirstPersonObject.transform);
    31.         UniStormSystem.windyLeaves.transform.localPosition = new Vector3 (0,12,0);
    32.         //Set Lightning Bugs (aka Butterflies) to the first person object
    33.         UniStormSystem.butterflies.transform.SetParent (FirstPersonObject.transform);
    34.         UniStormSystem.butterflies.transform.localPosition = new Vector3 (0,12,0);
    35.         //Set Rain Mist to the first person object
    36.         UniStormSystem.rainMist.transform.SetParent (FirstPersonObject.transform);
    37.         UniStormSystem.rainMist.transform.localPosition = new Vector3 (0,12,0);
    38.         //Set Snow to the first person object
    39.         UniStormSystem.snowMistFog.transform.SetParent (FirstPersonObject.transform);
    40.         UniStormSystem.snowMistFog.transform.localPosition = new Vector3 (0,12,0);
    41.     }
    42.  
    43.     //When switching to the third person object, move all particle effects over using the ThirdPersonObject.
    44.     //This can be set by sending the object as a parameter
    45.     public void ThirdPerson (GameObject ThirdPersonObject, Camera ThirdPersonCamera){
    46.         //Set the Camera to the ThirdPersonCamera
    47.         UniStormSystem.cameraObjectComponent = ThirdPersonCamera;
    48.         //Set the SunShafts to the ThirdPersonCamera's sunshafts
    49.         UniStormSystem.sunShaftScript = ThirdPersonCamera.GetComponent<UnityStandardAssets.ImageEffects.SunShafts>();
    50.         //Set the Rain to the third person object
    51.         UniStormSystem.rain.transform.SetParent (ThirdPersonObject.transform);
    52.         UniStormSystem.rain.transform.localPosition = new Vector3 (0,20,0);
    53.         //Set Snow to the third person object
    54.         UniStormSystem.snow.transform.SetParent (ThirdPersonObject.transform);
    55.         UniStormSystem.snow.transform.localPosition = new Vector3 (0,12,0);
    56.         //Set the Windy Leaves to the third person object
    57.         UniStormSystem.windyLeaves.transform.SetParent (ThirdPersonObject.transform);
    58.         UniStormSystem.windyLeaves.transform.localPosition = new Vector3 (0,12,0);
    59.         //Set Lightning Bugs (aka Butterflies) to the third person object
    60.         UniStormSystem.butterflies.transform.SetParent (ThirdPersonObject.transform);
    61.         UniStormSystem.butterflies.transform.localPosition = new Vector3 (0,12,0);
    62.         //Set Rain Mist to the third person object
    63.         UniStormSystem.rainMist.transform.SetParent (ThirdPersonObject.transform);
    64.         UniStormSystem.rainMist.transform.localPosition = new Vector3 (0,12,0);
    65.         //Set Snow to the third person object
    66.         UniStormSystem.snowMistFog.transform.SetParent (ThirdPersonObject.transform);
    67.         UniStormSystem.snowMistFog.transform.localPosition = new Vector3 (0,12,0);
    68.     }
    69. }
    70.  

    I'm working on adding this feature with the next version. Now that Emerald AI 2.0 has been released. Development will resume with UniStorm and its new version.


    Thanks for the bug report. I will get a quick update out to address this asap.


    Thanks for bringing this to my attention. I'll get an update out to resolve this.
     
    boysenberry and C_p_H like this.
  44. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Thank you very much. I got this all working smoothly. Looking great.
     
  45. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I am hoping to integrate Unistorm with Advanced Foliage Shader (AFS) v5.
    The issue I am having initially has to do with wind zone functionality. Both AFS and UniStorm have their own wind zone functionality.
    I would like to be able to link the functionality between the two and am wondering if you have any solutions you could suggest?
    The wind zone is for plant response of course. I am also using Vegetation Studio and GPU instancing. All of this on multiple terrains.
    I imagine getting UniStorm and AFS working together is doable, right?

    Thanks in advance,
    Boysenberry
     
  46. flex_interativa

    flex_interativa

    Joined:
    Nov 23, 2016
    Posts:
    9
    Does this asset works with SteamVR, did anyone tried already? I am willing to buy it but i need to know if it works for SteamVR cameras.
     
    Sonnenspeer likes this.
  47. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I plan on redoing UniStorm wind, now that the wind variables are public. I don't own AFS so I can't say for sure. I can certainly reach out to the developer of AFS to see what can be done though. You can try adding AFS's Wind Zone to UniStorm to see if it will controller it, assuming that the Wind Zone is with Unity and not a custom one. This can be found under the Object Options tab and Unity Components.


    I haven't tested SteamVR, but I believe I have had customers who have. UniStorm works with both Oculus Rift and HTC Vive so I'm assuming it should work fine.
     
    boysenberry likes this.
  48. Candac59

    Candac59

    Joined:
    Sep 18, 2015
    Posts:
    106

    excuse me for putting together an old talk. If it's still possible I want an example file :) thank you in advance
     
  49. ethanwgross

    ethanwgross

    Joined:
    Jun 25, 2014
    Posts:
    83
    I am having an issue with the Auto Character Setup in Unity 2017.30f3 on Mac. Any time I select the option from the menu it immediately crashes unity! Any help would be appreciated.
     
  50. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Any ETA for the new version? I remember it was to be released on December, any new features delayed it? thank you