Unity Community |

1) When trying to tweak the initial values in Machinegun.js (such as my script values of “var damage=10.0; var bulletsPerClip=50; var clips=20”), such values get lost and are overridden in runtime when inspecting “PlayerPrefab(Clone).CrateCamera.Weapon”. First of all, I can’t find where “PlayerPrefab(Clone).CrateCamera” adopts “Weapon” as a child. :( Also, where do the new overriding values come from (such as “damage=20.0; bulletsPerClip=30; clips=5”)?Thanks Appels for the advice about using 'private' in scripts to hide from the inspector.
Also, I'm hoping if somebody could help me find -- in the original FPS -- 'where “PlayerPrefab(Clone).CrateCamera” adopts “Weapon” as a child.' Once someone can point me in that direction, I hope to understand how the original project overrides -- at runtime -- Machinegun.js vars such as: 'damage', 'bulletsPerClip', and 'clips'. Personally, I've looked and looked...even traced with MonoDevelop debugger, yet to no avail. :( Thanks again for any assistance out there. Still Searching... :) jay1025
Last edited by jay1025; 12-29-2011 at 09:30 AM.
Could someone else test and confirm this behaviour?
I've been seeing some odd behaviour with the scoreboard in my game, so I went back and built Example4 (the shooter with the crates) straight from a fresh install. I then set up a lan game with three computers : one computer as the server (player 1), and the other two as clients (Player 2 and Player 3).
Upon running the game, I find that the scoreboard only updates for interactions between an individual player and the server. Actions between clients that don't involve the server never get updated.
Examples:
server (player 1) kills player 2.
The server's scoreboard shows this:
server: 1 kill 0 deaths
player 2: 0 kills 1 death
player 3: 0 kills 0 deaths
So far, so good. Player 2's scoreboard reads this:
server: 1 kill 0 deaths
player 2: 0 kills 1 death
player 3: 0 kills 0 deaths
Still good. However, player 3's scoreboard reads this:
server: 1 kill 0 deaths
player 2: 0 kills 0 deaths
player 3: 0 kills 0 deaths
Player 2 will receive the server's update that the server scored a kill because it's coming from the server and it will record it's own death. Player 3 WILL NOT receive the record that player 2 has died because player 2 is not the server.
All computers now quit and relaunch the game with the same configuration. This time Player 2 kills Player 3. The scoreboards now look like this:
Server Scoreboard:
server: 0 kill 0 deaths
player 2: 1 kill 0 deaths
player 3: 0 kills 1 death
again, so far, so good.
Player 2's scoreboard:
server: 0 kills 0 deaths
player 2: 1 kill 0 deaths
player 3: 0 kills 0 deaths
Player 2 records it's own kill because it's the one sending the message. However, Player 2 DOES NOT record Player 3's death because it doesn't receive any messages directly from Player 3 and the server doesn't appear to pass it on.
Player 3's scoreboard:
server: 0 kills 0 deaths
player 2: 0 kills 0 deaths
player 3: 0 kills 1 death
Same situation as before: Player 3 will record it's own death because it is the one sending the message, but it never receives the message from Player 2 that Player 2 scored a kill.
I hope you could follow along with that because it can easily get confusing. At first I thought maybe it was something I did when I adapted this to my game, but since I'm testing this from a direct fresh install of the download, I'm guessing it's an actual bug in the scripting. Would it be possible for someone to do an independent test to confirm this?
@Leepo: Your last reply was over 2 months ago. Have you forgotten about your customers?
Just busy but I'm sorry it started to show in the level of support on this product. So far quite a few issues were usually quickly solved by the help of other users here (thanks guys).@Leepo: Your last reply was over 2 months ago. Have you forgotten about your customers?
I have found your problem, it's in the GameSetup playerlist. Clients don't properly keep track of the NetworkPlayer for other clients since it is set in "TellOurName"by using info.Sender. As this is ALWAYS the server for clients, this is set incorrectly.
To fix this make three changes:
1) Change TELLOURNAME to this:
(add the fromPlayer : NetworkPlayer and set it.)function TellOurName(name : String, fromPlayer: NetworkPlayer, info : NetworkMessageInfo){
var netPlayer : NetworkPlayer = fromPlayer;
2 & 3) Inside AWAKE are two RPCs for TELLOURNAME, change these to:
I have submitted an update (1.10) to address this bug. This should be live on the asset store within the next 24-48 hours.networkView.RPC ("TellOurName", RPCMode.AllBuffered, playerName, Network.player);
Last edited by Leepo; 02-13-2012 at 11:38 AM.
Mike Hergaarden - M2H Game Studio - http://twitter.com/M2Hgames
Unity 3D game portal: Wooglie.com
Free Unity resources/projects M2HCulling, Networking tutorial and more
Thanks. That worked perfectly
Any fix for the other problem I mentioned with the chat window not releasing focus after sending a message?
To recap: after entering a message and hitting enter to send it, keystrokes (other than hitting enter again to start a new message) are no longer recognized until one of the mouse buttons is pressed.
For the chat problem:
1) At the very end of the chatscripts OnGUI, add:
2) Inside "HitEnter" add:GUI.SetNextControlName("");
I have added this to the project and will update the assetstoreGUI.FocusControl("");
Last edited by Leepo; 02-15-2012 at 06:53 AM.
Mike Hergaarden - M2H Game Studio - http://twitter.com/M2Hgames
Unity 3D game portal: Wooglie.com
Free Unity resources/projects M2HCulling, Networking tutorial and more
Thanks. That works wonderfully and seems to have cleared up the last of the issues I've found so far.
Much appreciated![]()
Is this 3.5 compatible? Is there a turn based game example in the bunch?
An Analog Man In A Digital World
Hello, I have two questions:
Q1. Does this work on iPhone / Android?
Q2. Is it possible to use peer-to-peer style connection using Bluetooth?
Cheers
Yep, fully 3.5 compatible. There are no turn based examples, but all the know-how you'd need should be there (mp game browser, simple lobby system, in-game network messages)Is this 3.5 compatible? Is there a turn based game example in the bunch?
1: This is based on Unity networking. Unity networking supports both mobile platforms. The only note is that connectivityQ1. Does this work on iPhone / Android?
Q2. Is it possible to use peer-to-peer style connection using Bluetooth?
2: No, Unity networking is server-client based, where one Unity instance acts as server (this could be one of your players). I believe GameCenter on iOS can provide bluetooth multiplayer?
Mike Hergaarden - M2H Game Studio - http://twitter.com/M2Hgames
Unity 3D game portal: Wooglie.com
Free Unity resources/projects M2HCulling, Networking tutorial and more
that is great
______________________________
Cheap ERGObaby Organic carrier
I haven't been able to get the FixBuildSettings script to work. The M2HNetworking does not show up on my Unity Menu. I've searched this thread and the web but they all seem to show me how to attach the script to a game object which I'm pretty sure is not what I'm supposed to do, someone please point a noob in the right direction? much appreciated...
This means that Unity hasn't compiled the editor script, most likely you have open error messages in your console that prevent Unity from compiling all scripts.I haven't been able to get the FixBuildSettings script to work. The M2HNetworking does not show up on my Unity Menu.
Mike Hergaarden - M2H Game Studio - http://twitter.com/M2Hgames
Unity 3D game portal: Wooglie.com
Free Unity resources/projects M2HCulling, Networking tutorial and more
Sorry if this has been asked before, but is the FPS demo that comes with this server authoritative with client side prediction?
Hi.
I may buy Ultimate Unity Networking project.
but is it for Unity Master Server?
I mean Master Server which can download via http://unity3d.com/master-server/
I just read the explanation text this form.
Only "Example 2" is for Master Server?
Thank you.
It is not authoritative. There is interpolation (based on Unitys networking example)Sorry if this has been asked before, but is the FPS demo that comes with this server authoritative with client side prediction?
Well yes, whole of Unity networking is based on the master server. Using it without the master server doesn't make much sense.I may buy Ultimate Unity Networking project. but is it for Unity Master Server?
I mean Master Server which can download via http://unity3d.com/master-server/
Note that you can begin development without installing the master server yourself as you can use Unity's one for your development.
Mike Hergaarden - M2H Game Studio - http://twitter.com/M2Hgames
Unity 3D game portal: Wooglie.com
Free Unity resources/projects M2HCulling, Networking tutorial and more
I have a problem, I import the package, the console say me:
"Assets/Standard Assets/Scripts/FPSWalker.js(10,21): BCE0005: Unknown identifier: 'FPSChat'."
Any tip to avoid this problem?? I've tried to modify or delete this script but later appear 20 errorsplease help me
Hi Man, I've got 8 errors and every error say me:
"The name 'List' does not denote a valid type ('not found'). Did you mean 'UnityEngine.Light'?"
The default package does not use this script so this is because of a local change.
Please move the FPSWalker script OUTSIDE of the Standards Assets folder (as the compile order is different)
See: http://unity3d.com/support/documenta...dvanced29.html
To fix your second problem, add "import System.Collections.Generic;" to the top of your javascript.
Mike Hergaarden - M2H Game Studio - http://twitter.com/M2Hgames
Unity 3D game portal: Wooglie.com
Free Unity resources/projects M2HCulling, Networking tutorial and more
Thanks man but now appear new errors:
"Assets/M2HNetworking/Example2/MultiplayerMenu2.js(461,9): BCE0005: Unknown identifier: 'GameSettings'."
"Assets/M2HNetworking/Example2/gamescript.js(14,54): BCE0005: Unknown identifier: 'GameSettings'."
Sorry for the disturb, and for my bad English I am Italian
Please verify if you have the file GameSettings.cs (or .js) somewhere in your project. If not: redownload it from the asset store (it is listed on the asset stores file list)
Mike Hergaarden - M2H Game Studio - http://twitter.com/M2Hgames
Unity 3D game portal: Wooglie.com
Free Unity resources/projects M2HCulling, Networking tutorial and more