Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Voxel

Pages: [1]
1
Hi I know this is an open ended question but I bump into this error a fair bit. What exactly does it mean?

For example today I have this error in a script that makes the chat window open/close on all clients by any client who wants to start it:
Exception has been thrown by the target of an invocation.
chatWindowToggle.ChatMode (System.Boolean)

Below is both scripts. They are both on the same gameobject....


Here is the script @RFC:
  1. #pragma strict
  2.  
  3. var chatScript : ExampleChat;
  4. var playerMoveScript : playerPhysixMoveAim;
  5. var playerShootScript : playerShootV2;
  6. var chatModeEnabled : boolean;
  7.  
  8. var tno : TNObject;
  9.  
  10. //-------------------------------------------------------------------------------------------------------
  11. //-------------------------------------------------------------------------------------------------------
  12.  
  13. function Awake (){
  14.     if(!TNManager.isThisMyObject) {
  15.           Destroy (this);
  16.     }
  17. }
  18.  
  19. //-------------------------------------------------------------------------------------------------------
  20. //-------------------------------------------------------------------------------------------------------
  21.  
  22. function Start () {
  23.  
  24.     chatScript = GameObject.Find("--Level--/GUI/Chat").GetComponent(ExampleChat);
  25.         playerMoveScript = GetComponent(playerPhysixMoveAim);
  26.         playerShootScript = GetComponent(playerShootV2);
  27.         chatScript.enabled = false;
  28.         tno = GetComponent(TNObject);
  29.        
  30. }
  31.  
  32. //-------------------------------------------------------------------------------------------------------
  33. //-------------------------------------------------------------------------------------------------------
  34.  
  35. function Update () {
  36.  
  37.                 if(Input.GetKeyDown(KeyCode.Escape)){
  38.                         chatScript.enabled = !chatScript.enabled;
  39.                         playerMoveScript.enabled = !playerMoveScript.enabled;
  40.                         playerShootScript.enabled = !playerShootScript.enabled;
  41.                         chatModeEnabled = !chatModeEnabled;
  42.                         tno.Send("ChatMode", Target.Others, chatModeEnabled);
  43.                 }
  44. }
  45.  
  46. //-------------------------------------------------------------------------------------------------------
  47. //-------------------------------------------------------------------------------------------------------
  48.  
  49. @RFC
  50. function ChatMode (chatModeActive : boolean){
  51.                 print("TNO RECIEVED" + chatModeActive);
  52.                 if(chatModeActive == true){
  53.                         chatScript.enabled = true;
  54.                         playerMoveScript.enabled = false;
  55.                         playerShootScript.enabled = false;
  56.                 }
  57.                
  58.                 if(chatModeActive == false){
  59.                         chatScript.enabled = false;
  60.                         playerMoveScript.enabled = true;
  61.                         playerShootScript.enabled = true;
  62.                 }
  63. }

What am I doing wrong?

2
TNet 3 Support / Raycast Question Object Position Problem
« on: August 01, 2013, 03:57:33 PM »
Hi,

I am using raycasting to detect targets, however when they travel at speed the raycasts seem to lag behind and start miss.

I have the rigidbody in the root separate from the renderer, and I am using AntiJitter on the Renderer, and TNAutoSync to sync the transform position and rotation. The collider is attached to the same object as the rigidbody.

I've played around with the SyncRigidbody script, and also the rigidbody setting in TNAutosync, thinking it's a rigidbody or collider position problem.

Am I on the right track? I am open to any suggestions!


3
TNet 3 Support / Feature Request
« on: July 30, 2013, 06:55:04 PM »
Hi,

I would love it if TNet kept a tally of TNObject Sends sent and @RFC received by the client. It would be useful for debugging, checking efficiency, etc.

Thanks!

4
TNet 3 Support / Disconnecting from host while level loads
« on: July 22, 2013, 10:26:02 AM »
Hi,

I have a level that is built procedurally, if I choose to build a large world that takes about 5 seconds to build (especially in the Game Window inside Unity), I get disconnected. Is there was way to keep the connection alive?

Thanks.

5
TNet 3 Support / Find remote player avatar
« on: July 21, 2013, 02:21:16 PM »
Hi,

I need to build a list of remote players avatars as a list of Transforms. Ideally I would like to use the TNManager.players array, as this is the first place to get updated when someone leaves the game.

I am wondering if there is an in-built method to quickly find the gameobject that is created when they join.

If not I will use more traditional methods to do it.

Thanks!

6
Hi,

This is probably something I am not understanding, but I though TNObject automatically assigns a unique ID number to itself.

