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
    How are you handling Zoom? Is something in the Zoom state causing a problem?
     
  2. GameTech

    GameTech

    Joined:
    Dec 26, 2012
    Posts:
    41
    @derkoi why not use the UFPS input system? In unity, find UFPS at the top, input manager, change right mouse button to something you want, currently it is zoom, then change what it does under the script that has vp_input in its name.
     
  3. SeanPollman

    SeanPollman

    Joined:
    Jul 10, 2012
    Posts:
    55
    Vission, how are the restructurings coming for multiplayer? its really what has been keeping me from using this asset.
     
  4. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,014
    Thanks I'll look in to that
     
  5. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,014
    Is it possible to have 2 different weapons/items wielded at the same time, like using both hands?
     
    Jaqal likes this.
  6. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    Yes. It is possible.
     
  7. Andy_

    Andy_

    Joined:
    Dec 12, 2013
    Posts:
    80
  8. Andy_

    Andy_

    Joined:
    Dec 12, 2013
    Posts:
    80
    Hi derkoi,

    We have this feature in our backlog but it's not decided when it will be implemented.
     
  9. kevdotbadger

    kevdotbadger

    Joined:
    Sep 13, 2011
    Posts:
    82
    Thank you for the update. I'm not a user yet, but I have a simple question. I looked through the docs about the UFPS tools and was impressed. However, is the inventory limited to weapons? If I create a item called Apple, can I use that as a quest item?
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,085
    Hi kevdotbadger, yes. The Dialogue System's plugin for UFPS doesn't differentiate between weapons and non-weapons. As long as it's defined as an item in UFPS, the Dialogue System will treat it the same.
     
  11. kevdotbadger

    kevdotbadger

    Joined:
    Sep 13, 2011
    Posts:
    82
    Thanks for your answer. I have a couple for @VisionPunk

    1 - Are the weapons predefined to controls? I notice that the gun in slot 1 was named 1Pistol. Am I correct in assuming that the reason the weapon is prefixed wth 1 is because that defines what slot the weapon is sat in? If I have 40 guns in my advancedPlayer prefab, does that mean I'll need to shift my weapons around to set them? What are the pros/cons add prefabs on run, say I craft a new weapon (see below), could I not instantiate that weapon when playing?

    2 - Any tips on implementing a damage/crafting system? What I was thinking was adding additional data to the 'weapons' which defines what items are needed to craft/repair said weapon. I'd also need a way to listen for the Shoot() event, and add damage to the weapon every time a shot is fired (kind o how Fallout does it). Is that possible? How would you tackle this problem?

    UPDATE

    I managed to do the first part of the second question (adding a condition value to a weapon, and applying damage to it on every shot). If the condition of the weapon is less than 0, the weapon won't fire. If anyone is interested in how I did it, the code is over at https://gist.github.com/kevdotbadger/daedad311f8bc3683fc0.

    Simply add the script to any weapon prefab and it should work. Also note that it currently doesn't check if the weapon is a gun or not, so it might/might not work melee weapon weapon.
     
    Last edited: Jul 2, 2014
  12. konsnos

    konsnos

    Joined:
    Feb 13, 2012
    Posts:
    94
    There is a problem with this implementation. First of all the camera in GO FPSCamera needs to get disabled. Also if player looks down he'll see the hand on its whole, as per image attached. Is there a quick fix for this?
     
  13. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    202
    Anyone know how to go about changing weapons in code? For example, when the scene starts, I want to change to the weapon assigned to 2.

    Also, anyone know why the rotation recoil doesn't work much until you're looking up? Anyone know how to fix this?
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,085
    Hi Tonzie, to change weapons in code, just call:
    Code (csharp):
    1. (yourPlayerObject).GetComponent<vp_FPWeaponHandler>().SetWeapon(2);
    By default, SetWeapon() plays the reload animation. If you don't want to reload, set vp_FPWeaponHandler.ReloadAutomatically to false before calling SetWeapon(). (This took me a while to figure out.) You'll also want to register a script with OnStop_SetWeapon to set it back to true when SetWeapon() is done. Use vp_FPPlayerEventHandler.Register() and Unregister() to register and unregister the script so it receives OnStop_SetWeapon messages.
     
  15. AlteredPlanet

    AlteredPlanet

    Joined:
    Aug 12, 2013
    Posts:
    452
    Hello, does any know how to change the input to a toggle instead of button hold? EX. to crouch press c and you stay crouched, press c again you go back to standing.
     
  16. AlteredPlanet

    AlteredPlanet

    Joined:
    Aug 12, 2013
    Posts:
    452
    uumm never mind.....o_O
     
  17. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    That is very cool. Thanks for the how-to!
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,085
    The credit should actually go to you, since you pointed me in the right direction on the UFPS forums. Thanks!
     
  19. cjow

    cjow

    Joined:
    Feb 29, 2012
    Posts:
    132
    Hey.

    Got an issue with stopping the player. Whenever the player is supposed to stop it carries on the motion it was carrying at the time of stopping. This only happens when one of the movement keys is pressed when stop is called. Here's what my ControllerFreeze.txt state and FreezePlayer method looks like:

    Code (csharp):
    1.  
    2. ComponentType vp_FPController
    3. MotorAcceleration 0
    4. MotorJumpForce 0
    5. MotorAirSpeed 0
    6. MotorSlopeSpeedUp 0
    7. MotorSlopeSpeedDown 0
    8. PhysicsForceDamping 0
    9. PhysicsPushForce 0
    10. PhysicsGravityModifier 0
    11. PhysicsWallBounce 0
    12. MotorDamping 0
    13. MotorAirSpeed 0
    14. MotorSlopeSpeedUp 0
    15. MotorJumpForceDamping 0
    16. MotorJumpForceHold 0
    17. MotorJumpForceHoldDamping 0
    18. PhysicsWallBounce 0
    19. PhysicsSlopeSlideLimit 0
    20. PhysicsSlopeSlidiness 0
    21. PhysicsWallBounce 0
    22. PhysicsWallFriction 0
    23.  
    Code (csharp):
    1.  
    2. public void FreezePlayer(Vector3 pos, Vector2 startAngle, bool freezeCamera)
    3. {
    4.     m_Input.AllowGameplayInput = false;
    5.     LockControls(freezeCamera);
    6.     m_UnFreezePosition = m_Controller.transform.position;
    7.  
    8.     m_Player.SetState("Freeze");
    9.     m_Player.Stop.Send();
    10.  
    11.     m_Controller.SetState("Freeze");
    12.     m_Controller.Stop();
    13.  
    14.     m_Camera.SetState("Freeze");
    15.     m_Camera.Stop();
    16.     m_Camera.StopSprings();
    17. }
    18.  
    I'm not sure if I'm missing something or not though or if something in my freeze method is conflicting with player input.
     
  20. Z43D

    Z43D

    Joined:
    Jan 2, 2013
    Posts:
    100
    Hey, I just had a few quick questions. I didn't see anything in the manual nor did I see it brought up in the 10-15 or so pages I read of this thread.

    The way I have my GUI set up, the Main Menu is in a separate scene and loads the playable level additively, pretty common practice. It destroys the contents of whichever scene was previously loaded before loading the new one. Problem is, I have everything included in my scenes tagged under "Level" When I attempt to parent the controller prefab under "Level1" for instance, it throws quite a few errors and the controller/camera goes all wonky.

    I can load the controller prefab into the scene with my main menu and just have it persist through level changes but I run into some camera orientation issues with the GUI. What would be the quickest way to get the controller parented somehow into the level contents? I feel like I'm overlooking something simple...Also, is there a quick way to have instantiated objects automatically parented under the level hierarchy I've created? After destroying a crate for example, it will persist to the menu screen and won't get destroyed properly if the prefab hasn't loaded back into the scene before exiting.

    Also, I noticed some issues with the footstep manager and reverb zones. They occasionally sound very muffled. Any idea what that's all about?
     
  21. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    can anyone recommend a nice weapon pack with arms from the asset store to go with UFPS, I did get the Vision punk one ages ago but wanted to add some more (but keep the same style arms).

    cheers in advance
     
  22. waseem2bata

    waseem2bata

    Joined:
    Apr 17, 2014
    Posts:
    8
    hi thanks i love it but .. i have this error i (Serialization depth limit exceeded at '::vp_State'. There may be an object composition cycle in one or more of your serialized classes.) any help please ???????????????????????????
     
  23. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    Check @cal 's post here. (There is a 1.4.7c version that fixes the error).
    http://visionpunk.vanillaforums.com/discussion/comment/4431/#Comment_4431
     
  24. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    202
    Is there any code documentation for uFPS? I can't seem to find any.
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,085
    +1! It would be great if you could run UFPS through Doxygen. I did this for my own reference so I could click through a linked version of the code, but an official version (maybe with XML documentation tags) would be great! Jacob Pennock released a nice Unity plugin for Doxygen that makes it really easy.
     
  26. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    202
    Wow, that looks like it could be super helpful. Thanks!
     
  27. Andy_

    Andy_

    Joined:
    Dec 12, 2013
    Posts:
    80
    Hi kevdotbadger,
    The reason the weapons are named 1 2 3 4... is that they are alphabetically sorted in order to work with the weapon handler system. We don't recommend that you remove a weapon from that list during runtime since UFPS's code assumes that the weapons are in a certain order.

    It's possible to code around but is probably a major coding task ( Here be dragons ). You would have to look at how the waeapon handler system works. Examine the start and awake functions in vp_FPCamera , vp_FPWeapon and vp_FPWeaponHandler and see what they do with the weapons there. Then its possible to extract that logic to a specific function that would refresh the weapon hierarchy.
     
  28. Andy_

    Andy_

    Joined:
    Dec 12, 2013
    Posts:
    80
    Hello cjow,

    It looks like the code you have written should work.
    Now It depends on where and when this function is executed. Is this a separate script? Or is it located in vp_FPController?

    Sometimes helps to see what happens if you change the execution order of the scripts. That is: move them to either end of the default execution time, one at a time (under Editor -> Project Settings -> Script Execution Order).
     
  29. cjow

    cjow

    Joined:
    Feb 29, 2012
    Posts:
    132
    Hi, thanks for the reply.

    I solved the problem. Had some redundant code from a custom playmaker action, setting player states and stuff, that was conflicting with it. Changed it and it's now working as intended.

    Thanks again though.
     
  30. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    202
    Is there any way to apply the positional/rotational spring system to objects other than weapons? I have one object in the scene that I'd like to always use the spring system, but I'm not sure how to go about it. Is it even possible?
     
  31. Lostlogic

    Lostlogic

    Joined:
    Sep 6, 2009
    Posts:
    691
    Is there a simple way to disable the camera movement (rotation)? When a dialog box appears I want the player to stop spinning the view around.
     
  32. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    I hope that you will find something that you can use in this answer. http://visionpunk.vanillaforums.com/discussion/comment/4560/#Comment_4560
    If that's not what you mean, then maybe take a look at the turret gun code in the demo scene #1, where the camera is constrained a great deal. Is it possible that you would want to use MouseCursorZones?
     
  33. dbryson

    dbryson

    Joined:
    Nov 9, 2009
    Posts:
    269
    I'm having some problems with the Footstep manager and the vp_SurfaceIdentifier script. About half the time when I attach the script to a collider, it says it can't find the vp_FootstepManager in the hierarchy (even though I have an AdvancedPlayer prefab in the scene with a vp_FootstepManager attached to it). At some point it does find the vp_FootstepManager, but you can only select the first entry (i.e. the 'Rock' default). The dropdown will popup, but no matter what you select it just stays set to 'Rock'.
     
  34. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    I remember, long ago (November of 2013), something that @PatrickOtten pointed out at line 140 in vp_SurfaceIdentifierEditor.
    There is a line like this : EditorGUILayout.Popup("Surface Type", m_Component.SurfaceID, surfaces);
    And at that time, your problem was fixed by making it look like this : m_Component.SurfaceID = EditorGUILayout.Popup("Surface Type", m_Component.SurfaceID, surfaces);
    That fix was for a version prior to 1.4.7 and 1.4.7c, but perhaps it still needs to be fixed? I notice, upon running a grep on my files, that I made that change in 1.4.4, but not in 1.4.5, nor 1.4.6, nor 1.4.7, nor 1.4.7c, but I honestly didn't use those ones between 1.4.4 and 1.4.7c for anything other than just playing around and testing. I cannot recall having attempted to make a surface in 1.4.7c, so I don't know if you should attempt that quick fix or not ... it would be easy for you to try though.
     
  35. dbryson

    dbryson

    Joined:
    Nov 9, 2009
    Posts:
    269
    Holy S***, that does work to fix the problem where you can't select anything but 'Rock'. Thanks! It does not fix the 'Could not find vp_FootstepManager component in the hierachy' message however. That message can and does appear quite randomly even on colliders where you have previously selected surface type. It seems somewhat random, I say somewhat because when it is working it works on all objects but when it is not working it doesn't work on all of them.
     
  36. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    Please paste in the actual error message the next time that you see that, leaving in all of the gory details (file paths, names, etc.). It would be interesting to see what that is all about, as that is a very uncommon error.
     
  37. dbryson

    dbryson

    Joined:
    Nov 9, 2009
    Posts:
    269
    The error comes from vp_SurfaceIdentifierEditor.cs right here:

    Code (csharp):
    1.  
    2. public virtual void DoSurfaceTypesFoldout()
    3.     {
    4.      
    5.         vp_FootstepManager[] footstepManagers = vp_FootstepManager.FootstepManagers;
    6.  
    7.         if(footstepManagers == null || footstepManagers.Length == 0)
    8.         {
    9.             EditorGUILayout.HelpBox("Could not find a vp_FootstepManager component in the hierarchy.", MessageType.Info);
    10.             return;
    11.         }
    12.      
    13.         vp_FootstepManager footstepManager = footstepManagers[0];
    14.         if(footstepManager == null)
    15.         {
    16.             EditorGUILayout.HelpBox("Could not find a vp_FootstepManager component in the hierarchy.", MessageType.Info);
    17.             return;
    18.         }
    19.        
     
  38. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    uh-huh ... I hip to that section, but .... :)
    Please paste in the actual error message the next time that you see that, leaving in all of the gory details (file paths, names, etc.). It would be interesting to see what that is all about, as that is a very uncommon error.
     
  39. EmergingMobile

    EmergingMobile

    Joined:
    Aug 7, 2013
    Posts:
    16
  40. dbryson

    dbryson

    Joined:
    Nov 9, 2009
    Posts:
    269
    There aren't gory details, nothing in the console. See the attached images showing it working and not working. I literally just clicked around on other objects and then back to the one in these images.
     

    Attached Files:

  41. dbryson

    dbryson

    Joined:
    Nov 9, 2009
    Posts:
    269
    I have isolated the issue. It happens when you first open a scene or right after you play a scene until you click on the game object containing the vp_FootstepManager. I'm not sure what causes the problem, however.
     
  42. dbryson

    dbryson

    Joined:
    Nov 9, 2009
    Posts:
    269
    This seems like total spyware. You want access to everything. Everything on my phone including contacts and photos/videos and everything on my google account. I uninstalled it without playing.
     
    BrandSpankingNew likes this.
  43. EmergingMobile

    EmergingMobile

    Joined:
    Aug 7, 2013
    Posts:
    16
    Certainly no spyware, but thank you for pointing that out to me. I can't believe I left all of those permissions in the manifest. My brother even mentioned that the other day, but I forgot to remove them. I am using the AndroidNative plugin which adds all the permissions to the manifest that you would need to use all of it's functions (It adds a lot for the cloud messaging features, however this app does not use it.) Anyway, I have removed the ones not needed and have submitted the update to the Google Play Store. Should be updated within a couple hours. Again thanks for alerting me, and sorry about the concern!
     
  44. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    I think ..uhh.. what do I think?... I think that this is surely one for Cal or Andy. It's not happening for me (and that's aggravating! ha!) and that's probably just dumb luck, 'cause mostly this kind of thing happens ONLY to me. :)
     
  45. Andy_

    Andy_

    Joined:
    Dec 12, 2013
    Posts:
    80
    Go to row 48 in the vp Footstep Manager.cs and add this line before the start of the if case:

    mIsDirty = true;

    will that solve the issue?
     
  46. dbryson

    dbryson

    Joined:
    Nov 9, 2009
    Posts:
    269
    Yes, that makes it work properly.
     
  47. SeanPollman

    SeanPollman

    Joined:
    Jul 10, 2012
    Posts:
    55
    With the upcoming changes to UFPS for multiplayer refactoring and adding 3rd person, how will it effect projects already in development using UFPS? will the conversion be simple or will it cause major issues?
     
  48. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    738
    Hi, is there gamepad support built in? or pre-configured, or sample scene or prefab included?
     
  49. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    779
    There is a custom Input Manager which allows you to change keybindings, but its been a while since ive used this system and I cannot remember if it supports gamepads. Check out their docs, something might be in there.
     
  50. Sunwoo-Jeong

    Sunwoo-Jeong

    Joined:
    Apr 26, 2014
    Posts:
    4
    Hi, im Andy and I'de like to make two objects to move by one switch using 'Moving Platform' and 'Platform Switch' . I set all of the need(Waypoints and things) and i made those two platforms to move by one switch(setting two 'Platform Switch' in one switch object) but only one of the platform moves. No problem at my setting. Help!
     
Thread Status:
Not open for further replies.
unityunity