Search Unity

[RELEASED] Ultimate Survival - The Complete Survival Template

Discussion in 'Assets and Asset Store' started by AngryPixelUnity, Nov 20, 2016.

Thread Status:
Not open for further replies.
  1. UltraTM

    UltraTM

    Joined:
    Dec 8, 2013
    Posts:
    221
    When you take the low damage tools you can get really a lot more resources cause you get it for damage.
    maybe make it how much you can get of the resource with which tool.

    Would make sense then cause you take the good hatchet and get for example 20~30 wood and the stone/wood hatchet 10~15 Wood
     
    kurotatsu and AngryPixelUnity like this.
  2. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    I agree, added on Trello.
     
    siblingrivalry and UltraTM like this.
  3. siblingrivalry

    siblingrivalry

    Joined:
    Nov 25, 2014
    Posts:
    384
    Hehe yeh, I mentioned the same thing. I was rewarded for using my S***ty tool :D not a big thing to resolve though
     
    UltraTM likes this.
  4. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    I hope this asset is made so i can easy use other assets with it together or use other assets instead of some parts of this.
    For example if i would like to use another character controller asset instead of yours.
     
  5. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Hi. What character controller?
     
  6. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
  7. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
  8. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    I would like to have first and third but prefer third.
    With the above controller it is easy to have both and transform from first to third camera and back.

    Edit1:
    I am sorry, this can be easy made with his camera asset.

    Edit2:
    So at the moment i can only use first if i buy your asset now?
     
  9. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Ah, great. Well, definitely it's not going to be plug & play, we don't have an integration as of now with this asset, but it seems like a good addition, I'll add the integration on Trello: https://trello.com/b/gmNow8UL/ultimate-survival.
    However, it should be easy to make them work together, let me know if you have any questions. Can you code? This is my Skype id if you need help: cristian.pavel40
     
  10. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    There's no third person mode now, it'll come in 0.3. But it doesn't matter, your motion controller asset has one, you just have to integrate it in Ultimate Survival.
     
  11. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    If you're on Windows, install Team Viewer, I'll integrate it in 15 min max
     
  12. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Thank you for your offer :)
    I will try it at first myself if i buy it so i know it better.
     
    AngryPixelUnity likes this.
  13. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    +1, for a native third person setup.
     
  14. xamur

    xamur

    Joined:
    Mar 27, 2014
    Posts:
    109
    Congratulations for finally releasing this asset!
    Unfortunately, I don't have the money to purchase it this month. I hope I can buy it on 15 April and still have some money for real life stuff. As I can see it will cost 55$ after version 0.2, hopefully, it won't reach a higher price next month.

    At long last, I have to say that I appreciate that you are a very active and helfpul developer and even offer team viewer service. Keep up the good work and support, nice asset and nice developer!
     
    icetec, uni7y and AngryPixelUnity like this.
  15. wahyuway

    wahyuway

    Joined:
    Oct 7, 2013
    Posts:
    84
    @Winterbyte312
    I have an existing terrain 2kx2k with existing trees. How can i add Mineable tree to each of them?
    Thanks
     
  16. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    See the manual.
    See TheMessyCoder's tutorial on creating trees for the Terrain.
    Check out the Forest scene's terrain, how the TreeManager is set up.

    What you need to do:
    - Go to your terrain object, add the TreeManager script
    - Each tree prototype you added in the terrain tree list has an index, called by Unity " tree prototype index". The first tree prototype will have the index 0 for example.
    - On the Tree Manager script, you have a list which allows you to add a prefab at each tree position, automatically.
    - In that list, create an element for each tree prototype on your terrain.
    - As a prefab to instantiate at the tree position, search for "Empty Tree". This contains a collider and the MineableTree script.

    Now all the trees will be mineable and destroyable.
     
    stalkermustang likes this.
  17. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Will tree´s grow again after some time?
     
  18. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Not yet, we intend to add that later. Not difficult to add it though, you can do it yourself if your game requires it
     
  19. UltraTM

    UltraTM

    Joined:
    Dec 8, 2013
    Posts:
    221
    Regrow timer would be nice yes. Even for Coop and Multiplayer later also :)
     
  20. wahyuway

    wahyuway

    Joined:
    Oct 7, 2013
    Posts:
    84
    Thank you, now i understand a little about your asset :)
    This weekend i played around with gaia, gena, and aquas, it was really fun to experiment with :D
    I also tried to integrate with uNature, but it took a lot of work to include mineableobject to the unature pool item. I think i will wait for v0.2 to experiment with it again.
     

    Attached Files:

    AngryPixelUnity likes this.
  21. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    When I shoot with the bow, in unity and in the executable the game is frozen for a second.
    Does this happen to anyone else?

    It is as if the arrow is loaded in memory

    Sorry my inglish
     
  22. emperor12321

    emperor12321

    Joined:
    Jun 21, 2015
    Posts:
    52
    Can cannibals damage buildings/ steal items? Is their movement random or just waypoints? Looks like a good asset.
     
  23. Sorrowthief

    Sorrowthief

    Joined:
    Dec 14, 2016
    Posts:
    48
    I just bought this tonight and man is it a lot to take in. Well done pack here. For me I would love some intergrations. I was using UFPS on another project and just got so used to the FP character that its hard for me to love this one. Biggest issue I think is lack of custimazation on who you get to play. I hope you allow character custimazation in future realses or get some intergrations going with the other big names.

    Second, and I think this one would go really good with this pack is Ice Creature Control. I use it for most all of my AI animals and NPC's. I have not gotten in depth with what this system offers as far as AI but from first glance I would love it if I could easlity intergrate ICE with this.

    Im very excited to follow this and see how far you take it but doubt I will use it much until intergrations are made easier. Keep up the great work. Cheers!
     
    icetec likes this.
  24. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    I'm preparing a version 0.11 that will fix that. In the meantime, if you want to not get spikes, enable all the weapons at first, they will disable afterwards automatically. It happens only once though, because the objects have to be loaded in memory the first time.

    Hi, cannibals can't do that at the moment, their AI is simple, version 0.2 comes with a big update for AI. Their movement is based on waypoints, but the waypoints can be either placed manually, or generated automatically by the agent.

    I understand, and thank you. I'm adding the Ice integration in 0.2. About UFPS...we won't add integration with that for a couple reasons, the main one is, that I'm working right now on creating the same feeling for the controller and weapons, we're going to use a similar spring system for the motion. We're not happy with the controller in 0.1 either.
     
  25. Sorrowthief

    Sorrowthief

    Joined:
    Dec 14, 2016
    Posts:
    48
    Thats great news about Ice intergration, will be a game changer for me. I have spent a lot of time with Ice and it really has so many cool features if you take some time to learn it. I'm happy to hear that you will be reworking the FP controller. I did'nt mean to sound like your controller sucked in fact I thought the movements and animations were spot on. The biggest turn off for me is that I have put a great deal of work into a more modern style project and the UFPS FP controller just fit my theme more. I also use a lot of Mixamo characters and Intergrating them into UFPS and Ice was very simple.

    Looking forward to the changes. Thanks a lot. I can see this pack being huge.
     
    icetec likes this.
  26. MakeGames2

    MakeGames2

    Joined:
    May 23, 2016
    Posts:
    82
    This is a thing of beauty! Thank you so much!

    I have so many ideas that I thought I should probably share, so I'm sorry if this gets too long. I've only played around with it for a few hours but so far I can see how well organized it all is and how much work has gone into it. I hesitated at first because of how many times I've bought things and after using them for awhile they just didn't seem as good as they sounded in their description but I'm very glad I bought this so far because it is just as good or even better than it sounds in the description. This is what I've been looking for all this time. Amazing!

    I eagerly await the networking and UMA integration, along with all the other goodies I see on the roadmap. While I know you say you plan to only add co-op which is a great option, I'm also hoping to some day have dedicated servers that can run on Linux and host as many people as the server can handle. I'm sure this will be an often requested feature and if you don't intend to implement it then hopefully it isn't too difficult to do, even if I have to use another asset to do it properly without limits such as Forge Networking. I played around with the next version of UMA which is still being worked on, UMA 2.1, for the past few days or so and it is going to be absolutely amazing!

    The inventory system built into Ultimate Survival is already pretty versatile and simple to use so I'm not sure if I'd even have to integrate Inventory Pro into it but I do like the concept of currencies from Inventory Pro which doesn't seem to be in this, and NPC vendors, and banks and such but those seem like they would probably be pretty easy to add in Ultimate Survival, I haven't tried yet but it seems like it should be possible.

    I'm also curious what sort of performance optimizations, especially for the structures there will be. Players are bound to build some huge and complex things. For example in uConstruct they have what they call draw call batching and area of interest influence to help with optimization, among other things.

    I also wonder if you could add a simple option to make the run button a toggle similar to the crouch. I'm sure that would be simple to modify myself, but I'm going to try not messing with the code if I can help it, because I want to get the updates easily which sound very promising. Holding the shift key down to run everywhere eventually makes people's pinky finger sore.

    I'm curious if you plan to integrate prone as well, so you can lay on the ground and move that way too. Maybe pressing crouch twice would make you prone and pressing it twice would stand you back up, or you could press shift+crouch or have another input key assignable for stand so you can go immediately from prone or crouch to standing again. It would also be good if the AI couldn't detect you as easily while crouching or prone, or at a reduced range.

    Which brings me to the idea of modifier keys, so you can assign shift, ctrl, or alt in combination with other keys. It would then also be nice to have an interface that you can simply click the key combination once instead of having to pick them, or skip or scroll through them but that's not really a huge deal, except for maybe on the in-game menu when there's one.

    Also, what about punching? I didn't notice any way to punch.

    I noticed you had something on the roadmap for AI spawning so the player won't see them, but what about something like when AI spawn, especially if they're hostile, an option to not spawn them if a player is within a certain range of their spawn position, perhaps a little over aggroable range. It always sucks to have taken out a big group of mobs just to have them spawn on your back again while you're trying to loot them.

    Has anyone mentioned pets yet? That might be a nice thing to have. Pets that follow you around, that you can store items on, tell them to stay put, or even send them into combat.

    What about some other more RPG like aspects? Are you open to adding such things or are you keeping it strictly survival? For example levels, classes, skill points, talents, and so on? For classes you could have a tank, dps and healer sort of thing. Maybe I could just add certain items that can be geared towards that sort of thing but have a sort of class chooser from the character creation screen and then there could be a way to restrict which items each class can use. A skill point could be used to upgrade your skills, whatever those might be, maybe for example make you aim better or punch harder (if you add punching) or have a better chance to dodge, or critically hit, etc. Maybe if the player had stats like strength and agility it could be put towards those as well or instead. Or maybe it would have other things sort of like 7 days to die has for their skill system. Maybe leveling up could unlock more skills. Talents could give you additional skills or change how they work, though this could even just be part of the skill system too. Item stats already seem to exist (properties) so that's awesome.

    Finally, some issues I've noticed so far which I'm sure you will fix at some point. Sorry if people have already mentioned them (do you have a public issue tracker we can report things in like at Github?).
    • I cant seem to place stairs on multiple levels but only the first.
    • The items in the cheat list aren't sorted making it hard to find things. Maybe eventually you'll have a console interface with commands for enabling this sort of thing.
    • If I destroy a lower wall on a building other parts of the structure above it seem to also get destroyed when they probably realistically shouldn't. I could understand some of them also being destroyed in some cases though.
    • Torch flame is pink.
    • I got these errors when I was running along: http://pastebin.com/XPJ1PaCJ
    • I wish there was a way to double click, right click an item or click a button to click to equip them, and that the slots highlighted where to put them when dragging them over.

    I could probably keep going with ideas and whatnot for days but I'll stop now since it's already too long. Thank you for your time and for the wonderful asset!!!
     
    uni7y and AngryPixelUnity like this.
  27. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Wow! thank you for your in-depth review. I took the time and read everything, and also updated the Trello page.

    I will keep it short, out of everything you mentioned, the "rpg like aspects", most of them, won't be in the asset. We want to keep it more survival-ish, otherwise it'd get more complex than it needs to. Maybe skills, levels & classes will make sense in the multiplayer update, so I'll add them with a "???" sign at the end (meaning we're not sure).

    Everything else will be in 0.2 & 0.3. As I said, I updated the page, also added the issues in 0.11, which I'll submit soon.
    Thank you once again, I'm happy you appreciate the asset for what it really is, very constructive feedback!

    Maybe you can write a review on the store as well? Yours is actually the most accurate so far.
     
  28. MakeGames2

    MakeGames2

    Joined:
    May 23, 2016
    Posts:
    82
    Awesome! I really like the sounds of that.

    Maybe for some of the features, if I really want to add them, there will be ways I can hook into the code so I don't have to modify it. I've only looked at some of the code but it looks really clean and organized. Maybe if there aren't hooks already you could add hooks like the actions and filters system in WordPress. This would make it really easy to modify without having to hack core files so that it can be easily updated when a new version is released. Actions are probably kind of like events and can be added or removed or triggered. Filters can be used to modify or override variables or output text and whatnot. They can also have priorities so they run in order. Most people don't seem to take the time implement such things into their assets but I think it would make them exponentially better to work with if they did. Instead of just being a template you modify to your liking it could be a framework you can build on without worrying about having to merge code and everything whenever there's an update.

    I definitely intend to write a review on the store at some point. I spent so long writing that last post, I can probably even just copy some parts of it and I will definitely do that at some point. I did give it a 5 star rating on there at least which it certainly deserves, I'd give it 10 stars if I could because it exceeded my expectations by far :D
     
    AngryPixelUnity likes this.
  29. Dramamine0001

    Dramamine0001

    Joined:
    Mar 23, 2014
    Posts:
    84
    To add pretty much any of the additions you mentioned, you'll likely need to do a lot programming. This template is meant to provide learning/starting point for a basic survival game. It allows you add weapons and items easy. What you are talking about adding are entirely new features and systems, many from other game genres.
     
  30. MakeGames2

    MakeGames2

    Joined:
    May 23, 2016
    Posts:
    82
    Exactly. I'll definitely have to do a lot more programming and that isn't really an issue for me. But that's why I suggested adding some hooks in ;)
     
  31. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hello Sorrowthief, you are absolutely right, Ultimate Survival and ICE would be a great combination. Chris have already contact me and I hope we can offer our mutual customers a powerful integration solution soon.

    Have a great day!

    Pit
     
    yummybrainz and siblingrivalry like this.
  32. SpectralRook

    SpectralRook

    Joined:
    Feb 9, 2014
    Posts:
    112
    While waiting for the official ability to save in version 0.2, I created a script that will help do the job. It's not 100% plug and play; a few edits need to be made to existing Ultimate Survivor scripts. I created a video demonstrating the necessary changes. Unfortunately, I didn't record the audio but I think it's fairly self-explanatory. It's only setup to save Inventory, Hotbar and worn Equipment. However, you should be able to pretty much save anything you want by editing the script. If something is unclear about the setup just let me know.

    Note, towards the end of the video I noticed two bugs: 1) after removing the worn leather shirt, it continues to display on the character. 2) after creating a single plank, stopping the game, and starting again, the stack count is 99 where it should be 1. I've since fixed both of those bugs.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using System.IO;
    4. using System.Xml.Serialization;
    5. using UnityEngine;
    6. using UltimateSurvival;
    7. using UltimateSurvival.GUISystem;
    8.  
    9. namespace DT {
    10.     public class DT_SaveManager : MonoBehaviour {
    11.         /* A few notes regarding this script:
    12.             * Designed to only work with Ultimate Survivor Template version 0.1
    13.  
    14.             * Requires access to Lists<ItemHolder>'s in InventoryController script for inventory, hotbar and equipment.
    15.                  Add Get methods in InventoryController:
    16.                     public List<ItemHolder> GetInventoryCollection() { return m_InventoryCollection; }
    17.                     public List<ItemHolder> GetHotbarCollection() { return m_HotbarCollection; }
    18.  
    19.             * Requires access to RemoveItemsFromCollection in InventoryController script.
    20.                 Change to public:
    21.                     public void RemoveItemsFromCollection(string collection)
    22.  
    23.             * Requires access to list of equipment in CharacterEquipment script.
    24.                 Add to CharacterEquipment:
    25.                     [SerializeField] public EquipmentPiece[] EquipmentPieces { get { return m_EquipmentPieces; } set { m_EquipmentPieces = value; } }
    26.  
    27.             * In order to know the location for for worn Equipment, I added a Category field to the CharacterEquipment pieces.
    28.                  You will need to manually add the appropriate Category for each armor under In-Game GUI...Character. Add the following to CharacterEquipment script:
    29.                     public string Category { get { return m_Category; } }
    30.                     [SerializeField] private string m_Category;
    31.  
    32.             * Create empty gameobject in Hierarchy for DT_SaveManager.
    33.                 Attach DT_SaveManager script
    34.                 Assign Player, Inventory Controller and Character Equipment
    35.  
    36.              * Initial inventory is "seeded" in StartupItems script.
    37.                  Recommend adding the following to the end of StartupItems Start ():
    38.                     DT.DT_SaveManager.Instance.SaveManagerEnabled = true;
    39.                     DT.DT_SaveManager.Instance.Load ();
    40.  
    41.             * Dropping items do not cause the ItemHolder updated messages.
    42.                 Recommend adding the following to InventoryController before return true on Try_DropItem():
    43.                     DT.DT_SaveManager.Instance.Save ();
    44.  
    45.              * To avoid StartupItems generating a Save() for each item, recommend leaving SaveManagerEnabled bool = false.
    46.                 Note: To disable the ItemHolder updated message listeners, ChangeListenersEnabled bool = false.
    47.                     This will turn off the saving when any changes occur to collections. You will need to decide when to Save() rather than depending on messages;
    48.  
    49.              * DT.DT_SaveManager.Instance.Save (); can be called from anywhere you would like to perform a save.
    50.  
    51.             * DT.DT_SaveManager.Instance.Load (); can be called from anywhere you would like to perform a load.
    52.  
    53.         */
    54.         public static DT_SaveManager Instance { set; get; }
    55.         [SerializeField] private DT_SaveState state;
    56.  
    57.         public bool SaveManagerEnabled { set {saveManagerEnabled = value;} get {return saveManagerEnabled;} }
    58.         public bool StartSave { set {startSave = value;} }
    59.         public bool StartLoad { set {startLoad = value;} }
    60.  
    61.         public bool showLogging;
    62.         public bool changeListenersEnabled;
    63.  
    64.         [SerializeField] private string playerName = "Male_Player";
    65.         [SerializeField] private GameObject player;
    66.         [SerializeField] private InventoryController inventoryController;
    67.         [SerializeField] private CharacterEquipment characterEquipment;
    68.  
    69.         [SerializeField] private bool saveManagerEnabled;
    70.         [SerializeField] private bool startSave;
    71.         [SerializeField] private bool startLoad;
    72.  
    73.         private List<ItemHolder> inventoryCollection;
    74.         private List<ItemHolder> hotbarCollection;
    75.         private List<ItemHolder> equipmentHolders;
    76.  
    77.         private void Awake ()
    78.         {
    79.             state = new DT_SaveState ();
    80.             DontDestroyOnLoad (this.gameObject);
    81.             Instance = this;
    82.         }
    83.  
    84.         private void Start () {
    85.             inventoryController = player.GetComponentInChildren<InventoryController> ();
    86.             characterEquipment = GameObject.Find("In-Game GUI").GetComponentInChildren<CharacterEquipment> ();
    87.  
    88.             inventoryCollection = new List<ItemHolder>();
    89.  
    90.             if (changeListenersEnabled) {
    91.                 foreach (var holder in inventoryController.GetInventoryCollection ())
    92.                     holder.Updated.AddListener (On_InventoryChanged);
    93.  
    94.                 foreach (var holder in inventoryController.GetHotbarCollection ())
    95.                     holder.Updated.AddListener (On_HotbarChanged);
    96.  
    97.                 foreach (var holder in inventoryController.GetEquipmentHolders ())
    98.                     holder.Updated.AddListener (On_EquipmentChanged);
    99.             }
    100.         }
    101.  
    102.         // Can be used when detected inventory changes.
    103.         private void On_InventoryChanged(ItemHolder holder) {
    104.             if (saveManagerEnabled == true && startLoad == false && startSave == false) {
    105.                 inventoryCollection = inventoryController.GetInventoryCollection ();
    106.                 if (holder.CurrentItem) {
    107.                     if (showLogging) Debug.Log ("Inventory Changed: " + holder.CurrentItem.ItemData.Name) ;
    108.                     Save ();
    109.                 }
    110.             }          
    111.         }
    112.  
    113.         // Can be used when detected hotbar changes.
    114.         private void On_HotbarChanged(ItemHolder holder) {
    115.             if (saveManagerEnabled == true && startLoad == false && startSave == false) {
    116.                 hotbarCollection = inventoryController.GetHotbarCollection ();
    117.                 if (holder.CurrentItem) {
    118.                     if (showLogging) Debug.Log ("Hotbar Changed: " + holder.CurrentItem.ItemData.Name) ;
    119.                     Save ();
    120.                 }
    121.             }
    122.         }
    123.  
    124.         // Can be used when detected hotbar changes.
    125.         private void On_EquipmentChanged(ItemHolder holder) {
    126.             if (saveManagerEnabled == true && startLoad == false && startSave == false) {
    127.                 hotbarCollection = inventoryController.GetEquipmentHolders ();
    128.                 if (holder.CurrentItem) {
    129.                     if (showLogging) Debug.Log ("Equipment Changed: " + holder.CurrentItem.ItemData.Name) ;
    130.                     Save ();
    131.                 }
    132.             }
    133.         }
    134.  
    135.         public void Save () {
    136.             startSave = true;
    137.  
    138.             if (startLoad || saveManagerEnabled == false)
    139.                 return;
    140.  
    141.             if (player == null)
    142.                 player = GameObject.Find (playerName);
    143.  
    144.             if (player && inventoryController == null)
    145.                 inventoryController = player.GetComponentInChildren<InventoryController> ();
    146.  
    147.             if (inventoryController) {
    148.                 ItemData itemData = new ItemData();
    149.  
    150.                 if(state.inventoryCollection.Count>0)
    151.                     state.inventoryCollection.Clear ();
    152.  
    153.                 inventoryCollection = inventoryController.GetInventoryCollection ();
    154.                 for (int i = 0; i < inventoryCollection.Count; i++) {
    155.                     if (inventoryCollection [i] && inventoryCollection [i].CurrentItem) {
    156.                         itemData = inventoryCollection [i].CurrentItem.ItemData;
    157.                         DT_SaveItem saveItem = new DT_SaveItem ();
    158.                         saveItem.itemId = itemData.Id;
    159.                         saveItem.itemName = itemData.Name;
    160.                         saveItem.itemSlot = i;
    161.                         saveItem.itemStackSize = inventoryCollection[i].CurrentItem.CurrentInStack;
    162.                         state.inventoryCollection.Add (saveItem);
    163.                     }
    164.                 }
    165.  
    166.                 if(state.hotbarCollection.Count>0)
    167.                     state.hotbarCollection.Clear ();
    168.  
    169.                 hotbarCollection = inventoryController.GetHotbarCollection ();
    170.                 for (int i = 0; i < hotbarCollection.Count; i++) {
    171.                     if (hotbarCollection [i] && hotbarCollection [i].CurrentItem) {
    172.                         itemData = hotbarCollection [i].CurrentItem.ItemData;
    173.                         DT_SaveItem saveItem = new DT_SaveItem ();
    174.                         saveItem.itemId = itemData.Id;
    175.                         saveItem.itemName = itemData.Name;
    176.                         saveItem.itemSlot = i;
    177.                         saveItem.itemStackSize = hotbarCollection[i].CurrentItem.CurrentInStack;
    178.                         state.hotbarCollection.Add (saveItem);
    179.                     }
    180.                 }
    181.  
    182.                 if(state.equipmentHolders.Count>0)
    183.                     state.equipmentHolders.Clear ();
    184.  
    185.                 equipmentHolders = inventoryController.GetEquipmentHolders ();
    186.                 for (int i = 0; i < equipmentHolders.Count; i++) {
    187.                     if (equipmentHolders [i] && equipmentHolders [i].CurrentItem) {
    188.                         itemData = equipmentHolders [i].CurrentItem.ItemData;
    189.                         DT_SaveItem saveItem = new DT_SaveItem ();
    190.                         saveItem.itemId = itemData.Id;
    191.                         saveItem.itemName = itemData.Name;
    192.                         saveItem.itemSlot = i;
    193.                         saveItem.itemStackSize = equipmentHolders[i].CurrentItem.CurrentInStack;
    194.                         state.equipmentHolders.Add (saveItem);
    195.                     }
    196.                 }
    197.  
    198.                 PlayerPrefs.SetString ("save", DT_SaveUtilities.Serialize<DT_SaveState> (state));
    199.                 //PlayerPrefs.SetString ("save_us", JsonUtility.ToJson (state));
    200.  
    201.                 if (showLogging) Debug.Log ("Inventory Saved: " + inventoryCollection.Count + " / Hotbar Saved: " + hotbarCollection.Count + " / Equipment: Saved: "  + equipmentHolders.Count) ;
    202.             } else {
    203.                 Debug.LogError ("Unable to locate Inventory Controller");
    204.             }
    205.             startSave = false;
    206.         }
    207.  
    208.         public void Load() {
    209.             startLoad = true;
    210.             if (startSave || saveManagerEnabled == false)
    211.                 return;
    212.  
    213.             if(PlayerPrefs.HasKey("save")) {
    214.                 if (showLogging) Debug.Log ("Start Load");
    215.  
    216.                 if (player == null)
    217.                     player = GameObject.Find (playerName);
    218.  
    219.                 if (player && inventoryController == null)
    220.                     inventoryController = player.GetComponentInChildren<InventoryController> ();
    221.  
    222.                 if (inventoryController) {  
    223.                     state = DT_SaveUtilities.Deserialize<DT_SaveState> (PlayerPrefs.GetString ("save"));
    224.                     //state = JsonUtility.FromJson<DT_SaveState> (PlayerPrefs.GetString ("save_us"));
    225.  
    226.                     if (state.inventoryCollection.Count > 0) {
    227.                         inventoryController.RemoveItemsFromCollection ("Inventory");
    228.                         for (int i = 0; i < state.inventoryCollection.Count; i++) {
    229.                             int added;
    230.                             inventoryController.AddItemToCollection (state.inventoryCollection [i].itemName, state.inventoryCollection [i].itemStackSize, "Inventory", out added);
    231.                         }
    232.                         if (showLogging) Debug.Log ("Inventory Loaded: " + state.inventoryCollection.Count);
    233.                         inventoryCollection = inventoryController.GetInventoryCollection ();
    234.                     }
    235.  
    236.                     if (state.hotbarCollection.Count > 0) {
    237.                         inventoryController.RemoveItemsFromCollection ("Hotbar");
    238.                         for (int i = 0; i < state.hotbarCollection.Count; i++) {
    239.                             int added;
    240.                             inventoryController.AddItemToCollection (state.hotbarCollection [i].itemName, state.hotbarCollection [i].itemStackSize, "Hotbar", out added);
    241.                         }
    242.                         if (showLogging) Debug.Log ("Hotbar Loaded: " + state.hotbarCollection.Count);
    243.                     }
    244.  
    245.                     if (state.equipmentHolders.Count > 0) {
    246.                         inventoryController.RemoveItemsFromCollection ("Equipment");
    247.                         for (int i = 0; i < state.equipmentHolders.Count; i++) {
    248.                             int added;
    249.  
    250.                             foreach (var piece in characterEquipment.EquipmentPieces) {
    251.                                 if (piece.ItemName == state.equipmentHolders [i].itemName) {
    252.                                     var wrapper = GUIController.Instance.GetContainer (piece.Category);
    253.                                     foreach (var slot in wrapper.Slots) {
    254.                                         bool wasAdded = false;
    255.                                         ItemData itemData;
    256.  
    257.                                         if (inventoryController.Database.FindItemById (state.equipmentHolders [i].itemId, out itemData)) {
    258.                                             wasAdded = slot.ItemHolder.TryAddItem (itemData, state.equipmentHolders [i].itemStackSize, out added);
    259.                                             //SavableItem item = new SavableItem (itemData, state.equipmentHolders [i].itemStackSize);
    260.                                             //slot.ItemHolder.SetItem (item);
    261.                                             piece.CorrespondingHolder = slot.ItemHolder;
    262.                                             piece.Object.SetActive (true);
    263.                                         }
    264.  
    265.                                         if (showLogging) Debug.Log ("Found Armor and worn: " + piece.ItemName + " " + piece.Category);
    266.  
    267.  
    268.  
    269.                                     }
    270.                                 }
    271.                             }
    272.                         }
    273.                         if (showLogging) Debug.Log ("Equipment Loaded: " + state.equipmentHolders.Count);
    274.                     }
    275.  
    276.                     if (showLogging) Debug.Log (DT_SaveUtilities.Serialize<DT_SaveState> (state));
    277.                     //if (showLogging) Debug.Log (JsonUtility.ToJson (state));
    278.                 }
    279.             } else {
    280.                 state = new DT_SaveState ();
    281.                 Save ();
    282.                 if (showLogging) Debug.Log ("Creating Initial Save State");
    283.             }
    284.  
    285.             startLoad = false;
    286.         }
    287.     }
    288.      
    289.     public class DT_SaveState {
    290.         public string player = "Male_Player";
    291.         public List<DT_SaveItem> inventoryCollection = new List<DT_SaveItem>();
    292.         public List<DT_SaveItem> hotbarCollection = new List<DT_SaveItem>();
    293.         public List<DT_SaveItem> equipmentHolders = new List<DT_SaveItem>();
    294.     }
    295.      
    296.     public class DT_SaveItem {
    297.         public int itemSlot { get; set; }
    298.         public string itemName { get; set; }
    299.         public int itemId { get; set; }
    300.         public int itemStackSize { get; set; }
    301.     }
    302.  
    303.     public static class DT_SaveUtilities {
    304.         public static string Serialize<T>(this T toSerialize) {
    305.             XmlSerializer xml = new XmlSerializer (typeof(T));
    306.             StringWriter writer = new StringWriter ();
    307.             xml.Serialize (writer, toSerialize);
    308.  
    309.             return writer.ToString ();
    310.         }
    311.  
    312.         public static T Deserialize<T>(this string toDeserialize) {
    313.             XmlSerializer xml = new XmlSerializer (typeof(T));
    314.             StringReader reader = new StringReader (toDeserialize);
    315.  
    316.             return (T)xml.Deserialize (reader);
    317.         }
    318.     }
    319. }
    320.  

     
  33. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    SpectralRook, thank you very much for sharing your script
     
  34. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    I do not know if this has been commented before, but when I destroy a foundation the doors do not disappear like the rest of structures.

    Is it a bug?

     
  35. siblingrivalry

    siblingrivalry

    Joined:
    Nov 25, 2014
    Posts:
    384
    Hi Pit,
    That is great news. As a happy customer of both, I am pleased as punch.
     
  36. ChadWoodworth

    ChadWoodworth

    Joined:
    Feb 14, 2016
    Posts:
    30
    First of all, thank you for this great asset. I think a lot of people are finally going to get what they want to jumpstart their survival game projects. With that being said, I am not making a survival game. It's more of a simulator and I don't expect you to consider my requests because you have more then enough from your target audience. I do however, have a few questions/requests I want to throw at you (WinterByte) to see if I can get some help.

    1. I have managed to integrate most of my project with the Ultimate Survival asset. I even have vehicles working with ease and might make a quick tutorial on how I did it. The one thing I am having trouble is adding a state that will allow the player to pickup and throw rigid body objects. I used similar methods with the generic FPS character, UFPS, and a few others but the mouse/ray click seems to break with this one. Is this going to be an option for the playercontroller in the future or do I have to code it from scratch?

    2. Is the day/night cycle going to be improved on... maybe weather... or maybe and option to use a different asset? Right now it does not like when I use a different system. I don't have a problem using my own weather system, but I don't really want to spend hours if the native system will function and produce the results I want.

    3. I had a few issues integrating EasySave, but nothing that can't be fixed down the road. I saw that you were planning on providing a save/load function. Are you aiming to create a database style save or trying to capture the scene?

    Sorry for the strange and specific request, but I am just trying to get a feel if I want to go any further with this asset since I already made it so far without it.
     
  37. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    Another bug?

    If I create a campfire, and put it on the terrain, when I select the construction map, I can put it terrain, if I have stones in my inventory.

     
  38. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Wow, the island looks cool!
    I thought I solved that before submitting 0.1, no problem, it'll be fixed in v0.11. I want to submit it today.
     
  39. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Hi!

    1.We'll add this ability in 0.2, it seems like a must-have. In the meantime, see the RaycastManager & PlayerEventHandler scripts, they're the only ones you have to mess with.

    2.The day night cycle will be improved, but probably not soon, I think in 0.4, when we'll have the time. Ah, and I almost forgot, we want to integrate Time Of Day or something similar in 0.2, I forgot to add it on Trello I think.

    3.Save & load coming in 0.2

    Can you please explain, or post some screenshots with the errors or something, on why the 1st and 3rd things didn't work in Ultimate Survival? I need to get rid of the problems asap, or to make things easier for them to happen.

    Thanks.
     
  40. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    perfect! Thx!
     
  41. SpectralRook

    SpectralRook

    Joined:
    Feb 9, 2014
    Posts:
    112
    If you would like to add the items back to their original locations on Load(), you can make the following additional changes:

    Code (CSharp):
    1. //DT - Tries to add an amount of items in a specific collection to a specific slot.

    2.         public static void AddItem(ItemData itemData, int amount, int slotNumber, List<Slot> slots, out int added, List<ItemProperty.Value> customPropertyValues = null) {
    3.             added = 0;
    4.  
    5.             // Try to add item(s) to specific slot.
    6.             if (slotNumber >= 0 && slotNumber <= slots.Count) {
    7.                 int addedNow;
    8.                 slots [slotNumber].ItemHolder.TryAddItem (itemData, amount, out addedNow, customPropertyValues);
    9.                 added += addedNow;
    10.                 amount -= addedNow;
    11.             }
    12.  
    13.             // If there are more items to add, go through each slot and see where we can add the item(s).
    14.             for(int i = 0;i < slots.Count;i ++)
    15.             {
    16.                 int addedNow;
    17.  
    18.                 // We added all the items, we can stop now.
    19.                 if (amount == 0)
    20.                     break;
    21.                
    22.                 slots[i].ItemHolder.TryAddItem(itemData, amount, out addedNow, customPropertyValues);
    23.                 added += addedNow;
    24.                 amount -= addedNow;
    25.             }
    26.         }
    27.  

    Code (CSharp):
    1.         //DT - Tries to add an amount of items in this collection to a specific slot.
    2.         public bool TryAddItem(ItemData itemData, int amount, int slotNumber, out int added) {
    3.             added = 0;
    4.             CollectionUtils.AddItem(itemData, amount, slotNumber, Slots, out added);
    5.  
    6.             return added > 0;
    7.         }

    Code (CSharp):
    1.         public bool AddItemToCollection(string itemName, int amount, int slotNumber, string collection, out int added) {
    2.             added = 0;
    3.  
    4.             if(!enabled)
    5.                 return false;
    6.  
    7.             for(int i = 0;i < m_AllCollections.Length;i ++) {
    8.                 if(m_AllCollections[i].Name == collection) {
    9.                     // Will be true if at least one item was added.
    10.                     bool wasAdded = false;
    11.                     ItemData itemData;
    12.  
    13.                     if(m_ItemDatabase.FindItemByName(itemName, out itemData))
    14.                         wasAdded = m_AllCollections[i].TryAddItem(itemData, amount, slotNumber, out added);
    15.  
    16.                     return wasAdded;
    17.                 }
    18.             }
    19.  
    20.             Debug.LogWarningFormat(this, "No collection with the name '{0}' was found! No item added.", collection);
    21.             return false;
    22.         }

    Code (CSharp):
    1. //Change the references to “inventoryController.AddItemToCollection(“ in DT_SaveManager.cs to add slotNumber parameter
    2. inventoryController.AddItemToCollection (state.inventoryCollection [i].itemName, state.inventoryCollection [i].itemStackSize,  "Inventory", out added);
    3. //should look like,
    4. inventoryController.AddItemToCollection (state.inventoryCollection [i].itemName, state.inventoryCollection [i].itemStackSize, state.inventoryCollection[i].itemSlot, "Inventory", out added);
    5.  
    6. inventoryController.AddItemToCollection (state.hotbarCollection [i].itemName, state.hotbarCollection [i].itemStackSize, "Hotbar", out added);
    7. //should look like,
    8. inventoryController.AddItemToCollection (state.hotbarCollection [i].itemName, state.hotbarCollection [i].itemStackSize, state.hotbarCollection[i].itemSlot, "Hotbar", out added);
     
    wahyuway and AngryPixelUnity like this.
  42. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    how make ai animals?
     
  43. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Hi :)
    To add new animals you'll have to study the current boar & chicken. Copy and paste the components from the built-in animals, to your new animal. Unfortunately I only made it easy to create humanoid AI, with a special wizard, we don't have anything to help you in creating animals faster, at the moment.

    BUT, we're bringing a big update to the AI in version 0.2, you'll be able to create animals very fast. On top of that, I plan on creating video tutorials and expanding the documentation.

    I'm sorry but for now you'll have to mess a bit with the current animals, to learn how they work.

    If you don't know your way around Unity well enough, wait for 0.2 :) Otherwise you can do as I said, study the current animals and copy-paste their components.
     
    uni7y likes this.
  44. zombieslayer420

    zombieslayer420

    Joined:
    Dec 31, 2016
    Posts:
    31
    can you add a crafting bench where you can make some items so in the item manager it will have a option where you can put the crafting recipe in a workbench
     
  45. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    You mean like Minecraft?
     
    zombieslayer420 likes this.
  46. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    I just finished v0.11, which fixes a few important bugs and glitches:

    Taken from Trello: https://trello.com/c/v57f42Wd/83-0-1x:
    - Starting the game with the GUI windows disabled
    - Solve the spikes in weapons
    - Torch flame is pink
    - Being able to control a Tool's efficiency (how many items can it loot)
    - Add negative health changing for consumables
    - Correct the sleeping bag rotation offset
    - Cant seem to place stairs on multiple levels but only the first.
    - Door floating bug
    - Campfire bug

    I'll start uploading and then submit it.
     
    wahyuway and TheMessyCoder like this.
  47. TheMessyCoder

    TheMessyCoder

    Joined:
    Feb 13, 2017
    Posts:
    522

    Awesome Bug Fixes!!!
     
    AngryPixelUnity likes this.
  48. TheMessyCoder

    TheMessyCoder

    Joined:
    Feb 13, 2017
    Posts:
    522
    Hi Guys,

    I forgot to mention that Tutorial 6 on how to add humanoid NPCs is live on youtube.




    I was going to do the placeable containers next, before moving on to custom prefabs for buildings.
    But I have been getting emails and messages asking about Animal NPCs so I will try to do a quick one.

    Okay, yeh I know quick videos arnt really what I am good at :)

    I am also going to show how you can get UMA in to your game as I have been playing with this in my spare time.
     
  49. TheMessyCoder

    TheMessyCoder

    Joined:
    Feb 13, 2017
    Posts:
    522
    Oh and if I could ask a small favour, if you like any of the videos, pop up over to youtube and click on the like button.

    If you have even more time it would be great to drop a comment with any feedback, ideas or requests for future videos.

    This is a fantastic asset and I am having such a great time exploring it. I cannot wait to see what amazing games this community will be making
     
  50. Firesoft

    Firesoft

    Joined:
    Dec 20, 2016
    Posts:
    308
    People who already bought this kit dont pay for the updates..

    But i still will give you 5$ per Big Update :)
     
    evilangel89 and AngryPixelUnity like this.
Thread Status:
Not open for further replies.