For example I have a TNObject in a child of a parent that is being spawned using TNet. I have a script which has an @RFC in the child object that the TNObject is attached to.

Is this right?

Thanks!

7
TNet 3 Support / TNManager.players does not include self?
« on: July 08, 2013, 04:10:01 PM »
Hi,

From what I can see TNManager.players does not include the client. I want to use TNPlayer for scores etc and I was just going to use the data in TNManager.players to populate the scoreboard during play. The client is also a player so I am confused. Do I just fill in the gap with TNManager.player.score for example? Or is there another way that I am unaware of?

Also is there a built in way to notify other players of a change in any of my custom data in the Player Class such as a change in score, or should I just send the details using tno.Send to the other clients?

Thanks.

8
Hi,

TNObject SendQuickly is not working for me for some reason. Send works fine.

TNManager.canUseUDP shows as true on all clients and gives me a port number as well when I use TNManager.listeningPort.

The syntax I am using is:
tno.SendQuickly("PlayerRapidFireRecieve", Target.AllSaved, true, TNManager.player.id);

The reason I am looking to use SendQuickly is because my script is set to fire a projectile very 0.1 seconds. However because of the delay/timings less projectiles are being spawned at the remote player end. To compensate for this I use a counter to makes sure the right number of projectiles are spawned.

Either way I would like the use SendQuickly as a way of making the actual shoot function more responsive.

Any ideas?

Thanks!


9
TNet 3 Support / TNManager.Create question
« on: June 30, 2013, 05:22:49 PM »
Hi,

I am using TNManager.Create to create my projectiles in my FPS project, which players can fire at each other. However due to the delay in creating the projectile across the network:

1 - The created projectile spawns in an old position as my avatar is moving at speed
2 - The other player sees it in reverse. So that the projectile is spawning ahead of where he sees me.

I don't currently try and synch the projectile positions as there are a LOT of projectiles at any one time (in the high hundreds) and I am concerned about using the TNAutoSync and sending a lot of packets as a result.

Any ideas? Thanks!

10
TNet 3 Support / RFC Questions
« on: June 29, 2013, 03:31:33 PM »
Hi,

I have two questions about RFC:

  • Is the TNet RFC the equivalent of the built in Unity networking RPC? Sorry if this is a stupid question, but I recently went through Unity tutorials for the in-built Unity Networking, so I am a little bit confused.
  • In the 'Making a game form scratch' tutorial you mention that for UnityScript users should use [Tnet.RFC] however in a previous post you suggest @RFC. Which one should I be using?

Thanks!

11
TNet 3 Support / Interpolate Movement
« on: June 24, 2013, 04:09:23 PM »
Hi Aren,

I have both server and locally hosted setups working with my test FPS game, simply brilliant! One problem I am facing at the moment is that movement is very jittery at times. A friend of mine connected with a ping of around 150 to 200. The jitter is almost non existent on LAN. So....

I am wondering if it is possible to smooth movement using network interpolation inside of TNet? For example could these scripts be converted for use with TNet or would I be wasting my time?
http://wiki.unity3d.com/index.php?title=NetworkView_Position_Sync

Or do you have a better suggestion seeing as everything else you have suggested in other posts has been spot on.

Thanks.

12
TNet 3 Support / Amazon EC2 Setup
« on: June 22, 2013, 07:26:03 PM »
Hi,

I've been trying to get TNServer running on my Amazon EC2 Win Server 2008 R2 Instance, but I get the Gateway: None Found message.

I think I have sorted out the firewall and port settings OK. I used this guide as a reference to the things I might need to do, while applying the relevant TNServer port info:
http://developer.muchdifferent.com/unitypark/uLink/HostingAmazonEC2

I have also followed the advice here:
http://www.tasharen.com/forum/index.php?topic=2874.0

I am using the following command line in the shortcut for TNServer:
TNServer -name "Test" -tcp 5127 -udp 5128 -udpLobby 5129

At the moment I have the Windows firewall disabled completely as I thing amazon have their own firewall setup for EC2 (hence the port setup in the management console for EC2).

However, test clients are able to connect and play although the latency is terrible.

Any ideas? Thanks :)

13
TNet 3 Support / TNet + UnityScript
« on: June 22, 2013, 11:06:38 AM »
Hi,

I'm getting started on the TNet tutorial but all examples are in C#. My project is currently in UnityScript and would like to keep it that way.
Is it fine to use TNet with UnityScript?

My setup is as follows:
1 - Move TNet Folder To Plugins Folder
2 - Move the contents of the TNet/Editor folder to the main editor folder
3 - Use import TNet at the start of each script

Anything else I should look out for?

Thanks!

Pages: [1]