Search Unity

FPS Kit | Version 2.0

Discussion in 'Assets and Asset Store' started by NSdesignGames, Oct 2, 2012.

  1. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    The problem is that WeaponPickUp.js was made for single player.

    The error is probably in "function Awake"

    Code (csharp):
    1. weapManager = gameObject.FindWithTag("WeaponManager").GetComponent.<WeaponManager>();
    Since there is many remote players with same WeaponManager, you will have change their WeaponManager tag at Awake and leave only your player with WeaponManager gameObject tagged as "WeaponManager". Also dont forget when your player is killed weapManager variable is lost.

    So you will have to modify WeaponPickUp.js to make it work properly
     
  2. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    @NSdesignGames

    I know now what i telling you is not a easy question but...

    How is possible to add a Login System when you log the player use the same time the name you used and save it into a SQL database like your game Warmarise?

    Thanks.
     
  3. Alexsander

    Alexsander

    Joined:
    Nov 26, 2012
    Posts:
    17
    I could make registration.
     
  4. SLIMEBASS

    SLIMEBASS

    Joined:
    Aug 26, 2012
    Posts:
    9
    Sorry i forgot to tell you that i was in single player :/ Anyway im have this wierd bug and im going to tell you in the best way i can:
    I cant pickup a instantiated weapon unless before I have gone to the original weapon prefab that I have put in another place and got up box
    ""Pickup I SWT-25"" then i can pickup the instantiated one, however, I do not even take up the original for it to work to pick up the instantiated. Its the same thing with ammo. If i dont get up the box before picking up it will just drop the current weapon in my hands but i wont lose it.

    Feel free to ask if you dont understand :)

    Cheers
     
  5. SLIMEBASS

    SLIMEBASS

    Joined:
    Aug 26, 2012
    Posts:
    9
    Get a login asset from asset store (Mine is comming up soon probably, I will call it "My Users") Then you can check out this http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.SetString.html and http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.GetString.html
     
  6. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
  7. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    I'm having issues while adding new weapons. I set the new weapon in the weapon manager, but when I select the weapon ingame I get this error:
    What's wrong ? :/
     
  8. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Try to replace "function Awake" with "function Start" in Weapon PickUp script

    Make sure weapon list do not have empty elements
     
  9. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    It doesn't :/ Can u send me an example prefab of a "weapon list ready" gun ? thanks

    PS: I've sent you some pm, do you have received them ?
     
  10. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    The error you described probably mean that weapon you assigned into list do not have WeaponScript.js attached (or it's disabled).

    Just checked your message, WhooKileldWho.cs was designed to receive kill notification from other players. But using that example you need to add your modification to make PlayerDamage.cs send message to WhoKilledWho.cs when your player kills itself and then display it on screen.
     
  11. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    @NSdesignGames

    if you going to make a new update can you please add this fatures?

    • Login System.
    • XP Level Mode.
    • Capture point mode.
     
  12. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    I'll give it a look tomorrow. Thanks for the support.
     
  13. Tim885885

    Tim885885

    Joined:
    Mar 21, 2013
    Posts:
    4

    yes, we need this!!!!!!!!

    and unlock skill and weapon or buy gun System.
     
    Last edited: May 29, 2013
  14. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    I've noticed that the script WeaponScript is automatic deactivated when I run the game, why ?
     
  15. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hard to tell, by default WeaponScript should be enabled all the time. Maybe you added some modification which deactivates the script?
     
  16. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    Nope .. That's weird. Can you give me an example package with just one gun to test ? Thank you so much .. I can pay for this if u want ..
     
  17. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Try next solution, create new JavaScript and paste this code then save:

    Code (csharp):
    1. var weaponScript : WeaponScript;
    2.  
    3. function Start(){
    4.      yield WaitForSeconds(0.05);
    5.      if(weaponScript != null){
    6.           weaponScript.enabled = true;
    7.      }
    8. }
    Attach it near each WeaponScript and assign variable.
     
  18. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    Damn! It still doesn't work. I've attached the script and then I've assigned the var with WaponScript, but I still receive "SendMessage selectWeapon has no receiver!" and when I stop the player I still see the WeaponScript that isn't active ! :( .... I'm very frustrated .....
     
  19. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    So WeaponScript is deactivated on prefab? If so just activate it and save prefab back.

    If it didn't helped, could you show screenshot of WeaponManager.js and WeaponScript.js in Inspector mode at the moment that error appear?

    Also what type of changes you made to NetworkPlayer prefab?
     
  20. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    @NSdesignGames do you think to make any new update?
     
  21. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    I already tried to enable it and then save the prefab, but when I quit the player I always find the weaponscript deactivate. Tomorrow I'll post a screnshot of my configuration. NetworkPlayer prefab is untouched ( as far as I remember ) ... Ok, tomorrow I'll post the screenshots !
     
  22. midorina

    midorina

    Joined:
    Jun 1, 2012
    Posts:
    131
    How would we go about adding one global ammo pickup? Right now I have a prefab with all triggers as childs with the names of all the weapons. Though it slightly bugs out a little. This only picks up the first childs weapon name and leaves the rest.

    How can we make it so when I go to an gameobject, it will refill all weapons (or give 1 clip to each)?

    You can take a look at how I've set it up on www.diminished-studios.com/minicombat - upon player death a crate will spawn and I want this to be a ammo refill for all current weapons you're holding.

    Thanks again!
     
  23. draulleo

    draulleo

    Joined:
    Aug 3, 2012
    Posts:
    27
    @NSGames, could you help me?
    I got the latest kit, but when I cant rewrite the room or player name, I can only delete it.
    Any ideas?
     
  24. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    Ok, here is the screenshots of the problem :

    1) My Configurations:









    2) Netwrokplayer WeaponManager :



    3) Ingame error:



    4) Then when I stop the player, the prefab and the script are disabled:




    Where is the problem ? :/
     
  25. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hey,

    There are many ways to do it. One of them could be:

    - Create Javascript which will receive message from picked item with amount of ammo (Script should be attached to root object near Character Controller)

    - This script will contain WeaponManager.js variable so when you pick item and receive message, this script than pass message to WeaponManager.js which then refill ammo of all Weapons from list


    You can't rename it in game or in Editor? If you can delete it, means that input works correclty

    Umm, your whole setup is wrong. Why did you separated Weapon from NetworkPlayer prefab and just randomly attached scripts there.

    Why don't you use example NetworkPlayer prefab or SinglePlayer prefab?
     
  26. technotdc

    technotdc

    Joined:
    Oct 21, 2011
    Posts:
    60
    are you missing the font of CustomGUIStyle ????
     
  27. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    I'm using NetworkPlayer prefab ! I can't find any weapon folder in the project, so I had to recreate it in that way. Please help, I'm stuck with my project :/
     
  28. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    So what you trying to do now is add new weapon?

    If so, go to Front Post: http://forum.unity3d.com/threads/153337-FPS-Kit-Version-2-0
    and see under tutorials the ones you need:

    First you need to check tutorial called "How to setup new weapon?"

    After you setup your weapon, check tutorial called "Setup 3rd Person Character for Multiplayer", scroll to the part where it talks about adding third person weapon which will be synced with your new first person weapon
     
    Last edited: Jun 2, 2013
  29. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    I only checked the tutorial "How to setup new weapon?" ! Maybe that's why I failed ! I'll read "Setup 3rd Person Character for Multiplayer" tomorrow ! I hope to fix that problem that kept me frustrated for 3 days !
     
  30. midorina

    midorina

    Joined:
    Jun 1, 2012
    Posts:
    131
    Thanks man, I got to work. It now refills your current weapon only to full ammo.

    I'm still having a problem with the Who Killed Who colours, how can I do a check to see if the player is on Team 1 or 2? I've set up the variables like you've said but am having trouble working out how it knows if that player is on team 1 or 2. Could you give an example? This one's beyond me T___T

    Thanks again!
     
  31. Steve-of-Construction

    Steve-of-Construction

    Joined:
    Jan 26, 2013
    Posts:
    67
    I have a similar problem and can't figure out how to add "Kill" points for the player and the correct team.
    Is there an easy way to send ExtraPoints from another script so the player and the team gets these points?
    For example if the player captures a controlpoint in conquest mode.
    I think this could be done with SendMessage somehow but can't figure out where and how the points are added.
     
  32. midorina

    midorina

    Joined:
    Jun 1, 2012
    Posts:
    131
    Can anyone confirm the Walk Animation Speed / Run Animation Speed and Crouch Animation Speed variables are broken in CharacterAnimation.js - Whatever speed I adjust it to, it still plays at 1.0 speed.

    Cheers!
     
  33. Josifjoey

    Josifjoey

    Joined:
    May 12, 2013
    Posts:
    14
    Yep i have just Dubble checked and i have the same issue :(
     
  34. TheBorDr

    TheBorDr

    Joined:
    Oct 14, 2012
    Posts:
    15
    Quick question.

    I am making a WWII game with this kit. I want team one, lets say, to be American with an American soldier model, and team two to be German with a German soldier model. Is there a way to have each team be only able to spawn one specific soldier prefab?

    Thanks,

    -TheBorDr
     
  35. midorina

    midorina

    Joined:
    Jun 1, 2012
    Posts:
    131
    Hi,

    You will need to set up some variables in your RoomMultiplayerMenu.cs and some extra buttons. On button press, make sure you set a bool a true, then do the relevant checks before spawning your player in. You can see the spawning of the player at void SpawnPlayer. I've done this with my project that you can check out www.diminished-studios.com/minicombat - if it will help you.
     
  36. draulleo

    draulleo

    Joined:
    Aug 3, 2012
    Posts:
    27
    You are a genius my man!
    Thanks ALOT!
     
  37. technotdc

    technotdc

    Joined:
    Oct 21, 2011
    Posts:
    60
    you're welcome
     
  38. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    Hi, I'm trying to modify the player's "inventory" by code in order to create a weapon selection menu. To access the NetworPlayer's WeaponManager variables from C# (since those scripts are written in JS) I've moved "FPSController" and "WeaponSystem" folders in Standard Assets folder (so those script will be compiled first and their varibles will be easily accessible form c# scripts), so I've written this code to access the inventory (note that playerPrefab is a gameobject with the NetworkPlayer prefab) :

    and it works ! if I put that line of code in a Debug.Log , I can read: "MP5KA4" that is the 1st weapon of the Networkplayer !
    By the way now I'm having some problems to assing another weapon to this slot.
    I was thinking to use this code to assing ie. the ballistic knife:
    But it doesn't seems to work.

    Any help ? :)
     
  39. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hi,

    Second line doesn't work because you try to find deactivated game object ("BallisticKnife" in your case).

    So what you need to do is store all weapons in variables and than access it via script
     
  40. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    It works thanks, mate you are GREAT ! :)

    I know that there is many people here that need a weapon selector menu, so I'll share how I did it :

    In WeaponManager.js I added
    and I've set it length to 5 (in the inspector), because I want that my player can only have 5 slots.
    Then I've add :
    This var will contain the weapon ID that I'd like to be stored in SLOT1 (weapon ID = number of the weapon in allWeapon var). I acess these variables from a c# script.
    Then in Awake() I've add:
    And finally replace every allWeapons variable with PlayerWeapons.

    That's all, now you can write your weapon selector menu (I've written it in RoomMultiplayerMenu.cs), just remember to put your selected weapons id in weap1/2/3/4/5 ...

    Have fun and enjoy this little piece of code that made me crazy for 2 days ^^
     
  41. Kazoos

    Kazoos

    Joined:
    Nov 28, 2012
    Posts:
    19
    NSDesign

    You shared a small peice of script to apply damage to a planet. However, I am now looking at putting a healthbar anove the planets and having this across the network so it destroys on clients too.

    I have been playing with the Health Bar script for players. However, it does not seem to be working.
     
  42. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hey everyone,

    Check front post to find some useful scripts compatible with FPS Kit 2.0

    http://forum.unity3d.com/threads/153337-FPS-Kit-Version-2-0

    Cheers!

    Script seems fine, make sure you assigned "positionDisplay" variable.

    It should be empty game object.
    Also make it child of game object you assigned script to.
    It should be positioned correctly above your planet
     
    Last edited: Jun 6, 2013
  43. Steve-of-Construction

    Steve-of-Construction

    Joined:
    Jan 26, 2013
    Posts:
    67
    Thankyou so much!
    Works great!
     
  44. Josifjoey

    Josifjoey

    Joined:
    May 12, 2013
    Posts:
    14
    hello
    I'm having some problems with when i chat in-game it seems like the enable helper isn't doing anything, This only started happening when i started editing some scripts but i dunno witch one caused the issue :( dose anyone know how to fix this?
     
  45. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    How is possible to make more servers?
     
  46. Junior Kain

    Junior Kain

    Joined:
    Jun 7, 2013
    Posts:
    2
    Hello developer!

    First of all, congrats! Seems like this tool will be very useful and time-saving for our project.
    I paid a visit to your site and the game you made, all menus are very impressive, game is fast to load, very very nice.
    Since Unity 3 I've been dreaming about making a FPS game for exclusive use of our clan, and I believe I finally found the tool I needed.
    The only thing I want to know is: Is it possible to make a game using the Photon Server? I want to host the game in one of our own servers, because I believe there's no servers in Photon Cloud here in Brazil.
    Thanks!
     
  47. X-BullDog

    X-BullDog

    Joined:
    Dec 26, 2012
    Posts:
    15
    Hi!
    I got FPS Kit Version 2.0 ... but the Multiplayer-Gaming with Photon doesnt work.
    One time it worked but now it doesnt.
    The Game trys to Connect...after few second there come this error:


    NullReferenceException: Object reference not set to an instance of an object
    RoomMultiplayerMenu.OnDisconnectedFromPhoton () (at Assets/FPS Kit Version 2.0/_CustomAssets/Scripts/Network C#/RoomMultiplayerMenu.cs:250)
    UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
    NetworkingPeer:SendMonoMessage(PhotonNetworkingMessage, Object[]) (at Assets/FPS Kit Version 2.0/_CustomAssets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1421)
    NetworkingPeer:OnStatusChanged(StatusCode) (at Assets/FPS Kit Version 2.0/_CustomAssets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1050)
    ExitGames.Client.Photon.EnetPeer:Disconnected()
    ExitGames.Client.Photon.EnetPeer:SendOutgoingCommands()
    ExitGames.Client.Photon.PhotonPeer:SendOutgoingCommands()
    PhotonHandler:Update() (at Assets/FPS Kit Version 2.0/_CustomAssets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:82)



    I got my NetworkPlayer_1_1 Prefab in the Resources Folder, but nothing :((((

    ~Bull
     
  48. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hi,

    FPS Kit 2.0 were made to work exclusively with Photon Cloud service.

    Sorry but what you mean "...there's no servers in Photon Cloud here in Brazil." ?

    You can use Photon Cloud from any country, just go to http://cloud.exitgames.com/ and get your free ID after registration.


    Hi,

    Check __Room prefab and check if soldier variable is assigned (aswel as other variables)

    Also check __Lobby prefab to see if there no empty variables
     
  49. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    HOW is Possible to make more SERVERS PLEASE ONE TIME CAN YOU REPLY AT MY ANSWERS?
     
  50. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Okay,

    I would gladly reply your questions if they were elaborated correctly.

    You just asked "How to add more server?", but how I suppose to know what servers you talking about and where to add them?

    FPS Kit 2.0 work next way:

    - You register on Photon Cloud website

    - After registration they setup application on server for you which you can use by copying your ID and pasting it in Unity

    - Then players connect to your game and create their room which visible to other players

    Basically players can create "unlimited" number of rooms but have limited number of player that could connect at once