Search Unity

UFPS : Ultimate FPS [ RELEASED ]

Discussion in 'Assets and Asset Store' started by VisionPunk, Mar 9, 2012.

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

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    @unicat, I am not familiar with that system. What method do they use in their demo's to do damage to the player? In UFPS, it is a very simple SendMessage concerning Damage. Perhaps taking a look at DemoScene3, and noticing how the machinegun on the hill sends damage to the player would allow one to adapt a different system to incorporate that simple messaging scheme. Perhaps studying how the UFPS EventSystem functions would be of some help, since that is central to the functioning of nearly everything.
     
  2. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    In advanced ai pro they use a Player health script, but it doesn`t work with ufps. Looking in demoscene 3 now. Thank you for the tip.
     
  3. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Got it working after looking in the demoscene 3. Some changes and it works now. Great, thank you.
     
  4. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    Hmm, photon. I guess I could work with that.

    I've tried this, to no avail.

    hmmm, I'd have to ask VisionPunk about that- he may know how to tweak the system.

    Again, this doesn't work. When the character dies, at the minute, either he loses everything (clear on death) or respawns with the same amount of ammo he had before he died.
     
    Last edited: Oct 18, 2013
  5. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    @Fishman92, because I always start empty handed, I had not noticed that behavior. I fully load my weapons in inventory and then when the game starts the player selects a weapon and it does start up with a full compliment of ammo.

    Picking up a weapon will take care of itself. That parts already done for you. A variable to track the weapon that was in your hands when you did the pickup would allow you to then remove that weapon from your inventory and then spawn that same weapon prefab near to where you just did the pickup. Then one would move the current weapon into your own current weapon variable so that you would be ready for the next pickup-drop cycle.

    Giving yourself a full compliment of ammo could be done at the end of the player respawn thus...just as a dirty example:
    m_Player.AddAmmo.Try(new object[] { "1Pistol", 19}) ;
    m_Player.AddAmmo.Try(new object[] { "2Revolver", 6}) ;
    m_Player.AddAmmo.Try(new object[] { "3Machinegun", 50});
    m_Player.AddItem.Try(new object[] { "AmmoClip", 10 }) ;
     
    Last edited: Oct 17, 2013
  6. Prt0100

    Prt0100

    Joined:
    Oct 17, 2012
    Posts:
    14
    I'm still having that same problem with changing the boolean. I made a test script with a public boolean value, but placed it in the 'plugins' folder, so it should be executed first. I can't do the same with UFPS, or I get errors and everything breaks. I looked into the script execution order and still have errors. Here is a screenshot of my problem. In this case, line 181 works (script is in plugins folder) but line 182 does not. You can see that I moved the execution of the script calling the value (Inventory) AFTER the vp_FPInput is compiled/executed.

    This is my dual monitors, so you will have to click and scroll to see both ends of the image properly. http://puu.sh/4U3UW.jpg

    Any help is tremendously appreciated, this has been hindering development for awhile
     
  7. Wampy

    Wampy

    Joined:
    Sep 9, 2013
    Posts:
    14
    I bought UFPS and the AI add on.. they are both pretty darn cool. Quick question. If I buy A* Pathfinding Project Pro can I use the Pro versions of pathfinding in UFPS .
     
  8. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    @Wampy, the short answer is ... yes. It might require some labor to get it just right. One might need to be sure about how the Pro version is imported, or perhaps how UFPS is imported ... leaving out the A* Pathfinding free stuff, or allowing it to be overwritten. There are conversations about this on the Official Forum.... I just checked. :p ... it is searchable, as opposed to this mess here where I am sure this topic has been covered but may as well have been written into the void.
     
  9. justinl

    justinl

    Joined:
    Aug 27, 2012
    Posts:
    58
    Is your Inventory.js script attached to the player? If so, why not just create a public variable to hold reference to the vp_FPInput, drag the vp_Input into that slot in the editor, and then use that reference instead of using GameObject.Find() each time to grab reference to it each time you need to access it.
     
  10. smerf123

    smerf123

    Joined:
    Aug 26, 2011
    Posts:
    102
    I've ran into a little problem in the latest version (Not sure if its been mentioned)
    But when I hit the left mouse button the shooting is repeated untill I press right mouse.
    What is causing this, is racking my brain.
     
  11. justinl

    justinl

    Joined:
    Aug 27, 2012
    Posts:
    58
    That's a clean install on an empty project?
     
  12. smerf123

    smerf123

    Joined:
    Aug 26, 2011
    Posts:
    102
    Yes it is. Even the standard pistol, machine gun etc.
     
  13. justinl

    justinl

    Joined:
    Aug 27, 2012
    Posts:
    58
    What version number exactly?
     
  14. smerf123

    smerf123

    Joined:
    Aug 26, 2011
    Posts:
    102
    it is v1.4.4b. My apologies I should of specified the specifics in my original post.
     
  15. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    Are you using PlayMaker by any chance? If yes, then this info from the Official Forum might help : "The playmaker GUI uses the mouse cursor by default. Unchecking "control mouse cursor" should fix this problem."
     
  16. Upstage

    Upstage

    Joined:
    Nov 16, 2012
    Posts:
    25
    I've been looking at the weapon reloader script for a couple days to try and modify it so if the loaded ammo is less then 1 it will play one reload animation and if the loaded ammo is equal to or greater then 1 it will play another reload animation but I can't figure out where in the script the actual animation is called.
     
  17. justinl

    justinl

    Joined:
    Aug 27, 2012
    Posts:
    58
    It's called in the OnStart_Reload() in vp_FPWeaponReloader.cs.

    Specifically line 123:
    Code (csharp):
    1. m_Weapon.WeaponModel.animation.CrossFade(AnimationReload.name);
     
  18. arcdragon1

    arcdragon1

    Joined:
    Oct 15, 2012
    Posts:
    116
    At First Add weapon and plural weapons.
    Excuse me. I'll question a rudimentary.
    At the beggining, I'd like to create a situation that Player has already weapon, or plural weapons.
    I write the following source,
    but Ammo is 0...,
    and having plural weapons is unknown me...
    In that case, How can I complete in Start()?
    Could you help me about it?

    Code (csharp):
    1.  
    2. public GameObject Player = null;
    3. public vp_FPWeaponHandler WeaponHandler = null;
    4. public vp_FPPlayerEventHandler PlayerEventHandler = null;
    5.  
    6. void Start () {
    7.     WeaponHandler = Player.GetComponentInChildren<vp_FPWeaponHandler>();
    8.     WeaponHandler.SetWeapon(1);
    9.     PlayerEventHandler = (vp_FPPlayerEventHandler)Player.GetComponentInChildren(typeof(vp_FPPlayerEventHandler));
    10.     PlayerEventHandler.Register(this);
    11.     PlayerEventHandler.SetPrevWeapon.Try = delegate() { return false; };
    12.     PlayerEventHandler.SetNextWeapon.Try = delegate() { return false; };
    13.        
    14.     WeaponHandler.CurrentWeapon.Wield();
    15.     string InventoryName = "1Pistol";
    16.     PlayerEventHandler.SetState(InventoryName);
    17.     PlayerEventHandler.SetWeaponByName.Try(InventoryName);
    18.     PlayerEventHandler.AddAmmo.Try(new object[] { InventoryName, 7 });
    19. }
    20.  
     
  19. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    I prepared a simple test. I get the weapons listed and the player starts with a loaded pistol. I have all of these weapons "Have" set to zero in the inventory before beginning. I am not sure if this is what you are asking.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class LoadMyGuns : MonoBehaviour
    6. {
    7.    
    8.    
    9. private vp_FPPlayerEventHandler m_Player = null;
    10.    
    11. public bool PopulateGuns    = true;
    12.    
    13. // This line is placed into the
    14. // vp_FPPlayerEventHandler list of messages that it
    15. // will forward ...     public vp_Message LoadMyGuns;
    16.    
    17.  
    18. // Gain access to the Event Handler    
    19.    
    20.     void Awake()
    21.     {
    22.     m_Player = transform.GetComponent<vp_FPPlayerEventHandler>();
    23.     }  
    24.  
    25.    
    26. // This script is my Event Target so I shall
    27. // Register/UnRegister as instructed in the manual 
    28.  
    29.     protected virtual void OnEnable()
    30.     {
    31.         if (m_Player != null) m_Player.Register(this);
    32.     }
    33.  
    34.     protected virtual void OnDisable()
    35.     {
    36.     if (m_Player != null) m_Player.Unregister(this);
    37.     }
    38.    
    39.    
    40.     // Call our "own" message at Start up
    41.     // in order to get the guns the first time.
    42.    
    43.     void Start()
    44.     {
    45.     m_Player.LoadMyGuns.Send();
    46.     }
    47.    
    48.     // Not very elegant, but adequate for this test.
    49.    
    50.     void OnMessage_LoadMyGuns()
    51.     {
    52.     if (PopulateGuns)
    53.     {
    54.        
    55.     m_Player.AddItem.Try(new object[] { "1Pistol", 1 }) ;
    56.     m_Player.AddItem.Try(new object[] { "2Revolver", 1 })   ;
    57.     m_Player.AddItem.Try(new object[] { "3Machinegun", 1 }) ;
    58.  
    59.     m_Player.SetWeaponByName.Try("1Pistol");
    60.            
    61.     m_Player.AddAmmo.Try(new object[] { "1Pistol", 19 })    ;
    62.     m_Player.AddAmmo.Try(new object[] { "2Revolver", 6})    ;
    63.     m_Player.AddAmmo.Try(new object[] { "3Machinegun", 50}) ;
    64.  
    65.     m_Player.AddItem.Try(new object[] { "AmmoClip", 1 })    ;
    66.    
    67.     }
    68.    
    69.     }
    70.    
    71. }
    72.  
     
  20. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I'm trying to work on a way to save from scene to scene what guns the player has and when I copied your code to my project (fresh USPS install) I get an error at line 44. Which makes sense since the m_Player script does not, in fact, include a definition for LoadMyGuns. Can you share what edits you made to fix this? Or is there something I am missing?

    oh, wait, you answer that @ line 12ish
     
    Last edited: Oct 22, 2013
  21. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    It is a pleasure, a pure pleasure, that my little test has helped you in some small way. Good Luck in all of your work. :cool:
     
  22. arcdragon1

    arcdragon1

    Joined:
    Oct 15, 2012
    Posts:
    116
    Dear BrandSpankingNew
    It nice works! This is exactly what I'm wanting.
    Thank you very much.
     
  23. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    And thank you for posting it! I'd spent an hour or so digging through the code trying to decipher how to change that Have variable to a 1 in code. Came here here to ask and there it was. The answer. All nice a neat. Still needs a little adjustment to make it so I can save that information, but that should be no problem.
     
  24. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    My advanced player walks into a room (sounds like the start of a joke) and my FPS goes from close to 200 to 1. There is nothing special about it, it has table and it's lightmaped. It's the strangest thing. Where do I start debugging this. This doesn't happen anyplace on the map.

    Edit: it has something to do with colliders. Not all of them, just some objects/surfaces that have colliders. Has anyone else seen this? Thanks.
     

    Attached Files:

    Last edited: Oct 22, 2013
  25. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    @topofsteel, is this only happening while the development environment is running, or does it also happen in your stand-alone exe? In answer, no, I have not seen this, but the intensity of your scene in conjunction with the environment running is probably way over the top compared to the simple things that I do .... and that is why I ask about performance outside of the Unity development environment.

    p.s. did the bartender ask him what the duck wanted to drink? lol!!
     
  26. deantzy01

    deantzy01

    Joined:
    Oct 23, 2013
    Posts:
    11
    thats great stuff to learn!
     
  27. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,204
    Visionpunk or whomever might know,

    Is there any support for Mecanim, either with the UFPS or the AI add-on currently? I believe I read somewhere that it's going to be integrated soon, but I wasn't sure if it has been or not. If not, are we looking by the end of year?

    Thanks.
     
  28. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    There's no support for mecanim for anything and they haven't given any vague release dates. Player mecanim support was pretty easy for me to build into their event system for my specific state machines, but I was waiting for 4.3 to do it for the AI and I bet they are as well. Until we have jump to state and such (which is crazy that it wasn't part of mecanim's initial release) managing mecanim states generically for a plugin like this I would think would require a lot of hacky code they may not want to bother with.
     
  29. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    Cal gave an update on October 3rd. He was speaking about the multi-player add-on in that case (over on the Official Forum). He said that it was slated for Q4, but not which month. He also said, "The asset will be Unity4 only (due to Mecanim integration of the third person body)." . That leads me to believe that Mecanim will be included in "everything". I have also read posts by others who were working upon their own Mecanim "ways" that they have ceased that effort because of the anticipation of it being included in the next release.
     
    Last edited: Oct 24, 2013
  30. LiminalHeart

    LiminalHeart

    Joined:
    Jun 8, 2013
    Posts:
    6
    I must be missing something incredibly simple, but following the above steps only results in half an implementation. When running the game, the left lens renders with the proper camera effect but the right side of the screen is normal (as if the regular UFPS camera has just been chopped in half). Any idea what I'm doing wrong?
     
  31. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    Same problem. I thought iy might be the SDK. The asset didn't look the same as the screens. Was waiting to try again.
     
  32. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    In the editor and standalone player. I turned off the offending collider. I'll see if I can create a small scene that demonstrates the problem but I'm pretty sure it was my model. Thank you.
     
  33. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    $UFPS1.4.5.jpg

    Hey folks!

    Ultimate FPS 1.4.5 is now available on Asset Store and visionpunk.com. This release focuses on providing a robust base for the upcoming UFPS mobile add-on. It also makes the transition from Unity 3.5.x to Unity 4.2.x. UFPS now requires atleast Unity 4.2.1 (do not upgrade if you plan to keep your game on Unity 3).

    New features

    UFPS input manager
    The new extensible Input Manager allows creating more robust input schemes such as touch input for mobile. This system removes the need for hard-coded keycode checks. It also allows your scripts to rebind controls at runtime (which is not supported by the standard Unity Input Manager). See the method description of vp_Input.ChangeButtonKey for more info. With this addition, we no longer recommend using regular UnityEngine.Input or third party input assets as previously proposed.

    Pool manager
    For the un-initiated: on potentially low-end platforms such as weblayer or mobile, the NET garbage collector system (that Unity scripts run on) may result in serious stuttering or slowdowns if a lot of objects are allocated and destroyed at runtime. A pooling system will manage the amount of objects of certain types that are allowed to spawn. Basically, if one too many spawns, the oldest one will be recycled and used for the new one. Pooling will only occur if the PoolManager component is placed on a game object in the scene and enabled.

    UFPS main menu item
    At long last, a UFPS dropdown menu is present in the main Unity menu bar, allowing quick access to the manual, browsing for addons, checking for updates and much more. Among the features can be found:
    • Update checker: This dialog will do an online check to compare your UFPS version against the latest one. It also has a very simple wizard to guide you through updating depending on your place of purchase.
    • Add-on browser: This dialog checks for the latest add-on products for UFPS and displays their icons in a list (only three in there now but this will be a steadily growing list). The icons can be clicked to open the Asset Store page for the respective product.

    FULL RELEASE NOTES

    Cheers

    Cal

    EDIT: Updated with more info and link to the release notes.
     
    Last edited: Oct 25, 2013
  34. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    congrats on new release

    the idea of adding pool manager and input manager is very nice

    any news on multiplayer addon? is it still in the works. any chance for it by this year...
     
  35. Upstage

    Upstage

    Joined:
    Nov 16, 2012
    Posts:
    25
    Great new release! I still have not been able to figure out how to modify the reloader script so that one reload animation will play if the loaded ammo is greater than or equal to 1 and another will animation will play if the loaded ammo is less then one. Does anyone have any ideas?
     
  36. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    Does that mean all the mouse logic is moved into input and out of the camera scripts?
     
  37. Upstage

    Upstage

    Joined:
    Nov 16, 2012
    Posts:
    25
    Also a suggestion I have for future updates would be a prone and prone crawl animation system.
     
    Last edited: Oct 25, 2013
  38. Sparrow96

    Sparrow96

    Joined:
    May 23, 2013
    Posts:
    5
    Thanks for another great update :)
    Keep 'em coming
     
  39. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    The 1.4.5 announcement has been updated with much more info and release notes.

    @im: Multiplayer development is underway and once mobile is out, it will be a very big focus. For more info see this thread in the official UFPS forum. We always keep it updated with the latest info on upcoming releases.

    @Upstage: Thanks for the suggestions. For reloading, note that the "vp_FPPistolReloader" included in the core UFPS package does not use animations. It is an experimental script that uses springs. If your weapon has a reload animation, what you need instead is the vp_FPWeaponReloader script, which should be very easy to modify to get what you want. Add a second animation clip at the top and make a new if statement in "OnStart_Reload" that chooses the reload animation to crossfade depending on how much ammo the weapon has, that is: "m_Player.CurrentWeaponAmmoCount.Get()". For prone, check out this answer in the official UFPS forum. Also, one tip is to read up on states and presets in the manual and modify the Crouch preset to make a prone which should be very easy.

    @Fuzzy_Slippers: Actually, no. I know, this is silly. This update rather dealt with replacing the input binding system. We will look into that though.

    @Nova6: Thanks :)
     
  40. Deepestblue

    Deepestblue

    Joined:
    May 11, 2009
    Posts:
    48
    Hi Calle,

    I have the same problem: VisionTimer and UltimateFPS in one project. Deleting vp_TimerUtility and the Examples folder fixes it, but well, I really want the examples in there to learn from it. It seems that the TimerUtility of the two packages is not the same file? Is there any solution for having both your fine packages in one project?

    Thanks!
     
  41. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi Deepestblue,
    As it happens I have just prepared a new VisionTimer update addressing this. Wanted to wait for the UFPS 1.4.5 release though because it has vp_TimeUtility changes. The new VisionTimer should be up sometime this weekend hopefully. Sorry for the inconvenience.
     
    Last edited: Oct 25, 2013
  42. Deepestblue

    Deepestblue

    Joined:
    May 11, 2009
    Posts:
    48

    Hi again and thanks so much for the very quick answer and help! I will happily wait. :)
     
  43. LiminalHeart

    LiminalHeart

    Joined:
    Jun 8, 2013
    Posts:
    6
    Just giving this question a bump, since a few after it have been answered.
     
  44. CodeMonke234

    CodeMonke234

    Joined:
    Oct 13, 2010
    Posts:
    181
    First - UFPS is awesome!

    Question - I am trying to use vp_SurfaceIdentifier but it won't let me select anything other than the first one in the list? It lists them but won't let me choose anything else?

    Thanks for any help...
     
  45. IHazABone

    IHazABone

    Joined:
    Oct 4, 2013
    Posts:
    1
    UFPS is a great asset, thank you very much for it.
    There is one thing - how might we add support for a vehicle? Could we attach a script that makes the vehicle a parent of the player? But then, we need to adjust the camera for a 3rd person view and different mechanics. And, what about transferring controls, as they will be different?

    Thanks in advance.
     
  46. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hey Pointycat. Sorry you're having this issue. This is the first time I've heard of anyone experiencing it. Please verify that you have done all the steps in the tutorial exactly right. Also, Rift setup can be a bit confusing because of the dual screen setup. Have you gotten your Rift to work with the Oculus Unity integration previously? Thanks

    EDIT: Just noticed this was answered in the official forum. Great, I'll look into this for the tutorial.
     
    Last edited: Oct 26, 2013
  47. LiminalHeart

    LiminalHeart

    Joined:
    Jun 8, 2013
    Posts:
    6
    The official post didn't resolve it (and I've definitely gotten the Rift/Unity implementation to work before, with both the Oculus camera and player prefabs, so it's not on that end). I'll answer over in the official forums to avoid clutter here.
     
  48. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hey, the new visionTimer update is available. More info: HERE.
     
  49. Deepestblue

    Deepestblue

    Joined:
    May 11, 2009
    Posts:
    48
    You rock, thanks so much! Already installed and working with it. :)

    (Now digging into how I can intelligently disable/freeze part of the character movement / shooting in order for the player be able to select gameobjects in the gameworld and moving them etc., but there's plenty of information on that around, just need to learn ...)
     
  50. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    Hello guys,

    I will leave this here since I couldn't find information on how to fix it and seen a lot of people requesting info.
    If you want to tweak the footstep sound (since it is too loud by default), you can do this:

    In vp_FootstepManager, go to: protected virtual void PlaySound( vp_SurfaceTypes st )
    and at the lines with m_audio.<something>, just add: m_Audio.volume = <float value between 0.0 and 1.0>;

    Br
     
Thread Status:
Not open for further replies.