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. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    To make it go away, find the prefab (eg. the arrow prefab), and attach the ObjectDestructor script to it.

    Thank you :)
     
  2. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    should not that be managed by the plugin using an object pool instead ? Why making things more complicated for users ?
    This is the same principle for arrows or anything, having some pool manager you can keep the last fired ones on the scene, when you reach the limit it deletes old ones before adding the new one.
     
    Tethys likes this.
  3. hsxtreme

    hsxtreme

    Joined:
    Apr 14, 2017
    Posts:
    55
     
  4. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    327
    Thank you :)
     
  5. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    It should be managed by the pooling manager yes, and it was, but I disabled the manager in v0.11 because of a bug.
    I gave him a quick fix. It'll be fixed in v0.12 (I'm working on it at the moment), it'll also be compatible with Unity 5.6.
    _____________________________________________________________________


    Hmm, make sure you copy pasted the entire thing. Otherwise here it is, again:

    Code (CSharp):
    1. using System;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Random = UnityEngine.Random;
    5. using UltimateSurvival.GUISystem;
    6.  
    7. namespace UltimateSurvival
    8. {
    9.     /// <summary>
    10.     ///
    11.     /// </summary>
    12.     public class InventoryController : MonoSingleton<InventoryController>
    13.     {
    14.         /// <summary></summary>
    15.         public Value<ET.InventoryState> State = new Value<ET.InventoryState>(ET.InventoryState.Closed);
    16.  
    17.         /// <summary></summary>
    18.         public Attempt<ET.InventoryState> SetState = new Attempt<ET.InventoryState>();
    19.  
    20.         /// <summary></summary>
    21.         public Attempt<SmeltingStation> OpenFurnace = new Attempt<SmeltingStation>();
    22.  
    23.         /// <summary></summary>
    24.         public Attempt<SmeltingStation> OpenCampfire = new Attempt<SmeltingStation>();
    25.  
    26.         /// <summary></summary>
    27.         public Attempt<LootObject> OpenLootContainer = new Attempt<LootObject>();
    28.      
    29.         /// <summary></summary>
    30.         public Attempt<Anvil> OpenAnvil = new Attempt<Anvil>();
    31.  
    32.         /// <summary>This is an attempt to add a new item to the crafting queue.</summary>
    33.         public Attempt<CraftData> CraftItem = new Attempt<CraftData>();
    34.  
    35.         /// <summary></summary>
    36.         public Message<ItemHolder> EquipmentChanged = new Message<ItemHolder>();
    37.  
    38.         /// <summary>Is the inventory closed?</summary>
    39.         public bool IsClosed { get { return State.Is(ET.InventoryState.Closed); } }
    40.  
    41.         /// <summary>Stores all the item and recipe definitions.</summary>
    42.         public ItemDatabase Database { get { return m_ItemDatabase; } }
    43.  
    44.         [SerializeField]
    45.         [Tooltip("The inventory cannot function without this, as some operations, like ADD, LOAD require a database.")]
    46.         private ItemDatabase m_ItemDatabase;
    47.  
    48.         [SerializeField]
    49.         private bool m_RemoveItemsOnDeath;
    50.  
    51.         [Header("Item Collections")]
    52.  
    53.         [SerializeField]
    54.         [Range(1, 128)]
    55.         private int m_InventorySize = 24;
    56.  
    57.         [SerializeField]
    58.         [Range(1, 24)]
    59.         private int m_HotbarSize = 6;
    60.  
    61.         [SerializeField]
    62.         [Reorderable]
    63.         private ReorderableStringList m_EquipmentList;
    64.  
    65.         [Header("Item Drop")]
    66.  
    67.         [SerializeField]
    68.         private Vector3 m_DropOffset = new Vector3(0f, 0f, 0.8f);
    69.  
    70.         [SerializeField]
    71.         private float m_DropAngularFactor = 150f;
    72.  
    73.         [SerializeField]
    74.         private float m_DropSpeed = 8f;
    75.  
    76.         private PlayerEventHandler m_Player;
    77.         private ItemContainer[] m_AllCollections;
    78.         private float m_LastTimeToggledInventory;
    79.  
    80.         private List<ItemHolder> m_InventoryCollection;
    81.         private List<ItemHolder> m_HotbarCollection;
    82.         private List<ItemHolder> m_EquipmentHolders;
    83.  
    84.  
    85.         /// <summary>
    86.         /// Tries to add an amount of items in a certain collection.
    87.         /// </summary>
    88.         /// <param name="itemID"> The name of the item you want to add. </param>
    89.         /// <param name="amount"> How many items of this type you want to add?. </param>
    90.         /// <param name="collection"> Name the collection in which you want the item to be added, eg."Inventory". </param>
    91.         /// <param name="added"> This value represents the amount of items were added, if the collection was almost full, some of the items might've not been added. </param>
    92.         public bool AddItemToCollection(int itemID, int amount, string collection, out int added)
    93.         {
    94.             added = 0;
    95.  
    96.             if(!enabled)
    97.                 return false;
    98.          
    99.             for(int i = 0;i < m_AllCollections.Length;i ++)
    100.             {
    101.                 if(m_AllCollections[i].Name == collection)
    102.                 {
    103.                     // Will be true if at least one item was added.
    104.                     bool wasAdded = false;
    105.                     ItemData itemData;
    106.  
    107.                     if(m_ItemDatabase.FindItemById(itemID, out itemData))
    108.                         wasAdded = m_AllCollections[i].TryAddItem(itemData, amount, out added);
    109.  
    110.                     return wasAdded;
    111.                 }
    112.             }
    113.  
    114.             Debug.LogWarningFormat(this, "No collection with the name '{0}' was found! No item added.", collection);
    115.             return false;
    116.         }
    117.  
    118.         /// <summary>
    119.         /// Tries to add an amount of items in a certain collection.
    120.         /// </summary>
    121.         /// <param name="itemID">The id of the item you want to add.</param>
    122.         /// <param name="amount">How many items of this type you want to add?.</param>
    123.         /// <param name="collection">Name the collection in which you want the item to be added, eg."Inventory".</param>
    124.         /// <param name="added">This value represents the amount of items were added, if the collection was almost full, some of the items might've not been added.</param>
    125.         public bool AddItemToCollection(string itemName, int amount, string collection, out int added)
    126.         {
    127.             added = 0;
    128.  
    129.             if(!enabled)
    130.                 return false;
    131.  
    132.             for(int i = 0;i < m_AllCollections.Length;i ++)
    133.             {
    134.                 if(m_AllCollections[i].Name == collection)
    135.                 {
    136.                     // Will be true if at least one item was added.
    137.                     bool wasAdded = false;
    138.                     ItemData itemData;
    139.  
    140.                     if(m_ItemDatabase.FindItemByName(itemName, out itemData))
    141.                         wasAdded = m_AllCollections[i].TryAddItem(itemData, amount, out added);
    142.  
    143.                     return wasAdded;
    144.                 }
    145.             }
    146.  
    147.             Debug.LogWarningFormat(this, "No collection with the name '{0}' was found! No item added.", collection);
    148.             return false;
    149.         }
    150.  
    151.         public int GetItemCount(string name)
    152.         {
    153.             // TODO: We shouldn't have access to GUI functions here.
    154.             return GUIController.Instance.GetContainer("Inventory").GetItemCount(name);
    155.         }
    156.  
    157.         /// <summary>
    158.         /// Removes the item if it exists in the inventory, if not, the method will return false.
    159.         /// </summary>
    160.         public bool TryRemoveItem(SavableItem item)
    161.         {
    162.             if(!enabled)
    163.                 return false;
    164.          
    165.             for(int i = 0;i < m_AllCollections.Length;i ++)
    166.             {
    167.                 bool removed = m_AllCollections[i].TryRemoveItem(item);
    168.                 if(removed)
    169.                     return true;
    170.             }
    171.  
    172.             return false;
    173.         }
    174.  
    175.         public void RemoveItems(string itemName, int amount = 1)
    176.         {
    177.             // TODO: We shouldn't have access to GUI functions here.
    178.             var inventory = GUIController.Instance.GetContainer("Inventory");
    179.             inventory.RemoveItems(itemName, amount);
    180.         }
    181.  
    182.         public bool Try_DropItem(SavableItem item, Slot parentSlot = null)
    183.         {
    184.             if(item && item.ItemData.WorldObject && !item.ItemData.IsBuildable)
    185.             {
    186.                 var cameraTransform = GameController.WorldCamera.transform;
    187.                 GameObject droppedItem = Instantiate(item.ItemData.WorldObject, cameraTransform.position + cameraTransform.TransformVector(m_DropOffset), Random.rotation) as GameObject;
    188.  
    189.                 var rigidbody = droppedItem.GetComponent<Rigidbody>();
    190.                 if(rigidbody)
    191.                 {
    192.                     rigidbody.angularVelocity = Random.rotation.eulerAngles * m_DropAngularFactor;
    193.                     rigidbody.AddForce(cameraTransform.forward * m_DropSpeed, ForceMode.VelocityChange);
    194.  
    195.                     Physics.IgnoreCollision(m_Player.GetComponent<Collider>(), droppedItem.GetComponent<Collider>());
    196.                 }
    197.  
    198.                 var pickup = droppedItem.GetComponent<ItemPickup>();
    199.                 if(pickup)
    200.                     pickup.ItemToAdd = item;
    201.  
    202.                 if(parentSlot)
    203.                     parentSlot.ItemHolder.SetItem(null);
    204.  
    205.                 return true;
    206.             }
    207.  
    208.             return false;
    209.         }
    210.  
    211.         public List<ItemHolder> GetEquipmentHolders()
    212.         {
    213.             return m_EquipmentHolders;
    214.         }
    215.  
    216.         private void Awake()
    217.         {
    218.             if(!m_ItemDatabase)
    219.             {
    220.                 Debug.LogError("No ItemDatabase specified, the inventory will be disabled!", this);
    221.                 enabled = false;
    222.                 return;
    223.             }
    224.  
    225.             SetState.SetTryer(TryChange_State);
    226.  
    227.             // TODO: We shouldn't have access to GUI functions here.
    228.             m_AllCollections = GUIController.Instance.Containers;
    229.  
    230.             // Create the inventory.
    231.             // TODO: We shouldn't have access to GUI functions here.
    232.             m_InventoryCollection = CreateListOfHolders(m_InventorySize);
    233.             var inventoryCollection = GUIController.Instance.GetContainer("Inventory");
    234.             inventoryCollection.Setup(m_InventoryCollection);
    235.  
    236.             // Create the hotbar.
    237.             // TODO: We shouldn't have access to GUI functions here.
    238.             m_HotbarCollection = CreateListOfHolders(m_HotbarSize);
    239.             var hotbarCollection = GUIController.Instance.GetContainer("Hotbar");
    240.             hotbarCollection.Setup(m_HotbarCollection);
    241.  
    242.             // Create the equipment.
    243.             // TODO: We shouldn't have access to GUI functions here.
    244.             m_EquipmentHolders = CreateListOfHolders(m_EquipmentList.Count);
    245.             for(int i = 0;i < m_EquipmentList.Count;i ++)
    246.             {
    247.                 var equipmentGUI = GUIController.Instance.GetContainer(m_EquipmentList[i]);
    248.                 if(equipmentGUI)
    249.                     equipmentGUI.Setup(new List<ItemHolder>() { m_EquipmentHolders[i] });
    250.                 else
    251.                     Debug.LogErrorFormat(this, "No GUI collection with the name '{0}' was found!", m_EquipmentList[i]);
    252.             }
    253.  
    254.             m_Player = GameController.LocalPlayer;
    255.             m_Player.ChangeHealth.AddListener(OnChanged_PlayerHealth);
    256.             m_Player.Death.AddListener(On_PlayerDeath);
    257.         }
    258.  
    259.         private void OnChanged_PlayerHealth(HealthEventData data)
    260.         {
    261.             if(data.Delta < 0f)
    262.                 for(int i = 0; i < m_EquipmentHolders.Count; i ++)
    263.                 {
    264.                     if(m_EquipmentHolders[i].HasItem && m_EquipmentHolders[i].CurrentItem.HasProperty("Durability"))
    265.                     {
    266.                         var durabilityProp = m_EquipmentHolders[i].CurrentItem.GetPropertyValue("Durability");
    267.                         var floatVal = durabilityProp.Float;
    268.                         floatVal.Current --;
    269.  
    270.                         durabilityProp.SetValue(ItemProperty.Type.Float, floatVal);
    271.  
    272.                         if(floatVal.Current <= 0f)
    273.                             m_EquipmentHolders[i].SetItem(null);
    274.                     }
    275.                 }
    276.         }
    277.  
    278.         private void On_PlayerDeath()
    279.         {
    280.             if(State.Get() != ET.InventoryState.Closed)
    281.                 SetState.Try(ET.InventoryState.Closed);
    282.  
    283.             if(m_RemoveItemsOnDeath)
    284.             {
    285.                 RemoveItemsFromCollection("Inventory");
    286.                 RemoveItemsFromCollection("Hotbar");
    287.  
    288.                 foreach(var col in m_EquipmentList)
    289.                     RemoveItemsFromCollection(col);
    290.             }
    291.         }
    292.  
    293.         private void RemoveItemsFromCollection(string collection)
    294.         {
    295.             // TODO: We shouldn't have access to GUI functions here.
    296.             var wrapper = GUIController.Instance.GetContainer(collection);
    297.  
    298.             if(!wrapper)
    299.                 return;
    300.  
    301.             foreach(var slot in wrapper.Slots)
    302.             {
    303.                 if(slot.HasItem)
    304.                     slot.ItemHolder.SetItem(null);
    305.             }
    306.         }
    307.  
    308.         private void DropItemsFromCollection(string collection)
    309.         {
    310.             var container = GUIController.Instance.GetContainer(collection);
    311.  
    312.             if(!container)
    313.                 return;
    314.  
    315.             foreach(var slot in container.Slots)
    316.             {
    317.                 if(slot.HasItem)
    318.                 {
    319.                     if(slot.CurrentItem.ItemData.IsBuildable)
    320.                         slot.ItemHolder.SetItem(null);
    321.                     else
    322.                         Try_DropItem(slot.CurrentItem, slot);
    323.                 }
    324.             }
    325.         }
    326.  
    327.         private bool TryChange_State(ET.InventoryState state)
    328.         {
    329.             bool stateWasChanged = false;
    330.  
    331.             if(Time.time > m_LastTimeToggledInventory + 0.5f)
    332.             {
    333.                 m_LastTimeToggledInventory = Time.time;
    334.                 stateWasChanged = true;
    335.             }
    336.              
    337.             if(stateWasChanged)
    338.             {
    339.                 State.Set(state);
    340.                 UnityEngine.EventSystems.EventSystem.current.SetSelectedGameObject(null);
    341.             }
    342.  
    343.             return stateWasChanged;
    344.         }
    345.  
    346.         private List<ItemHolder> CreateListOfHolders(int size)
    347.         {
    348.             var slots = new List<ItemHolder>();
    349.  
    350.             for(int i = 0;i < size;i ++)
    351.                 slots.Add(new ItemHolder());
    352.  
    353.             return slots;
    354.         }
    355.     }
    356. }
    357.  
     
    TheSeawolf and zenGarden like this.
  6. Atom-RRR

    Atom-RRR

    Joined:
    Apr 27, 2017
    Posts:
    1
    Hi,

    I can't run the demo at my Mac

     
  7. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    132
    1. I'm aware of the InventoryController, but what I want is to have items in the slot, but nothing in the hands of the player when I start. At the moment the player always starts with the item in the first slot if count is > 0.
    2. Not needed if 1 is doing what I want.
    3. Thanks for looking at it. It works in the forest demo, but not in my project.
    4. I looked at the FootstepPlayer script and added some things, seems to work like expected. This way all foot related sounds can be routed to one mixer channel. Added a CrouchVolumeFactor as well.
      Code (CSharp):
      1. using UnityEngine;
      2. using UnityEngine.Audio;
      3.  
      4. namespace UltimateSurvival
      5. {
      6.     /// <summary>
      7.     ///
      8.     /// </summary>
      9.     public enum FootType { Left, Right }
      10.  
      11.     /// <summary>
      12.     /// Will play a footstep sound when the character travels enough distance on a surface.
      13.     /// </summary>
      14.     public class FootstepPlayer : PlayerBehaviour
      15.     {
      16.         [Header("General")]
      17.  
      18.         [SerializeField]
      19.         private ItemSelectionMethod m_FootstepSelectionMethod;
      20.  
      21.         [SerializeField]
      22.         private float m_LandSpeedThreeshold = 3f;
      23.  
      24.         [SerializeField]
      25.         private LayerMask m_Mask;
      26.  
      27.         [SerializeField]
      28.         private AudioSource m_AudioSource;
      29.        
      30.         // added by Frank
      31.         [SerializeField]
      32.         private AudioMixerGroup m_Output;
      33.        
      34.         [Header("Distance Between Steps")]
      35.  
      36.         [SerializeField]
      37.         private float m_WalkStepLength = 1.7f;  
      38.  
      39.         [SerializeField]
      40.         private float m_RunStepLength = 2f;      
      41.  
      42.         [Header("Volume Factors")]
      43.  
      44.         // added by Frank
      45.         [SerializeField]
      46.         private float m_CrouchVolumeFactor = 0.25f;  
      47.  
      48.         [SerializeField]
      49.         private float m_WalkVolumeFactor = 0.5f;  
      50.  
      51.         [SerializeField]
      52.         private float m_RunVolumeFactor = 1f;              
      53.  
      54.         private AudioSource m_LeftFootSource;              
      55.         private AudioSource m_RightFootSource;  
      56.         private FootType m_LastFroundedFoot;  
      57.         private float m_AccumulatedDistance;
      58.  
      59.  
      60.         private void Start()
      61.         {
      62.             // Make sure we get notified when the player jumps or lands.
      63.             Player.Jump.AddStartListener(OnStart_PlayerJump);
      64.             Player.Land.AddListener(On_PlayerLanded);
      65.  
      66.             m_LeftFootSource = GameController.Audio.CreateAudioSource("Left Foot Footstep", transform, new Vector3(-0.2f, 0f, 0f), false, 1f, 3f);
      67.             m_RightFootSource = GameController.Audio.CreateAudioSource("Right Foot Footstep", transform, new Vector3(0.2f, 0f, 0f), false, 1f, 3f);
      68.             // added by Frank
      69.             m_AudioSource.outputAudioMixerGroup = m_LeftFootSource.outputAudioMixerGroup = m_RightFootSource.outputAudioMixerGroup = m_Output;
      70.         }
      71.  
      72.         private void FixedUpdate()
      73.         {
      74.             // Don't do anything if the player isn't grounded.
      75.             if(!Player.IsGrounded.Get())
      76.                 return;
      77.  
      78.             // Update the distance accumulated based on the player's current speed.
      79.             m_AccumulatedDistance += Player.Velocity.Get().magnitude * Time.fixedDeltaTime;
      80.  
      81.             // Get the step distance we should aim for, is different for crouching, walking and sprinting.
      82.             float stepDistance = GetStepLength();
      83.  
      84.             // If we accumulated enough distance since the last footstep, play the sound and reset the counter.
      85.             if(m_AccumulatedDistance > stepDistance)
      86.             {
      87.                 PlayFootstep();
      88.                 m_AccumulatedDistance = 0f;
      89.             }
      90.         }
      91.  
      92.         /// <summary>
      93.         /// This method will play a footstep sound based on the selected method, and at a specific volume.
      94.         /// </summary>
      95.         private void PlayFootstep()
      96.         {
      97.             var data = GetDataFromBelow();
      98.             if(data == null)
      99.                 return;
      100.  
      101.             // Alternate which audio source should be used (left foot or right foot).
      102.             AudioSource targetSource = null;
      103.             targetSource = (m_LastFroundedFoot == FootType.Left ? m_RightFootSource : m_LeftFootSource);
      104.             m_LastFroundedFoot = (m_LastFroundedFoot == FootType.Left ? FootType.Right : FootType.Left);
      105.  
      106.             // Get the volumeFactor (it is different for crouching, walking and sprinting, for example when crouching the volume should be low).
      107.             float volumeFactor = GetVolumeFactor();
      108.        
      109.             data.PlaySound(m_FootstepSelectionMethod, SoundType.Footstep, volumeFactor, targetSource);
      110.         }
      111.  
      112.         /// <summary>
      113.         /// Calculates the target step length based on whether we are walking, crouching or sprinting.
      114.         /// </summary>
      115.         private float GetStepLength()
      116.         {
      117.             float targetDistance = m_WalkStepLength;
      118.             if(Player.Run.Active)
      119.                 targetDistance = m_RunStepLength;
      120.  
      121.             return targetDistance;
      122.         }
      123.  
      124.         /// <summary>
      125.         /// Calculates the target volume based on whether player is walking, crouching or sprinting.
      126.         /// </summary>
      127.         private float GetVolumeFactor()
      128.         {
      129.             float targetVolume = m_WalkVolumeFactor;
      130.             if(Player.Run.Active)
      131.                 targetVolume = m_RunVolumeFactor;
      132.             // added by Frank
      133.             else if(Player.Crouch.Active)
      134.                 targetVolume = m_CrouchVolumeFactor;
      135.  
      136.             return targetVolume;
      137.         }
      138.  
      139.         private void OnStart_PlayerJump()
      140.         {
      141.             var data = GetDataFromBelow();
      142.             if(data == null)
      143.                 return;
      144.  
      145.             data.PlaySound(ItemSelectionMethod.RandomlyButExcludeLast, SoundType.Jump, 1f, m_AudioSource);
      146.         }
      147.  
      148.         private void On_PlayerLanded(float landSpeed)
      149.         {
      150.             var data = GetDataFromBelow();
      151.             if(data == null)
      152.                 return;
      153.  
      154.             // Don't play the landing clip when the landing speed is low.
      155.             bool landingWasHard = landSpeed >= m_LandSpeedThreeshold;
      156.             if(landingWasHard)
      157.             {
      158.                 data.PlaySound(ItemSelectionMethod.RandomlyButExcludeLast, SoundType.Land, 1f, m_AudioSource);
      159.                 m_AccumulatedDistance = 0f;
      160.             }
      161.         }
      162.  
      163.         private SurfaceData GetDataFromBelow()
      164.         {
      165.             if(!GameController.SurfaceDatabase)
      166.             {
      167.                 Debug.LogWarning("No surface database found! can't play any footsteps...", this);
      168.                 return null;
      169.             }
      170.                
      171.             Ray ray = new Ray(transform.position + Vector3.up * 0.1f, Vector3.down);
      172.             var surfaceData = GameController.SurfaceDatabase.GetSurfaceData(ray, 1f, m_Mask);
      173.  
      174.             //print(surfaceData.Name);
      175.  
      176.             return surfaceData;
      177.         }
      178.     }
      179. }
      180.  
      181.  
    5. Waiting for 0.2:)
    Thanks for support.
     
  8. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Hello to all!
    Winterbyte312
    this is great, waiting for the 0.2 release! A start menu with buttons (play, instructions,etc) would be great or a Game Over screen at the end. Thank you for the great asset. Will buy 0.2 for sure and start experiment :)
     
    AngryPixelUnity likes this.
  9. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Thank you for letting us know, unfortunately we can't test on a Mac at the moment.

    Thank you :)
    Menu coming in v0.2!
     
  10. Johns_Art

    Johns_Art

    Joined:
    Dec 9, 2015
    Posts:
    40
    Noo! It's just an assetflip of this asset :p
     
  11. emperor12321

    emperor12321

    Joined:
    Jun 21, 2015
    Posts:
    50
    Any idea for how to add spreading fire? I'd like to burn down forests and buildings
     
  12. Greg-Bassett

    Greg-Bassett

    Joined:
    Jul 28, 2009
    Posts:
    618
    Is it possible to throw rocks or other objects yet?
     
  13. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Yo can throw spears already. It's not a big problem to throw anything else, just follow the manual to add new tool.
     
  14. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Check out this asset:
    https://www.assetstore.unity3d.com/en/#!/content/3993
    I think it's best to get it and at learn from it (or use it like it is), looks like a good fire spreading system.

    Anything is possible, altough you have to code a bit and have a throwing animation.
    Let me know if you need help if you start coding.
    Otherwise object throwing is coming in version 0.2.
     
    Greg-Bassett likes this.
  15. dreb4o

    dreb4o

    Joined:
    Mar 29, 2015
    Posts:
    41
    I bought the package
    Now I have a few questions
    1.Which system I can use for terrain - Gaia?
    2.Which other system I can add (Big opportunity gives - Playmaker)There are many additions to it
     
  16. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    You can use both Gaia and Playmaker. People told us they work great with Ultimate Survival.
     
  17. Greg-Bassett

    Greg-Bassett

    Joined:
    Jul 28, 2009
    Posts:
    618
    Thanks for fast response! I would be interested in some help with the coding side of this to get me started, as I am interested in adding other animations such as showing the arms/hands actually pick up an item.
     
  18. dreb4o

    dreb4o

    Joined:
    Mar 29, 2015
    Posts:
    41
    That's good news
     
  19. dreb4o

    dreb4o

    Joined:
    Mar 29, 2015
    Posts:
    41
    Shows me one error 37 times

    transform.position assign attempt for 'Recipe (Template)(Clone)' is not valid. Input position is { NaN, NaN, NaN }.
    UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion, Transform)
    UltimateSurvival.GUISystem.CraftingList:GenerateRecipes() (at Assets/Ultimate Survival/Scripts/By Namespace/UltimateSurvival.GUISystem/Gameplay/Crafting/CraftingList.cs:102)
    UltimateSurvival.GUISystem.CraftingList:Start() (at Assets/Ultimate Survival/Scripts/By Namespace/UltimateSurvival.GUISystem/Gameplay/Crafting/CraftingList.cs:68)

    And in the demo scene
    And I trying to make a scene

    And this a few thousand times

    IndexOutOfRangeException: Array index is out of range.
    UltimateSurvival.SurfaceDatabase.GetSurfaceData (UnityEngine.Collider collider, Vector3 position, Int32 triangleIndex) (at Assets/Ultimate Survival/Scripts/By Namespace/UltimateSurvival/Surface Managing/SurfaceDatabase.cs:62)
    UltimateSurvival.SurfaceDatabase.GetSurfaceData (Ray ray, Single maxDistance, LayerMask mask) (at Assets/Ultimate Survival/Scripts/By Namespace/UltimateSurvival/Surface Managing/SurfaceDatabase.cs:38)
    UltimateSurvival.FootstepPlayer.GetDataFrom
     
  20. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Hello again, cannibals getting through the floor house. Please consider that in the new version. Thank you very much :)
     
  21. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Use Unity 5.5 if you can, that's a Unity 5.6 error.

    You mean cannibals getting in your house?
     
    TheSeawolf likes this.
  22. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    is it normal your crafted items keep getting added to inventory even though it's full ? you might consider dropping them on the floor if inventory is full.
    Besides sleeping and AI spawns, is there anything linked to the Day/Night system ? I would like to integrate UniStorm as soon as possible.
     
  23. Vaelek

    Vaelek

    Joined:
    Nov 9, 2014
    Posts:
    1
    I just purchased this asset and it looks good mostly but am having one very big issue..

    When I open the inventory via TAB, the only thing I can do is move items from the hotbar. I cannot move anything in the inventory. If I attempt to move something from the hotbar to the inventory, it is dropped on the ground. The crafting menus also do not respond to anything.

    This is with the project newly loaded and unchanged, in 5.6.0f3
     
  24. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    @Vaelek, 5.6.0f3 has compatibility issues with Ultimate Survival 0.11. Like you and others I am getting many errors. We just have to wait until Winterbyte update the package.

    @gegebel , like you I am looking for full Unistom integration.
     
    Last edited: Apr 29, 2017
    AngryPixelUnity likes this.
  25. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    They are passing through the foundation. See the image.
     
  26. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Is it planned to allow drinking an eating from the Hotbar in 0.2?
     
  27. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Check the NavMeshObstacle on the foundation prefab, resize it if needed.
     
  28. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    It is a limitation of v0.11, that has been fixed in 0.2.
    There isn't anything else linked, go ahead and integrate Unistorm, if you can't do it, I can set it up through Team Viewer quickly.

    Sorry for the issue, use Unity 5.5 until v0.12 is approved. (0.12 fixes the errors in Unity 5.6)

    Let me know if the cannibal can go through the platform when dead (as a ragdoll), or when he's alive?
    Send a personal message here on the forums with more details, so I can guide you.
     
  29. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Yes we plan on doing that for 0.2.
     
    gegebel likes this.
  30. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Ladders are causing issues when placed. If you place several, move away 40 meters and look in their direction, you can still climb. When you do a raycast on them, you can't raycast anything else anymore, you always hit the ladder, no idea why.
     
  31. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    How do I configure Building Pieces so I can build on top of a foundation without sockets? For example placing a Bed or any furniture ?
     
  32. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Look at the sleeping bag, it's a great example for what you want.
     
  33. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Didn't think about that, shame on me :(
    Thank you for all the support you provide Winterbyte312. Sometimes we might sound like we are entitled, but you really are appreciated. :D
     
    AngryPixelUnity likes this.
  34. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Good to know, we'll test everything, including the ladder, more extensively. Let us know about every bug you find. :) Can't think of any solution at the moment as we haven't experienced ladder issues so far, but we'll fix it in 0.2.
     
    gegebel likes this.
  35. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Could you give us a small explanation on what Bounds and Stability Check do in the Building Piece Script.
    I configured my item just like the sleeping Bag, but it's not working :(
    Does it only work if it's in the Interactable category ?
     
  36. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Bounds is used to make sure the piece doesn't collide with other objects when placed (The preview will turn red if so).

    Stability Check is helpful for free-placed objects like your bed, furnaces, campfires, etc. It's used to check if the piece is stable (if not, then it'll break). Useful for when you place them on the platform, or floor, if you destroy the platform the check will be performed. That's why the stability check box must intersect the platform a little bit.

    Your bed item has to have the "Is Placeable" property attached (just like the other placeables, eg. Furnace).
     
    gegebel likes this.
  37. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    Found another bug:
    When I build something, there's sometimes a second instance of the item being created at coordinates 1000, 1000, 1000.
    Coordinates are always the same it seems.

    PS: The duplicates are not placed in a parent "Building" like the normal building pieces
    Added to this, if I have several planks in the hotbar and place them, many times, 2 are placed instead of 1, even though it's counting only 1. In the Hierarchy i can see 2 "Building" with planks in them. I use custom meshes for planks, which I made IsPlaceable and added sockets for snapping.
     
    Last edited: Apr 29, 2017
  38. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    I'm sorry if I give you some headaches :(
     
  39. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Definitely a bug, strange how such a large one made it's way in the release. The building system is being reworked so that's gonna disappear in 0.2.
    Also, I'll take a look and fix it in 0.1 and upload the pack again.
     
  40. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    As a suggestion, I'd love to be able to select the built items and move them around, maybe have an option for items which can be moved like furniture, and some which can't like walls. Just an idea :D
     
  41. HeraticGalaxy

    HeraticGalaxy

    Joined:
    Aug 23, 2014
    Posts:
    28
    Loving this asset, thanks for creating it!!

    This has probably been asked before or I am just dumb but I can't figure out crafting...

    I m trying to craft a simple bone helmet but when I open the inventory window I can't select any objects in the inventory except for the 6 bottom boxes and the drop down and amount arn't clickable either.

    Am I missing the point somewhere?

    Cheers
    Dean
     
  42. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Yes the furniture definitely needs this feature. Will add it for v0.2 on the roadmap.

    You're probably using Unity 5.6, use 5.5 for now. The fix will be online in a few days.
     
    gegebel and TheSeawolf like this.
  43. HeraticGalaxy

    HeraticGalaxy

    Joined:
    Aug 23, 2014
    Posts:
    28
    Ah ok, thanks for the quick reply... i'll work on other things then and wait for it to come :) thanks
     
    TheSeawolf likes this.
  44. dreb4o

    dreb4o

    Joined:
    Mar 29, 2015
    Posts:
    41
    I am not in a hurry
    I have 1-2 months to start my project
     
  45. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    God work winterbyte312, looking forward to the next update to get stuck into it. I've already created the menu from the tutorial by @TheMessyCoder
     
  46. Greg-Bassett

    Greg-Bassett

    Joined:
    Jul 28, 2009
    Posts:
    618
    I have just bought this now via the Asset Store, any help you can give regarding what I need to do in code to add my own animations for the arms greatly appreciated... thanks in advance! Greg
     
  47. AngryPixelUnity

    AngryPixelUnity

    Joined:
    Oct 25, 2016
    Posts:
    816
    Send a PM here with more details on what you want to achieve with your new animations.
     
  48. Greg-Bassett

    Greg-Bassett

    Joined:
    Jul 28, 2009
    Posts:
    618
    Ok, will do, thanks!
     
  49. BrendanKZN

    BrendanKZN

    Joined:
    Jun 22, 2011
    Posts:
    157
    Looking forward to future updates, have secured myself a copy. Thank you.
     
  50. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    I guess I found another Bug / Setting issue: When crouching and using the SleepingBag, the camera goes under terrain. Will need to test further but it happens lots of times.
     
Thread Status:
Not open for further replies.