Search Unity

Realistic FPS Prefab [RELEASED]

Discussion in 'Assets and Asset Store' started by Azuline-Studios, Apr 5, 2013.

  1. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    Save System for RFPSP 1.0.5

    Just a quick note about the Save System for RFPSP that a user pointed out. Version 1.0.5 has been updated to support RFPSP 1.44.

    But it's still compatible with RFPSP 1.2x. If you're using RFPSP 1.2x, select Edit > Project Settings > Player and add the compiler define "RFPS_1_2" as described on page 5 of the manual.
     
  2. moria15

    moria15

    Joined:
    Feb 25, 2011
    Posts:
    390
    Greetings.. idiot newbie here :)

    I have setup my own terrain and environment and brought RFPS into that scene.

    I am using Enviro for lighting. Everything works fine, guns, damage, NPC's, menus etc etc..
    However, two weapons have lighting issues in my scenario at night...

    Most correctly look like this...

    but two look like this with the arms and the weapon, or part of the weapon pretty much greyed out...



    or the sniper rifle where the scope is fine, but the arms and part of the weapon are greyed...



    This is all currently as delivered.. can someone point me to what should be investigated to get rid of the greying on arms and weapon parts please? I have looked at textures and materials for the weapons, but see no obvious differences between them.

    Under daylight, all seems fine with all weapons.

    Regards

    M
     
  3. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Hi All,

    I am trying to install the latest RFPSP version into my existing project(s) and have a complete failure....

    On trying to install I did not get an "Update" option this time from the asset store, but only an "import" option whereby the install window automatically finds the new files needing updating and will only allow the install of those new files. i.e. that is a select install "all" files choice is not allowed?

    Anyway following install I got a complete failure and my project wont run. Effectively a shedfull of errors where RFPSP does not load its file (Scripts) so scenes wont run.

    I have attached a screen shot showing this. The editor console window also shows the usual message all compile errors have to be fixed before the scene will run but the console is not displaying any error messages listed. It was but they have now vanished and I am left with a blank console window with no error messages displaying - great. Of course I still get a message saying the compile errors which I can no longer see have to be fixed :)

    I have tried installing numerous times, shutting down Unity numerous time and re-booting my system too and to no avail as if anything the situation has become worse and not better.

    No idea really where to start to look for a solution now. I have had similar issues before and shutting down, rebooting and other efforts have fixed the similar problems but not this time it seems....

    Anyway it looks like I have to remove this install and try and go back to an earlier version which I really don't want to do as I want to keep my game using the latest versions....

    RFPSP has been a pain in the past when new versions come out and causing major amounts of work to update existing projects and I thought that with the last few versions and the recent Unity versions that was relegated somewhat as recent installs of version updates had given me an "Update" choice from the asset store but not this time and I am again fighting to update a major project that has a few years dev time put into it...

    Very frustrating I have to say.

    Any help or suggestion as to what the issue is and how to fix it would be much appreciated....

    In the mean time I have no idea if I will go back to an early backup if possible but looks like I have no option at the moment.

    Thank you

    Peter

    :)
     

    Attached Files:

  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    @petercoleman - Have you tried completely deleting the RFPSP folder, redownloading RFPSP, and then importing a "clean" version?
     
  5. GhereGames

    GhereGames

    Joined:
    Mar 24, 2015
    Posts:
    23
    If anyone is still being perplexed by this, make sure after you add the weapon in and get it scaled and placed in the hands, set the root weapon to the "gun" layer, and select to apply it to all children. The weapon may already be in the "gun" layer, but some of the models, etc. may not be.
     
    Last edited: Nov 11, 2017
  6. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    139
    I'm working on a more simplified FPS, the kind where you pickup weapons and ammo by running over them. Doom, Quake, Half-Life etc. Could a feature be added to allow that? As it is, I have to stop and look down at everything to pick them up one at a time, and it's really slow for a fast faced FPS.

    All it would really need to be is a public bool variable on the pickup scripts that tells the system it's been picked up. Then I can use Playmaker to trigger that when the player collides with it.
     
  7. falcoware

    falcoware

    Joined:
    Nov 23, 2014
    Posts:
    4
    Is there an instruction how to add a new zombie?
     
  8. GhereGames

    GhereGames

    Joined:
    Mar 24, 2015
    Posts:
    23
    I followed this tutorial. It doesn't have audio, but I was able to follow it pretty well.
     
  9. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Hi Tony,

    Thanks for that.

    Currently after a massive amount of work. Deleting my entire project folder contents and re-installing from a Backup that is fine as it was....

    Update Unity to latest version is Fine....Project Still works fine.

    Then update RFPSP and the issues start - I get some errors to sort out and things to update like no Hortrizontal input axis to fix and alike and console error messages are removed....except for Your Save System error messages...

    I clearly need to Update your Save System so I Update from the Unity site but still get Save System error messages in console - shut down Unity - then start it up again and the error messages persist.

    Currently your Save System seems to be the only console error messages I get that I need to get passed.

    I have attached a Screen Shot of the error messages.

    Any help would be appreciated as to what might cause the error and how I fix it.

    I will keep trying this end.

    Thanks

    Peter
     

    Attached Files:

  10. falcoware

    falcoware

    Joined:
    Nov 23, 2014
    Posts:
    4
    This is the view for the older version.
    Now much has changed.
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    Hi @petercoleman - The latest version of the Save System for RFPSP moved files into Plugins to give you faster compile times. There's a note in the release notes, but it's easy to miss. Before importing the latest version, delete the folder Assets / Pixel Crushers / Common. Then, when you import the latest version, you'll find that the Common folder has moved to Assets / Plugins / Pixel Crushers / Common.

    Since you're on the latest RFPSP, there's a second note that doesn't apply to you, but for others using the Save System with UFPS prior to 1.4x (i.e., back when RFPSP was using GUIText instead of Unity UI), add the symbol "RFPS_1_2" to Edit > Project Settings > Player > Scripting Define Symbols.

    Use the short script that's in this post.
     
  12. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    295
    Quick question. I am parachuting into one of my scenes to start the game but once I land, since I've been in the air so long, the Fall Damage Threshold in FPSRigidBodyWalker starts me off with a lot of damage. Does anyone have any ideas how I can add another variable to the script to account my slow earthly descent? Thanks.
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    FPSPlayer has an invulnerable bool. You could set it true during the descent and then set it back to false after the player has landed. Or just set the fall damage threshold so it's impossible to take fall damage until after landing. I recommend writing a separate script to do this instead of directly editing FPSPlayer / FPSRigidBodyWalker. This way you won't lose your changes if you update RFPSP.
     
  14. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Hi Tony,

    Thanks very much for that. After deleting the Common Folders I had and reinstalling the save system the console errors I was getting were gone and RFPSP now works so I am OK except for having to update a lot of things that had been lost by updating both Unity and RFPSP and after that updating a lot of other assets that have updates available and installing even more assets I have gone and purchased so a lot to do :)

    Not sure if the Save System is still working correctly or needs any further intervention by me but at least I seem to have no major errors now!

    Thanks again very much for your help which is very much appreciated.

    Peter
     
  15. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    295
    Toni - I like the Invulnerable idea. It's just a quick call in a OnCollider trigger or something. Thanks.
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    @petercoleman - If the Save System isn't throwing errors any more, it should work fine again. If something isn't working as you expect, most of the major components, like FPSPlayerSaver, Save System, etc., have a Debug checkbox that will give you extra info in the Console.

    @jnbbender - Happy to help!
     
  17. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    295
    Question - I'm using the SoldierBadOps on a pretty flat terriain. When I stand on the flat/hilly terrain they chase after my FPSPlayer and shoot at me just fine. But I am also using sniper towers. When I put my FPSPlayer in a tower and they notice me, they move REALLY jerky. They perform the Run animation once stop, wait, and do it all over again. When they run they sometimes don't get very far.
    Finally, when I climb down, they Run after the FPSPlayer just fine. Initially I thought it was a NavMesh problem but if that were the case wouldn't it always be a problem?
     
  18. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Hi Tony,

    Thanks for that and the pointer to the Debug Checkbox.

    The Save System seems to be OK now. Not checked it out extensively but no console errors again today :)

    I have some other assets that have and need updates though. Tried another last night and that also took out my project saying there was a duplicate class in a Door script unrelated to anything I could find as it refers to a script which has not changed in a completely unrelated asset which has existed for a long time and has worked fine. Errors said there was a duplicate in the Global Namespace which I have no idea is or where to view the contents of or find. Could not really find anything helpful via a Google Search. As a result I had to again delete the project folder and start again from a stable backup I had made with the Unity/RFPSP/Save System updates Updated. So back to working OK now.

    With around 180,000 items in the project folder when making multiple backups and managing the files overall is a big job and it takes hours to backup or copy the entire contents around constantly...

    I still need to add many assets yet as RFPSP prefab does not have enough features and functions for what my game needs by far, largely to provide a lot more player interaction with the game environment and game play features/dynamics.

    When things go haywire with Unity and RFPSP I often think of switching to another FPS framework but that's for another day if ever and that probably means more probs and not less and I need to be productive too. I may stick with it but it has few integrations with other assets that provide features I need.....

    One day I may get your dialogue system which I always have my eye on but don't need it yet.

    My next major effort is to add many more custom characters to the game which I have already set-up/prepared/converted RFPSP ready to import from a separate "Characters" only project. After that its change the Player character (hopefully) and then back to more scene/level development as I go.

    Ah well..I will leave you alone now.

    Onwards.

    Thanks very much once again.

    Peter
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    Hi Peter - A namespace is like a brand name, like "Jif" or "Skippy" for peanut butter. If you go to the store to buy "Skippy peanut butter," the brand label on the jar tells you exactly which one to pick up. But if the Jif and Skippy companies only put "peanut butter" on their labels without any brand name (namespace), you wouldn't know which to pick up.

    When a script is in the global namespace, this means it's missing a brand label. In your project, you had two Door scripts in the global namespace. The error message means Unity didn't know how to distinguish them. The solution is usually to ask the developer to put their scripts in a namespace to avoid these conflicts.

    Hi Peter - Consider using a version control system. When using version control software like Subversion or Git, if you don't like a change you can tell it to revert to a previous version. This only reverts the files that were changed, which is much faster than copying back an entire backup.
     
  20. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    79
    Hi, is there a quick way to automate moving(walking) the player to a fixed position automatically?
    Perhaps without a navmesh agent. Just bypass the input temporarily, make the player walk to a spot, then allow them to resume control or take over. This is useful for triggering an extra animation at an exact point, like opening a door in third person which has to start at an exact point in world space.
    Cheers
     
    Last edited: Nov 12, 2017
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    There's a somewhat quick way. The FPSCamera GameObject has a script named MovePlayerAndCamera. Before taking control of the player, call the script's ReleaseMainCameraAndMovePlayer() method. Then move the player. Finally, call ReleaseMainCameraAndMovePlayer() again.

    How you move the player is up to you. You could write a short script that plays an animation with target matching to get it into an exact point. The ReleaseMainCameraAndMovePlayer() method just frees up the player so you can control it.
     
  22. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    79
    Ok so I could call that method, enable a navmesh agent, pathfind to exact pos, and when reached force to an even more exact pos, force a final rotate, then perform the action, then call releasemaincamera again. Iv force to 3rd person when this occurs because it wont work in 1st.
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    The ReleaseMainCameraAndMovePlayer() method should let you control the character in 1st or 3rd person. If it doesn't, I suggest contacting Azuline.
     
  24. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    79
    ok cool thanks.
    I have another quick question - when adding a new weapon, how do i set the left/right hand positions in 3rd person when holding Idle, and aiming?

    Edit - Its all done in the animation - fair enough..
    Perhaps I can add an IKPass to one hand based off a a relative position off the other hand, for each animation, that way you dont have to redo all the animations for a weapon with a different hold for just one hand.
     
    Last edited: Nov 13, 2017
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    Hopefully someone else can answer. It's been forever since I added new weapons in RFPSP.
     
  26. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Hi TonyL,

    Thanks for all your help and advice here.

    Peter
     
  27. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Hi,

    This is for the developer Azuline or possibly anyone else who has knowledge or info about this....

    I am reporting what seems to me to be a bug...

    In the recent versions of RFPSP - noticed since the updates containing 3rd person (never noticed this before)....

    I have an issue with NPC's dis-appearing...in the following scenario....

    I have two characters which are Allies and use follow (and follow on use) the Player which work fine as far as it goes, however...

    When they are close to the Player and as the player I walk into them (touch or bump them) sooner or later they will dis-appear from view (or level). In fact I believe they fall out of view - for example where they are on a road in a city and there is a terrain which is not perfectly flat below - they I believe fall to a location below the road out of view....

    Whatever they behave perfectly until the player "Touches" them and then dis-appear.....Not sure if anyone else has encountered this but I only discovered it when actually bumping into them when using the follow command or pushing the characters around physically purposefully to test the issue out....I have noticed that particularly if as the Player you move to touch them so that presumably the colliders of both Player and an Ally character or perhaps the mesh of both are touching or intersecting and stay in that position without for a couple of seconds moving back away then they seem to always dis-apear as if the two cannot share the same space and they are forced downwards below any surface in my instance.. road or pavement! This happens both with the a default RFPSP Ally or custom model Ally Character....

    All roads,pavements and other walk-able areas have box or other colliders, are static and are set up correctly also in the Navmesh settings and the navmesh baked as static and with heightmap also baked to the scenes for a more accurate bake.

    Unless I actually do what I have described and bump into them they are OK otherwise and it does not appear to happen with any enemies as in my case I only shoot them and never touch them.

    I can live with this for now but one would not want to release a game where your mate dis-appears from the scene like this in front of your eyes...Now you see me, now you dont :)

    Thanks

    Peter
     
  28. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    79
    Theres a physics setting which allows you to set how much a collider is allowed to 'dip' into another one before the physics system will allow them so slide through each other.. myabe finding and adjusting that? I have seen stuff like this when ragdolls are enabled sometimes.
     
  29. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    295
  30. vincent_lade

    vincent_lade

    Joined:
    Sep 17, 2017
    Posts:
    45
    @TonyLi I'm really enjoying your save system, a question though: Saving if something is Disabled is easy but how do you save if something is Active? I have a lot of Triggers in my game and would like to keep track of which ones are active/deactive.
    Also: is there a way to have it so every time I hit a Checkpoint it creates a new Respawn point? Just so the character doesn't go back to the start of the level.
    All the best
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    Hi @vincent_lade - Thanks for using the Save System! Add an Active Saver component to a GameObject that's guaranteed to be active. (An empty GameObject will do.) Then assign the GameObject that can be active/inactive to the Active Saver's GameObject To Watch field.

    If you want to save the enabled/disabled state of a component, use an Enabled Saver instead.

    Active Saver and Enabled Saver were added in version 1.0.5, released on November 1.

    You'll need to edit FPSPlayer.cs. In the Die() method, replace this code:
    Code (csharp):
    1. //call FadeAndLoadLevel function with fadein argument set to false
    2. //in levelLoadFadeObj to restart level and fade screen out from black on level load
    3. levelLoadFadeRef.StopAllCoroutines();
    4. levelLoadFadeRef.FadeAndLoadLevel(Color.black, 1.2f, false);
    with this:
    Code (csharp):
    1. if (PixelCrushers.SaveSystem.HasSavedGameInSlot(0)) {
    2.     PixelCrushers.SaveSystem.LoadFromSlot(0);
    3. } else {
    4.     //call FadeAndLoadLevel function with fadein argument set to false
    5.     //in levelLoadFadeObj to restart level and fade screen out from black on level load
    6.     levelLoadFadeRef.StopAllCoroutines();
    7.     levelLoadFadeRef.FadeAndLoadLevel(Color.black, 1.2f, false);
    8. }
    where 0 is the slot number that checkpoints save to. When the player dies, it will load the last save point instead of restarting the level.
     
    YunLiang likes this.
  32. vincent_lade

    vincent_lade

    Joined:
    Sep 17, 2017
    Posts:
    45
    Thanks for the quick response, I downloaded the update but am now getting 18 Errors for FPSPlayerSaver.cs they are all "does not contain a definition for: heathUiObj / heathUiObjShadow / hungerUiObj / hungerUiObjShadow / thristUiObj" etc. along with that all my scripts scene-wide say "Nothing Selected" (I back-up everything before updating). Is this something on my end or the update not taking?
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    Looks like you're using RFPS 1.2x. Not to worry! The Save System supports 1.2x as well as 1.4x. The setup step for 1.2x is on page 5 of the manual, but you just need to select Edit > Project Settings > Player. In the Inspector, set Other Settings > Scripting Define Symbols to RFPS_1_2. If this field already contains symbols, add RFPS_1_2 separated by a semicolon. This tells the Save System to compile the code specific for RFPS 1.2x instead of 1.4x.

    If you get another error "The type or namespace 'Saver' could not be found...", then delete the folder Assets/Pixel Crushers/Common and reimport the Save System. That'll fix it.
     
  34. Felicityinc

    Felicityinc

    Joined:
    Nov 24, 2016
    Posts:
    16
    Hello everyone ,
    I've been using this asset for a week now. It is really amazing!
    But i can't figure out one thing:
    I want to pickup ammo when player collides with ammo and not with the reticle style. I've tried alot but no luck.
    Can someone help me with this?
    Thanks.
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,699
    Use the short script that's in this post.
     
  36. Felicityinc

    Felicityinc

    Joined:
    Nov 24, 2016
    Posts:
    16
    Thank you @TonyLi
     
  37. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Hi all,

    Thanks everyone who replied to my questions recently about NPC's dis-appearing on Player collision and other issues :)

    Much appreciated.

    Peter
     
  38. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    I Don't Seem To Find Any Checkbox To Enable Shooting While Running,Because Currently When I Sprint And Click Fire The Player Stops Sprinting And Then Fires While Moving,There Should Have TO Be A Checkbox To Enable that . Is It not There Or I Need To Dig Deeper :) To FinD it
     
  39. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    304
    Hey,

    I am considering buying this asset, but my goal is to use only the hands of the characters + their animations and some of the weapons. I am going to rewrite the logic for shooting and reloading following their template, because I need something simple. So my question is - can I somehow only get the hands (without the body) of the character to be animated with the weapon?
     
  40. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    295
  41. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    304
    I want hands, bow animation, sword, sword and shield for a medieval game... Does this package contains that?
     
  42. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    295
    Nope
     
  43. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Yes.

    Peter
     
  44. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    304
    I was asking about the other link, my question for this asset is if I can use the hands only (without the body) and keep all of the animations? Can you show any screenshots of the hands without gloves?
     
  45. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    304
    I have a package with first person hands that are rigged, so if you can spend 10 minutes to test if those hands will work nicely with this asset, please send me a message. I just want to know before I buy it.
     
  46. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    I know you guys have a system that allows an NPC to lead the player character along a path. Is there anything in the RFPS asset that allows me to add a voice to the NPC that triggers different audio clips as they walk through a triggerbox? If this is not included, can you recommend an asset that would help me do this?
     
  47. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    295
  48. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    I actually have this asset. Basically, I want to set up vocal audio for the character. I have zero scripting experience so I am looking for an asset to make this happen. RFPSP makes the companion that leads the way happen, I need something that makes that companion talk to the player. So the audio needs to source from the companion character, and it needs to trigger as the NPC walks along the path in certain areas.
     
  49. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    295
    Well I do know about an asset but it really is just a couple of lines of scripting and a collider.
     
  50. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    And that asset would be?

    For the game I am developing. I'm doing everything with nothing but assets with some help from developers. This is about learning the Unity process itself.

    My second game will focus more on learning code through visual scripting. It's a self made learning process I'm working with.