Search Unity

Realistic FPS Prefab [RELEASED]

Discussion in 'Assets and Asset Store' started by Deleted User, Apr 5, 2013.

  1. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    40
    BUmP
     
  2. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    106
    I Know this is old but do you still have thesse files? The link is down.
     
  3. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
  4. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    New Version below
     
    Last edited: May 10, 2019
    TonyLi likes this.
  5. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    106
    Thanks. Something is messed up with the cursor though and I wanted to see how you had it set up. I have an Inventory Pro object in the scene, but I cannot interact with it. It I set it to be picked up when I collide with it, it works, but I want the character to choose what they want to pick up or not. I also cannot interact with the inventory screen etc. so I cannot consume anything. Very frustrating. I also tried the demo of the Dialog System which I am considering and got nothing. I point my character at whatever I want to interact with and get nothing. Probably just something simple, but I cannot figure it out
     
  6. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    New Version below
     
    Last edited: May 10, 2019
  7. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    I do not like the way that AI always shoot to player's head or above player's head
    is there a way to make it visually look like AI is shooting at the torso of player character?

    need help about this :(
    Thanks
     
  8. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    40

    Holy yes please...... I could really use this . . . .
     
  9. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    40
    Can someone make a tutorial for inventory using any system, I have RFPS Version 1.23 and I cant update it cause im so far in the progress of making my game 2+ years in.
     
  10. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    K

    Demo Scene with all new scripts and everything is setup to work
    https://drive.google.com/file/d/1veUYuSfhjY9TwSQYO-vBnpRXBkmLhSQi/view?usp=sharing

    Make sure to set the restrictions on the inventory panel and skillbar
    Also the panels to be opened, likle Inventory, Crafting and Character panels, in the OnShow Event and OnHide Event, hook upto Jims_InvProManager and set accordingly, Like OnShow set HideCursor()



    Scripts Included
    Code (CSharp):
    1. using UnityEngine;
    2. using Devdog.General;
    3. using Devdog.InventoryPro;
    4.  
    5. namespace Jims
    6. {
    7.     public class Jims_InvProManager : MonoBehaviour
    8.     {
    9.         public static Jims_InvProManager Instance = null;
    10.  
    11.         //
    12.  
    13.             [HideInInspector]
    14.         public WeaponBehavior m_CurrentWeaponBehaviorComponent = null;
    15.         public WeaponBehavior CurrentWeaponBehaviorComponent
    16.         {
    17.             get
    18.             {
    19.                 m_CurrentWeaponBehaviorComponent = PlayerWeapon.CurrentWeaponBehaviorComponent;
    20.                 return m_CurrentWeaponBehaviorComponent;
    21.             }
    22.             set { m_CurrentWeaponBehaviorComponent = value; }
    23.         }
    24.         public FPSPlayer Player = null;
    25.         public PlayerWeapons PlayerWeapon = null;
    26.         public InputControl inputControl = null;
    27.  
    28.         //
    29.  
    30.         public InventoryItemBase CurrentInventoryWeaponItem = null;
    31.  
    32.         //
    33.  
    34.  
    35.         void Awake()
    36.         {
    37.             if (Instance == null)
    38.                 Instance = this;
    39.         }
    40.  
    41.         //
    42.  
    43.         public void HideCursor()
    44.         {
    45.             Time.timeScale = 0f;
    46.             Player.paused = true;
    47.             inputControl.enabled = false;
    48.             Cursor.lockState = CursorLockMode.None;
    49.             Cursor.visible = true;
    50.         }
    51.  
    52.         public void ShowCursor()
    53.         {
    54.             inputControl.enabled = true;
    55.             Player.paused = false;
    56.             Time.timeScale = 1f;  
    57.  
    58.         }
    59.  
    60.         //
    61.  
    62.         public virtual bool CheckCurrentWeapon(InventoryItemBase Item)
    63.         {
    64.             if (CurrentInventoryWeaponItem == Item)
    65.                 return true;
    66.             else
    67.                 return false;
    68.         }
    69.  
    70.         public virtual void SetupCurrentWeapon(int WeaponNumber, InventoryItemBase Item)
    71.         {
    72.             if (CheckCurrentWeapon(Item))
    73.             {
    74.                 CurrentInventoryWeaponItem = null;
    75.                 CurrentWeaponBehaviorComponent.haveWeapon = false;
    76.                 SelectWeaponInventory(0);            
    77.             }
    78.             else
    79.             {
    80.                 CurrentInventoryWeaponItem = Item;
    81.                 SelectWeaponInventory((int)WeaponNumber);                          
    82.             }
    83.         }
    84.  
    85.         public virtual void SelectWeaponInventory(int Weapon)
    86.         {
    87.             PlayerWeapon.weaponOrder[Weapon].gameObject.GetComponent<WeaponBehavior>().haveWeapon = true;
    88.             StartCoroutine(PlayerWeapon.SelectWeapon(Weapon));
    89.         }
    90.  
    91.         public virtual void AddAmmoInventory(int Weapon, int AmmoToAdd)
    92.         {
    93.             PlayerWeapon.weaponOrder[Weapon].gameObject.GetComponent<WeaponBehavior>().ammo += AmmoToAdd;
    94.         }
    95.     }
    96. }
    97.  
    Weapon
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using Devdog.General;
    5. using Devdog.InventoryPro;
    6.  
    7.  
    8. public partial class Jims_RFPSWeaponItemType : InventoryItemBase
    9. {
    10.     public Devdog.General.AudioClipInfo OnPickupSound;
    11.     public Devdog.General.AudioClipInfo OnConsumeSound;
    12.     public Devdog.General.AudioClipInfo OnDropSound;
    13.  
    14.     public uint WeaponNumber = 0;
    15.  
    16.     protected Jims.Jims_InvProManager m_InvProManager = null;
    17.     public Jims.Jims_InvProManager InvProManager
    18.     {
    19.         get {
    20.             if (m_InvProManager == null)
    21.                 m_InvProManager = Jims.Jims_InvProManager.Instance;
    22.             return m_InvProManager;
    23.         }
    24.     }
    25.  
    26.     public override GameObject Drop ()
    27.     {
    28.         //Reduce or remove an element from the character slot
    29.         var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    30.         if (skillbarCols.useReferences) {
    31.             for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    32.                 if (skillbarCols [i].item == this) {
    33.                     skillbarCols.NotifyItemRemoved (this, this.ID, i, 999);
    34.                     skillbarCols [i].item = null;
    35.                     skillbarCols [i].Repaint ();
    36.                 }
    37.             }    
    38.         }
    39.  
    40.         if (OnDropSound.audioClip) {
    41.             PlayAudioAtPos.PlayClipAt (OnDropSound.audioClip, Camera.main.transform.position, 0.75f);
    42.         }
    43.  
    44.         //Select No Gun Once Dropped
    45.         if(InvProManager.CurrentInventoryWeaponItem == this)
    46.             InvProManager.SelectWeaponInventory ((int) 0);
    47.  
    48.         //Set HaveWeapon to false, it will reset to true once re-equip
    49.         InvProManager.PlayerWeapon.weaponOrder [(int)WeaponNumber].gameObject.GetComponent<WeaponBehavior> ().haveWeapon = false;
    50.  
    51.         return base.Drop();
    52.     }
    53.  
    54.     public override int Use ()
    55.     {
    56.         var used = base.Use ();
    57.         if (used < 0) {
    58.             return used;
    59.         }
    60.  
    61.         //Select Weapon to Use
    62.         InvProManager.SetupCurrentWeapon((int)WeaponNumber, this);
    63.  
    64.         if (OnConsumeSound.audioClip) {
    65.             PlayAudioAtPos.PlayClipAt (OnConsumeSound.audioClip, Camera.main.transform.position, 0.75f);
    66.         }
    67.  
    68.         //Reduce or remove an element from the character slot
    69.         var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    70.         if (skillbarCols.useReferences) {
    71.             for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    72.                 if (skillbarCols [i].item == this) {
    73.                     skillbarCols.SetItem (i, this, true);
    74.                     if (currentStackSize == 0) {
    75.                         skillbarCols.NotifyItemRemoved (this, this.ID, i, 1);
    76.                         skillbarCols [i].item = null;
    77.                         skillbarCols [i].Repaint ();
    78.                     }
    79.                     break;
    80.                 }
    81.             }
    82.         }
    83.  
    84.         if (itemCollection != null) {
    85.             if (currentStackSize <= 0) {
    86.                 itemCollection.NotifyItemRemoved (this, ID, index, 1);
    87.                 itemCollection.SetItem (index, null, true);
    88.             }
    89.             itemCollection [index].Repaint ();
    90.         }
    91.         return 0;
    92.     }
    93.  
    94.     public override bool PickupItem ()
    95.     {
    96.         bool pickedUp = base.PickupItem ();
    97.         if (pickedUp) {
    98.             if (OnPickupSound.audioClip) {
    99.                 PlayAudioAtPos.PlayClipAt (OnPickupSound.audioClip, Camera.main.transform.position, 0.75f);
    100.             }
    101.         }
    102.         return pickedUp;
    103.     }
    104.  
    105.     public override LinkedList<ItemInfoRow[]> GetInfo()
    106.     {
    107.         var list = new LinkedList<ItemInfoRow[]>();
    108.         list.AddLast(new ItemInfoRow[]{
    109.             //new ItemInfoRow("Weight", (weight * currentStackSize).ToString()),
    110.             //new ItemInfoRow("Required level", requiredLevel.ToString()),
    111.             new ItemInfoRow("Category", category.name),
    112.         });
    113.  
    114.         var extraProperties = new List<ItemInfoRow>();
    115.         foreach (var property in stats)
    116.         {
    117.             var prop = property.stat;
    118.             if (prop == null)
    119.             {
    120.                 continue;
    121.             }
    122.  
    123.             if(prop.showInUI)
    124.             {
    125.                 if(property.isFactor && property.isSingleValue)
    126.                     extraProperties.Add(new ItemInfoRow(prop.statName, (property.floatValue - 1.0f) * 100 + "%", prop.color, prop.color));
    127.                 else
    128.                     extraProperties.Add(new ItemInfoRow(prop.statName, property.value, prop.color, prop.color));
    129.             }
    130.         }
    131.         if(extraProperties.Count > 0)
    132.             list.AddFirst(extraProperties.ToArray());
    133.  
    134.         var extra = new List<ItemInfoRow>(0);    
    135.         if (extra.Count > 0)
    136.         {
    137.             list.AddFirst(extra.ToArray());
    138.         }
    139.  
    140.         return list;
    141.     }
    142. }
    Ammo
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using Devdog.General;
    5. using Devdog.InventoryPro;
    6.  
    7.  
    8. public class Jims_RFPSAmmoItemType : InventoryItemBase
    9. {
    10.     public Devdog.General.AudioClipInfo OnPickupSound;
    11.     public Devdog.General.AudioClipInfo OnConsumeSound;
    12.     public Devdog.General.AudioClipInfo OnDropSound;
    13.  
    14.     public uint[] WeaponNumber;
    15.     public uint AmmoToAdd = 1;
    16.  
    17.     protected Jims.Jims_InvProManager m_InvProManager = null;
    18.     public Jims.Jims_InvProManager InvProManager
    19.     {
    20.         get
    21.         {
    22.             if (m_InvProManager == null)
    23.                 m_InvProManager = Jims.Jims_InvProManager.Instance;
    24.             return m_InvProManager;
    25.         }
    26.     }
    27.  
    28.     public override GameObject Drop ()
    29.     {
    30.         //Reduce or remove an element from the character slot
    31.         var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    32.         if (skillbarCols.useReferences) {
    33.             for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    34.                 if (skillbarCols [i].item == this) {
    35.                     skillbarCols.NotifyItemRemoved (this, this.ID, i, 999);
    36.                     skillbarCols [i].item = null;
    37.                     skillbarCols [i].Repaint ();
    38.                 }
    39.             }
    40.         }
    41.  
    42.         if (OnDropSound.audioClip)
    43.         {
    44.             PlayAudioAtPos.PlayClipAt(OnDropSound.audioClip, Camera.main.transform.position, 0.75f);
    45.         }
    46.  
    47.         return base.Drop();
    48.     }
    49.  
    50.     public override int Use ()
    51.     {
    52.         var used = base.Use ();
    53.         if (used < 0) {
    54.             return used;
    55.         }
    56.  
    57.         foreach(uint WN in WeaponNumber)
    58.         {
    59.             InvProManager.AddAmmoInventory ((int)WN, (int)AmmoToAdd);
    60.         }
    61.  
    62.         //AudioManager.AudioPlayOneShot (addAmmoSound);
    63.         if (OnConsumeSound.audioClip) {
    64.             PlayAudioAtPos.PlayClipAt (OnConsumeSound.audioClip, Camera.main.transform.position, 0.75f);
    65.         }
    66.  
    67.         //Remove 1 from current Stack
    68.         currentStackSize--;
    69.  
    70.         //Reduce or remove an element from the character slot
    71.         var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    72.         if (skillbarCols.useReferences) {
    73.             for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    74.                 if (skillbarCols [i].item == this) {
    75.                     skillbarCols.SetItem (i, this, true);
    76.                     if (currentStackSize == 0) {
    77.                         skillbarCols.NotifyItemRemoved (this, this.ID, i, 1);
    78.                         skillbarCols [i].item = null;
    79.                         skillbarCols [i].Repaint ();
    80.                     }
    81.                     break;
    82.                 }
    83.             }
    84.         }
    85.  
    86.         if (itemCollection != null) {
    87.             if (currentStackSize <= 0) {
    88.                 itemCollection.NotifyItemRemoved (this, ID, index, 1);
    89.                 itemCollection.SetItem (index, null, true);
    90.             }
    91.  
    92.             itemCollection [index].Repaint ();
    93.         }
    94.  
    95.         NotifyItemUsed(1, true);
    96.         return 1;
    97.     }
    98.  
    99.     public override bool PickupItem ()
    100.     {
    101.         bool pickedUp = base.PickupItem ();
    102.         if (pickedUp) {
    103.             if (OnPickupSound.audioClip) {
    104.                 PlayAudioAtPos.PlayClipAt (OnPickupSound.audioClip, Camera.main.transform.position, 0.75f);
    105.             }
    106.         }
    107.         return pickedUp;
    108.     }
    109.  
    110.     public override LinkedList<ItemInfoRow[]> GetInfo()
    111.     {
    112.         var list = new LinkedList<ItemInfoRow[]>();
    113.         list.AddLast(new ItemInfoRow[]{
    114.             //new ItemInfoRow("Weight", (weight * currentStackSize).ToString()),
    115.             //new ItemInfoRow("Required level", requiredLevel.ToString()),
    116.             new ItemInfoRow("Category", category.name),
    117.         });
    118.  
    119.         var extraProperties = new List<ItemInfoRow>();
    120.         foreach (var property in stats)
    121.         {
    122.             var prop = property.stat;
    123.             if (prop == null)
    124.             {
    125.                 continue;
    126.             }
    127.  
    128.             if(prop.showInUI)
    129.             {
    130.                 if(property.isFactor && property.isSingleValue)
    131.                     extraProperties.Add(new ItemInfoRow(prop.statName, (property.floatValue - 1.0f) * 100 + "%", prop.color, prop.color));
    132.                 else
    133.                     extraProperties.Add(new ItemInfoRow(prop.statName, property.value, prop.color, prop.color));
    134.             }
    135.         }
    136.         if(extraProperties.Count > 0)
    137.             list.AddFirst(extraProperties.ToArray());
    138.  
    139.  
    140.         var extra = new List<ItemInfoRow>(0);
    141.         if (extra.Count > 0)
    142.         {
    143.             list.AddFirst(extra.ToArray());
    144.         }
    145.  
    146.         return list;
    147.     }
    148. }
    Health
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using Devdog.General;
    5. using Devdog.InventoryPro;
    6.  
    7.  
    8. public class Jims_RFPSHealthItemType : InventoryItemBase
    9. {
    10.     public Devdog.General.AudioClipInfo OnPickupSound;
    11.     public Devdog.General.AudioClipInfo OnConsumeSound;
    12.     public Devdog.General.AudioClipInfo OnFailedSound;
    13.     public Devdog.General.AudioClipInfo OnDropSound;
    14.  
    15.     public float HealthToRestore = 10f;
    16.  
    17.     protected Jims.Jims_InvProManager m_InvProManager = null;
    18.     public Jims.Jims_InvProManager InvProManager
    19.     {
    20.         get
    21.         {
    22.             if (m_InvProManager == null)
    23.                 m_InvProManager = Jims.Jims_InvProManager.Instance;
    24.             return m_InvProManager;
    25.         }
    26.     }
    27.  
    28.     public override GameObject Drop ()
    29.     {
    30.         //Reduce or remove an element from the character slot
    31.         var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    32.         if (skillbarCols.useReferences) {
    33.             for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    34.                 if (skillbarCols [i].item == this) {
    35.                     skillbarCols.NotifyItemRemoved (this, this.ID, i, 999);
    36.                     skillbarCols [i].item = null;
    37.                     skillbarCols [i].Repaint ();
    38.                 }
    39.             }
    40.         }
    41.  
    42.         if (OnDropSound.audioClip)
    43.         {
    44.             PlayAudioAtPos.PlayClipAt(OnDropSound.audioClip, Camera.main.transform.position, 0.75f);
    45.         }
    46.  
    47.         return base.Drop();
    48.     }
    49.  
    50.     public override bool PickupItem ()
    51.     {
    52.         bool pickedUp = base.PickupItem ();
    53.         if (pickedUp) {
    54.             if (OnPickupSound.audioClip) {
    55.                 PlayAudioAtPos.PlayClipAt (OnPickupSound.audioClip, Camera.main.transform.position, 0.75f);
    56.             }
    57.         }
    58.         return pickedUp;
    59.     }
    60.  
    61.     public override int Use ()
    62.     {
    63.         var used = base.Use ();
    64.         if (used < 0) {
    65.             return used;
    66.         }
    67.  
    68.  
    69.         var dmgHandler = PlayerManager.instance.currentPlayer.gameObject.GetComponent<FPSPlayer> ();
    70.         if (dmgHandler != null)
    71.         {
    72.             if (dmgHandler.hitPoints < dmgHandler.maximumHitPoints) {
    73.                 dmgHandler.HealPlayer (HealthToRestore);
    74.                 //dmgHandler.hitPoints += HealthToRestore;
    75.                 //AudioManager.AudioPlayOneShot (consumeSound);
    76.                 if (OnConsumeSound.audioClip) {
    77.                     PlayAudioAtPos.PlayClipAt (OnConsumeSound.audioClip, Camera.main.transform.position, 0.75f);
    78.                 }
    79.             } else {
    80.                 //AudioManager.AudioPlayOneShot (deniedSound);
    81.                 if (OnFailedSound.audioClip) {
    82.                     PlayAudioAtPos.PlayClipAt (OnFailedSound.audioClip, Camera.main.transform.position, 0.75f);
    83.                 }
    84.                 return 0;
    85.             }
    86.         }
    87.  
    88.         //Remove 1 from current Stack
    89.         currentStackSize--;
    90.  
    91.         //Reduce or remove an element from the character slot
    92.         var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    93.         if (skillbarCols.useReferences) {
    94.             for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    95.                 if (skillbarCols [i].item == this) {
    96.                     skillbarCols.SetItem (i, this, true);
    97.                     if (currentStackSize == 0) {
    98.                         skillbarCols.NotifyItemRemoved (this, this.ID, i, 1);
    99.                         skillbarCols [i].item = null;
    100.                         skillbarCols [i].Repaint ();
    101.                     }
    102.                     break;
    103.                 }
    104.             }
    105.         }
    106.  
    107.         if (itemCollection != null) {
    108.             if (currentStackSize <= 0) {
    109.                 itemCollection.NotifyItemRemoved (this, ID, index, 1);
    110.                 itemCollection.SetItem (index, null, true);
    111.             }
    112.  
    113.             itemCollection [index].Repaint ();
    114.         }
    115.  
    116.         NotifyItemUsed(1, true);
    117.         return 1;
    118.     }
    119.  
    120.     public override LinkedList<ItemInfoRow[]> GetInfo()
    121.     {
    122.         var list = new LinkedList<ItemInfoRow[]>();
    123.         list.AddLast(new ItemInfoRow[]{
    124.             //new ItemInfoRow("Weight", (weight * currentStackSize).ToString()),
    125.             //new ItemInfoRow("Required level", requiredLevel.ToString()),
    126.             new ItemInfoRow("Category", category.name),
    127.         });
    128.  
    129.         var extraProperties = new List<ItemInfoRow>();
    130.         foreach (var property in stats)
    131.         {
    132.             var prop = property.stat;
    133.             if (prop == null)
    134.             {
    135.                 continue;
    136.             }
    137.  
    138.             if(prop.showInUI)
    139.             {
    140.                 if(property.isFactor && property.isSingleValue)
    141.                     extraProperties.Add(new ItemInfoRow(prop.statName, (property.floatValue - 1.0f) * 100 + "%", prop.color, prop.color));
    142.                 else
    143.                     extraProperties.Add(new ItemInfoRow(prop.statName, property.value, prop.color, prop.color));
    144.             }
    145.         }
    146.  
    147.         if(extraProperties.Count > 0)
    148.             list.AddFirst(extraProperties.ToArray());
    149.  
    150.         var extra = new List<ItemInfoRow>(0);    
    151.  
    152.         if (extra.Count > 0)
    153.         {
    154.             list.AddFirst(extra.ToArray());
    155.         }
    156.  
    157.         return list;
    158.     }
    159. }
    Hunger
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using Devdog.General;
    5. using Devdog.InventoryPro;
    6.  
    7.  
    8. public class Jims_RFPSHungerItemType : InventoryItemBase
    9. {
    10.     public Devdog.General.AudioClipInfo OnPickupSound;
    11.     public Devdog.General.AudioClipInfo OnConsumeSound;
    12.     public Devdog.General.AudioClipInfo OnFailedSound;
    13.     public Devdog.General.AudioClipInfo OnDropSound;
    14.  
    15.     public float HealthToRestore = 10f;
    16.     public float HungerToRestore = 10f;
    17.  
    18.     protected Jims.Jims_InvProManager m_InvProManager = null;
    19.     public Jims.Jims_InvProManager InvProManager
    20.     {
    21.         get
    22.         {
    23.             if (m_InvProManager == null)
    24.                 m_InvProManager = Jims.Jims_InvProManager.Instance;
    25.             return m_InvProManager;
    26.         }
    27.     }
    28.  
    29.     public override GameObject Drop ()
    30.     {
    31.         //Reduce or remove an element from the character slot
    32.         var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    33.         if (skillbarCols.useReferences) {
    34.             for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    35.                 if (skillbarCols [i].item == this) {
    36.                     skillbarCols.NotifyItemRemoved (this, this.ID, i, 999);
    37.                     skillbarCols [i].item = null;
    38.                     skillbarCols [i].Repaint ();
    39.                 }
    40.             }
    41.         }
    42.  
    43.         if (OnDropSound.audioClip)
    44.         {
    45.             PlayAudioAtPos.PlayClipAt(OnDropSound.audioClip, Camera.main.transform.position, 0.75f);
    46.         }
    47.  
    48.         return base.Drop ();
    49.     }
    50.  
    51.     public override bool PickupItem ()
    52.     {
    53.         bool pickedUp = base.PickupItem ();
    54.         if (pickedUp) {
    55.             if (OnPickupSound.audioClip) {
    56.                 PlayAudioAtPos.PlayClipAt (OnPickupSound.audioClip, Camera.main.transform.position, 0.75f);
    57.             }
    58.         }
    59.         return pickedUp;
    60.     }
    61.  
    62.     public override int Use ()
    63.     {
    64.         var used = base.Use ();
    65.         if (used < 0) {
    66.             return used;
    67.         }
    68.  
    69.  
    70.         var dmgHandler = PlayerManager.instance.currentPlayer.gameObject.GetComponent<FPSPlayer> ();
    71.         if (dmgHandler != null) {        
    72.        
    73.  
    74.                 if (dmgHandler.hungerPoints <= 0.0f && !dmgHandler.usePlayerHunger) {
    75.                 //    AudioManager.AudioPlayOneShot (deniedSound);
    76.                     if (OnFailedSound.audioClip) {
    77.                         PlayAudioAtPos.PlayClipAt (OnFailedSound.audioClip, Camera.main.transform.position, 0.75f);
    78.                     }
    79.                     return 0;
    80.                 }
    81.            
    82.                 if (dmgHandler.hungerPoints - HungerToRestore > 0.0) {
    83.                     dmgHandler.UpdateHunger (-HungerToRestore);
    84.                 } else {
    85.                     dmgHandler.UpdateHunger (-dmgHandler.hungerPoints);
    86.                 }
    87.  
    88.                 //restore player health by healthToRestore amount
    89.                 if (dmgHandler.hitPoints + HealthToRestore < dmgHandler.maximumHitPoints) {
    90.                     dmgHandler.HealPlayer (HealthToRestore);
    91.                 } else {
    92.                     dmgHandler.HealPlayer (dmgHandler.maximumHitPoints - dmgHandler.hitPoints);
    93.                 }
    94.  
    95.  
    96.             //AudioManager.AudioPlayOneShot (consumeSound);
    97.             if (OnConsumeSound.audioClip) {
    98.                 PlayAudioAtPos.PlayClipAt (OnConsumeSound.audioClip, Camera.main.transform.position, 0.75f);
    99.             }
    100.         }
    101.  
    102.  
    103.  
    104.         if (dmgHandler.usePlayerHunger) {
    105.             //Remove 1 from current Stack
    106.             currentStackSize--;
    107.    
    108.  
    109.             //Reduce or remove an element from the character slot
    110.             var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    111.             if (skillbarCols.useReferences) {
    112.                 for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    113.                     if (skillbarCols [i].item == this) {
    114.                         skillbarCols.SetItem (i, this, true);
    115.                         if (currentStackSize == 0) {
    116.                             skillbarCols.NotifyItemRemoved (this, this.ID, i, 1);
    117.                             skillbarCols [i].item = null;
    118.                             skillbarCols [i].Repaint ();
    119.                         }
    120.                         break;
    121.                     }
    122.                 }
    123.             }
    124.  
    125.             if (itemCollection != null) {
    126.                 if (currentStackSize <= 0) {
    127.                     itemCollection.NotifyItemRemoved (this, ID, index, 1);
    128.                     itemCollection.SetItem (index, null, true);
    129.                 }
    130.  
    131.                 itemCollection [index].Repaint ();
    132.             }
    133.  
    134.             NotifyItemUsed(1, true);
    135.             return 1;
    136.         } else
    137.             return 0;
    138.     }
    139.  
    140.     public override LinkedList<ItemInfoRow[]> GetInfo ()
    141.     {
    142.         var list = new LinkedList<ItemInfoRow[]> ();
    143.         list.AddLast (new ItemInfoRow[] {
    144.             //new ItemInfoRow("Weight", (weight * currentStackSize).ToString()),
    145.             //new ItemInfoRow("Required level", requiredLevel.ToString()),
    146.             new ItemInfoRow ("Category", category.name),
    147.         });
    148.  
    149.         var extraProperties = new List<ItemInfoRow> ();
    150.         foreach (var property in stats) {
    151.             var prop = property.stat;
    152.             if (prop == null) {
    153.                 continue;
    154.             }
    155.  
    156.             if (prop.showInUI) {
    157.                 if (property.isFactor && property.isSingleValue)
    158.                     extraProperties.Add (new ItemInfoRow (prop.statName, (property.floatValue - 1.0f) * 100 + "%", prop.color, prop.color));
    159.                 else
    160.                     extraProperties.Add (new ItemInfoRow (prop.statName, property.value, prop.color, prop.color));
    161.             }
    162.         }
    163.  
    164.         if (extraProperties.Count > 0)
    165.             list.AddFirst (extraProperties.ToArray ());
    166.  
    167.         var extra = new List<ItemInfoRow> (0);    
    168.  
    169.         if (extra.Count > 0) {
    170.             list.AddFirst (extra.ToArray ());
    171.         }
    172.  
    173.         return list;
    174.     }
    175. }
    Thirst
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using Devdog.General;
    5. using Devdog.InventoryPro;
    6.  
    7.  
    8. public class Jims_RFPSThirstItemType : InventoryItemBase
    9. {
    10.     public Devdog.General.AudioClipInfo OnPickupSound;
    11.     public Devdog.General.AudioClipInfo OnConsumeSound;
    12.     public Devdog.General.AudioClipInfo OnFailedSound;
    13.     public Devdog.General.AudioClipInfo OnDropSound;
    14.  
    15.     public float HealthToRestore = 10f;
    16.     public float ThirstToRestore = 10f;
    17.  
    18.     protected Jims.Jims_InvProManager m_InvProManager = null;
    19.     public Jims.Jims_InvProManager InvProManager
    20.     {
    21.         get
    22.         {
    23.             if (m_InvProManager == null)
    24.                 m_InvProManager = Jims.Jims_InvProManager.Instance;
    25.             return m_InvProManager;
    26.         }
    27.     }
    28.  
    29.     public override GameObject Drop ()
    30.     {
    31.         //Reduce or remove an element from the character slot
    32.         var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    33.         if (skillbarCols.useReferences) {
    34.             for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    35.                 if (skillbarCols [i].item == this) {
    36.                     skillbarCols.NotifyItemRemoved (this, this.ID, i, 999);
    37.                     skillbarCols [i].item = null;
    38.                     skillbarCols [i].Repaint ();
    39.                 }
    40.             }
    41.         }
    42.  
    43.         if (OnDropSound.audioClip)
    44.         {
    45.             PlayAudioAtPos.PlayClipAt(OnDropSound.audioClip, Camera.main.transform.position, 0.75f);
    46.         }
    47.  
    48.         return base.Drop ();
    49.     }
    50.  
    51.     public override bool PickupItem ()
    52.     {
    53.         bool pickedUp = base.PickupItem ();
    54.         if (pickedUp) {
    55.             if (OnPickupSound.audioClip) {
    56.                 PlayAudioAtPos.PlayClipAt (OnPickupSound.audioClip, Camera.main.transform.position, 0.75f);
    57.             }
    58.         }
    59.         return pickedUp;
    60.     }
    61.  
    62.     public override int Use ()
    63.     {
    64.         var used = base.Use ();
    65.         if (used < 0) {
    66.             return used;
    67.         }
    68.  
    69.  
    70.         var dmgHandler = PlayerManager.instance.currentPlayer.gameObject.GetComponent<FPSPlayer> ();
    71.         if (dmgHandler != null) {
    72.  
    73.  
    74.  
    75.                 if (dmgHandler.thirstPoints <= 0.0f && !dmgHandler.usePlayerThirst) {
    76.                     //    AudioManager.AudioPlayOneShot (deniedSound);
    77.                     if (OnFailedSound.audioClip) {
    78.                         PlayAudioAtPos.PlayClipAt (OnFailedSound.audioClip, Camera.main.transform.position, 0.75f);
    79.                     }
    80.                     return 0;
    81.                 }
    82.  
    83.                 if (dmgHandler.thirstPoints - ThirstToRestore > 0.0) {
    84.                     dmgHandler.UpdateThirst (-ThirstToRestore);
    85.                 } else {
    86.                     dmgHandler.UpdateThirst (-dmgHandler.thirstPoints);
    87.                 }
    88.  
    89.                 //restore player health by healthToRestore amount
    90.                 if (dmgHandler.hitPoints + HealthToRestore < dmgHandler.maximumHitPoints) {
    91.                     dmgHandler.HealPlayer (HealthToRestore);
    92.                 } else {
    93.                     dmgHandler.HealPlayer (dmgHandler.maximumHitPoints - dmgHandler.hitPoints);
    94.                 }
    95.             }
    96.  
    97.             //AudioManager.AudioPlayOneShot (consumeSound);
    98.             if (OnConsumeSound.audioClip) {
    99.                 PlayAudioAtPos.PlayClipAt (OnConsumeSound.audioClip, Camera.main.transform.position, 0.75f);
    100.             }
    101.  
    102.  
    103.  
    104.  
    105.         if (dmgHandler.usePlayerThirst) {
    106.             //Remove 1 from current Stack
    107.             currentStackSize--;
    108.  
    109.  
    110.             //Reduce or remove an element from the character slot
    111.             var skillbarCols = PlayerManager.instance.currentPlayer.inventoryPlayer.skillbarCollection;
    112.             if (skillbarCols.useReferences) {
    113.                 for (uint i = 0; i < skillbarCols.collectionSize; i++) {
    114.                     if (skillbarCols [i].item == this) {
    115.                         skillbarCols.SetItem (i, this, true);
    116.                         if (currentStackSize == 0) {
    117.                             skillbarCols.NotifyItemRemoved (this, this.ID, i, 1);
    118.                             skillbarCols [i].item = null;
    119.                             skillbarCols [i].Repaint ();
    120.                         }
    121.                         break;
    122.                     }
    123.                 }
    124.             }
    125.  
    126.             if (itemCollection != null) {
    127.                 if (currentStackSize <= 0) {
    128.                     itemCollection.NotifyItemRemoved (this, ID, index, 1);
    129.                     itemCollection.SetItem (index, null, true);
    130.                 }
    131.  
    132.                 itemCollection [index].Repaint ();
    133.             }
    134.  
    135.             NotifyItemUsed(1, true);
    136.             return 1;
    137.         } else
    138.             return 0;
    139.     }
    140.  
    141.     public override LinkedList<ItemInfoRow[]> GetInfo ()
    142.     {
    143.         var list = new LinkedList<ItemInfoRow[]> ();
    144.         list.AddLast (new ItemInfoRow[] {
    145.             //new ItemInfoRow("Weight", (weight * currentStackSize).ToString()),
    146.             //new ItemInfoRow("Required level", requiredLevel.ToString()),
    147.             new ItemInfoRow ("Category", category.name),
    148.         });
    149.  
    150.         var extraProperties = new List<ItemInfoRow> ();
    151.         foreach (var property in stats) {
    152.             var prop = property.stat;
    153.             if (prop == null) {
    154.                 continue;
    155.             }
    156.  
    157.             if (prop.showInUI) {
    158.                 if (property.isFactor && property.isSingleValue)
    159.                     extraProperties.Add (new ItemInfoRow (prop.statName, (property.floatValue - 1.0f) * 100 + "%", prop.color, prop.color));
    160.                 else
    161.                     extraProperties.Add (new ItemInfoRow (prop.statName, property.value, prop.color, prop.color));
    162.             }
    163.         }
    164.  
    165.         if (extraProperties.Count > 0)
    166.             list.AddFirst (extraProperties.ToArray ());
    167.  
    168.         var extra = new List<ItemInfoRow> (0);    
    169.  
    170.         if (extra.Count > 0) {
    171.             list.AddFirst (extra.ToArray ());
    172.         }
    173.  
    174.         return list;
    175.     }
    176. }
     
    Last edited: May 10, 2019
    Weblox likes this.
  11. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @llJIMBOBll So your integration is Inv Pro 2.5 with the last version of RFPS?
     
  12. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    yh latest both versions, plus I exported with Unity 2018.3
     
    Weblox likes this.
  13. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    excellent! Thank you!
     
  14. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Also anyways of getting individual images form your animated gif?
     
  15. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    106
    Thank you so much. You saved my game.
     
  16. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Weblox likes this.
  17. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
  18. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    40
    Thank you a lot man! I am going to try but before I do, can I ask what version of RFPS and InventoryPro are you using, and what was the first script, cause you didn't name it. Thanks :)
     
    Last edited: May 12, 2019
  19. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Sorry the first script can be placed anywhere in your scene or on the player, it is basically some functions to help equiping weapons

    Plus using both are latest versions, and was exported using Unity 2018.3
     
  20. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    40
    Yikes. I have RFPS Version 1.23 will this still work? Also the scene crashes when trying to load it or if I drag the FPS Player into the scene.
     
    Last edited: May 13, 2019
  21. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    Eeesh don't remind me, I shelled out 1500$ on mixamo subscription at some point...then they tried to sell another year to me, shortly after they sold out to Adobe. Definitely on the top of my worst asset purchases.

    I guess RFPS deprecating isn't as bad, it's easy to update it, doesn't really break with Unity updates, if you're capable coder you should have no problem extending it. My version is networked, has custom inventory and few other improvements.
     
    llJIMBOBll likes this.
  22. Kargaltsev

    Kargaltsev

    Joined:
    May 13, 2018
    Posts:
    2
    Guys could you tell me please, I need to leave only hands individual and only a certain weapons, suppose a pistol and box, as this can be done?
     
  23. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    477
    Hi Everyone,

    I have a project where I seem to have lost my Player damage UI Pain/Hurt image...

    When the player gets hurt I am just seeing a white screen fade in/out where I should be getting the Blood Splat image displaying on receiving damage?

    I am not sure why this is (was working previously) and where to find the blood splat image or the name of it - or if there may just be another problem causing this?

    Any help or advice to info to location of missing media or other fix would be appreciated please.

    Thank you

    I hope everyone is OK :)

    Peter
     
  24. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Hey everyone how do you use the NPC registry? Not sure i fully understand....
     
  25. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
     
  26. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    yes
     
  27. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    networked? what magic is this?
     
  28. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    477
    Hi jons190,

    Thats the problem :) I don't see one in the folders- cant find the/a graphic for it so don't know what to check for :) Dont know where it should be located, what its name is and so on :) Looked for one in other projects and installs of FPSC and cant find one anywhere if it is supposed to use one at all which I presume it should!

    Thanks anyway for you reply.

    Peter
     
  29. ProBrStalker

    ProBrStalker

    Joined:
    Aug 20, 2017
    Posts:
    65
    Hi, I'm implementing your multiplayer kit in rfps 1.44 (photon bolt), but I have 4 errors ... can you help me?
     

    Attached Files:

  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @samuelostgamer - Sorry, it's been years since I looked at that code, and it was for much earlier versions of RFPS and Bolt. (Bolt wasn't even "Photon Bolt" at the time.) I have no idea.
     
  31. ProBrStalker

    ProBrStalker

    Joined:
    Aug 20, 2017
    Posts:
    65
    Well ... do not you know of any other way to make realisitc fps prefab 1.44 multiplayer?
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Maybe contact @milox777 and see if you can contract him to implement multiplayer. He just posted that he implemented multiplayer in RFPS.

    Another option is to switch to a different character controller. Opsive recently posted screenshots of their character controllers working with Photon networking. They expect to release that feature by the end of the month.
     
  33. twangydave

    twangydave

    Joined:
    Mar 30, 2017
    Posts:
    41
    Hi Peter,

    In 'FPS Player' section of the prefab there is a section just under 'Show Help Text' named 'Pain Texture' where the pain texture is stored, the correct file is named 'bloodscreenSplatter' - is that what you are looking for?

    File is saved in RFPS/Textures/WeaponHits/BloodScreenSplatter.jpg
     
    OZAV and jons190 like this.
  34. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    was just looking this up for him. you beat me too it!
     
    twangydave likes this.
  35. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    save_system_sene_manager.jpg Tony Li! hail! I hope this finds you well!

    say I have two odd little errors that I was wondering if you had any insight on..
    With the save system.

    odd error one:
    when I transition between levels, on my spaw point in the level that I spawn too, I spawn and seem to be facing the direction I left the previous level (like I spawn in facing a wall, instead of facing outward into the level) I've tried all sorts of things to change this behavior, rotating the spawn point, trying to write scripts that carried the transform) but alas, nothing seems to work. Is there some simple trick I am missing on this one? Next time I can easily design my levels with this in mind, but for now, I'm hoping there is some way to get control of the spawn point rotation.


    Second one with the save system
    When I use the standard scene transition manager with the save system, it works perfectly on the first scene to fade out between level loads, but does not seem to carry the functionality through the rest of the scenes. I've tried a bunch of different ways to have this rigged up, to no avail.
    the one config that works the first time is that I add scene transition manager to save system component, then nest the scene fade animation component as a sub child to the save system . This is for android, it works perfectly in the editor though but not on the android build on the device (gearvr and Go)

    Anyway, would love to hear any thoughts on something I could try you may have! cheers mate!
    Any thoughts off the top o your head on what I should try to fix any of this? The first error is just kinda a nuisance that I can easily live with, but the second error is key for the user experience in the VR device. That end fade out
     
    Last edited: Jun 7, 2019
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @jons190 - This is fixed in the update that's going to be released very soon. You won't need to do anything except import the update.

    Add the instance of the SceneFaderCanvas as a child of the Save System GameObject. Otherwise you'll get the behavior you described, where it fails to stick around after the first scene change.

    EDIT: I realize I added the SceneFaderCanvas prefab in the upcoming version. But it sounds like you have a similar one (perhaps even pulled from the Dialogue System), so that's the thing to add as a child of the Save System GameObject.
     
    Last edited: Jun 7, 2019
  37. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260


    So I think i have that set up exactly like this.... (see attached screen shot) should I nest or set up slightly different? save_system_scene.jpg
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @jons190 - Exactly like you have it. That should work fine.
     
  39. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    ya works perfect in the editor all the way through the entire game, but not live, on the actual mobile device (s7 and oculus GO) However, the first setup on the first scene does work just perfect on the mobile devices. But it seems it just doesn't come through on the following scenes. Been banging on this one for a few weeks now.... can't figure it out. ahhh the vagaries of all these platforms and tech. How do you ever keep up on it all?
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @jons190 - For comparison, does a desktop build work correctly?

    Is your Save System's SceneTransitionManager pointing to the right SceneFaderCanvas? Maybe another one is hiding somewhere in the scene.

    What version of Unity are you using?
     
  41. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    will test a stand alone dt build tonight.....
    I just can't imagine that there is another scene transition in there....but..... how many times does it turn out to be something like this.... will check
    2018.16f1 rfps 1.44 latest save system, ovr 1.27
     
  42. ProBrStalker

    ProBrStalker

    Joined:
    Aug 20, 2017
    Posts:
    65
    thanks
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Version 1.1.4 of the Save System for Realistic FPS Prefab is now available on the Asset Store.

    Release Notes:
    • Improved: FPSRigidBodyWalker values are now saved.
    • Fixed: Look rotation now matches spawnpoint direction when changing scenes.
    • Added: SceneFaderCanvas for use with SceneTransitionManager.
    • Improved: Added SaveSystem methods LoadAdditiveScene, UnloadAdditiveScene.
    • Improved: Savers can now implement optional ApplyDataImmediate and OnRestartGame methods.
    • Fixed: Moved DiskSavedGameDataStorer initialization code from Start to Awake so other scripts can check for saved games in their own Start methods.
     
    jons190 likes this.
  44. LiangYun1980

    LiangYun1980

    Joined:
    Jan 8, 2018
    Posts:
    8
    Hello everyone. How to increase the playback frequency of footsteps?
     
  45. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    whoo owhoot! just downloaded. Whats the best path for upgrading? Delete old folder out of unity project and reimport?
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Just import on top. You can delete if the old one if you want, but it's not necessary.

    For Dialogue System users, make sure to import the RFPS Support package to get the same improvements.
     
    jons190 likes this.
  47. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    477
    Hi Everyone that responded to my prob....

    I had eventually found the bloodscreen.jpg location myself but the image file was not working for some reason so I used another image from a different asset instead and that works fine so all sorted on that one thank you :)

    Peter
     
    jons190 and TonyLi like this.
  48. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    477
    Hi TonyLi,

    I have had an issue with the save system for quite some time that you may be able to help with please if you can?

    My save system is not working at all? Seems like the system is completely dead as at one time using checkpoints I used to have feedback in the editor console - and only now after a long time am I realising I no longer do and the system does not function at all? If the player walks through a checkpoint then later gets killed and the level restarts following death the player spawns back not at the checkpoint location but at the default RFPS original player level start position. Seems like nothing at all is being saved and no console feedback or messages at all can I get to display. I used to get loading Json and saving checkpoint messages but no longer.....

    Just deleted the older version I had and installed your latest update and still the same - nothing happening :)

    Might seem strange that I had not noticed this for perhaps a year or more but as I go for long periods of time when building levels - I turn off all AI NPC's so I can concentrate of level building I don't get killed and had not had to test save/checkpoints for well as said over a year :)

    As far as I am aware I have everything set up correctly as I have always had as it does not seem to be rocket science.

    I am using Unity V 2018.2.9f1

    I only use the Checkpoint feature to date. Presumably the player should re-spawn after death at the last checkpoint position and not necessarily at the start of a level which could be along way from the last checkpoint? As far as I can remember that's what used to happen :)

    As said used to work and I don't know which version of Unity it must have stopped working at.

    Don't know how to get some feedback in the Editor console - I have debug on in the asset.

    I have tried adding the save system component manually to a level but that makes no difference. The save system previously used to auto create one for me if one is not manually inserted anywhere but no it longer does so.

    As said it does not seem to work and do anything at all.

    Any idea how I can get some message (error perhaps) console feedback to show up or display that the Json serialiser is working, save system is being created and so on?

    Best of all any Idea at all what may actually be wrong and how to fix it :)

    No idea myself where to start as it should work as used to as far as I can see.

    Are there any Json files or other I should be able to see that perhaps are missing for some reason? Despite having just installed the latest version?

    Anyway thanks for any assistance. Sorry to be a pain.

    Kind regards

    Peter
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @petercoleman - The Save System doesn't respawn at the checkpoint by default. To make this happen, edit FPSPlayer.cs. Find the Die() method, which is around line 1317 (give or take, depending on your RFPS version). Add this code at the beginning of the method:

    Code (csharp):
    1. void Die () {
    2.     if (PixelCrushers.SaveSystem.HasSavedGameInSlot(1))
    3.     {
    4.         PixelCrushers.SaveSystem.LoadFromSlot(1);
    5.         return;
    6.     }

    This assumes your checkpoints save into slot 1.

    Make sure your scenes have a Save System prefab, at least the very first scene that could load a saved game (e.g., main menu) or do anything involving the Save System.

    If you tick the Save System component's Debug checkbox, it will report when it saves, loads, and changes scenes. If you tick the Saved Game Data Storer component (e.g., PlayerPrefs Saved Game Data Storer), it will report when it stores or retrieves a saved game from storage.
     
  50. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    cool. updating tonight. Looks like this fixes one of my bugs. you rock!
     
    TonyLi likes this.