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.


Messages - gevarre

Pages: [1]
1
TNet 3 Support / TNManager.isHosting always returning true
« on: February 05, 2016, 03:07:49 PM »
Hi,
So I'm trying to get a spawning system going for target objects controlled by the host. I've got this at the start of the control script:

  1. using UnityEngine;
  2. using System.Collections;
  3. using TNet;
  4.  
  5. public class TargetSpawnControl : TNBehaviour
  6. {
  7.         public GameObject target;
  8.         public GameObject[] targetSpawners;
  9.         public bool hosting = false;   
  10.        
  11.         void Awake()
  12.         {
  13.                 Debug.LogError(TNManager.isHosting);
  14.                
  15.                 if(!TNManager.isHosting) return;
  16.                 if(TNManager.isHosting) hosting = true;
  17.  
  18.                 StartCoroutine(StartTargetSpawnTimer());       
  19.         }
  20. }
  21.  

But for some reason, no matter what I do, TNManager.isHosting always returns true on all the clients and hijinks ensue. Anyone know what's happening? I'm taking this from the tutorial here.

2
TNet 3 Support / Re: Tnet and Unity's FPSController
« on: February 05, 2016, 03:01:48 PM »
That makes sense. Thanks :)

It's been a while since I've used Tnet and I never knew about the "one TNAutoSynch per object" rule.

3
TNet 3 Support / Re: Tnet and Unity's FPSController
« on: February 04, 2016, 05:40:28 PM »
Okay, after a lot more testing and experimentation. I believe it's because I was using AutoSync when I should have been using Sync Rigidbody. I did the tests on a completely new hand-made player, but I'm guessing that would fix it.

4
TNet 3 Support / Re: TNet Tutorials
« on: February 04, 2016, 05:35:03 PM »
Awesome start :)

5
TNet 3 Support / Tnet and Unity's FPSController
« on: February 04, 2016, 03:49:03 PM »
Anyone had any luck using unity's Standard Asset FPSController?

If I set it up with a TNObject script and TNAutoSynch on the base transform, all is well, but when I try to add the same thing to the "head", in their case what they've labeled "FirstPersonCharacter", (adding either a rotation or localRotation parameter to TNAutoSync) I get "Mismatched number of parameters sent via TNAutoSync!" errors every time I rotate the head transform.

I'm guessing it has to do with the way Unity has the whole prefab set up and I'll just have to create a character from scratch, but I thought I'd ask if anyone else has had success with this first.

6
TNet 3 Support / Re: if(TNManager.isThisMyObject) error message
« on: February 04, 2016, 01:43:29 PM »
Thanks. Those are good points.

tno.isMine doesn't seem to give any errors. Unfortunately, according to the docs, that's not for use in a Start function (unless TNManager.isThisMyObject is being deprecated and you should now just use tno.isMine everywhere?)

I do admit the tutorial is pretty old, so maybe things have just changed. I did experiment a bit, and version 2.1.1 does work fine with the latest Unity build, so I don't think that's the cause.

7
TNet 3 Support / if(TNManager.isThisMyObject) error message
« on: February 03, 2016, 07:58:30 PM »
Hi, I'm using Tnet 3 and following the old "TNet: Making a Game from Scratch" tutorial.

In my GamePlayer script I've got this:

  1. using UnityEngine;
  2. using TNet;
  3.  
  4. public class GamePlayer : TNBehaviour
  5. {
  6.                
  7.         static public GamePlayer instance;
  8.                
  9.         void Awake()
  10.         {
  11.                 if(TNManager.isThisMyObject)
  12.                 {
  13.                         instance = this;
  14.                 }
  15.         }
  16. }
  17.  

Unfortunately, I'm getting this error:
Assets/_Scripts/GamePlayer.cs(11,30): error CS0117: `TNManager' does not contain a definition for `isThisMyObject'

Any ideas? It's a new, empty project and I'm using Unity 5.3.1f1

Note: at 15.28 of the tutorial video, the GameObject in the start scene suddenly has the TNManager script attached to it. If I just click on the "Add Component" button, this doesn't show up. I had to manually find the script and drag it onto the object. Could this be significant or just the way it works?

8
TNet 3 Support / Re: Stuck on "Connection" Screen
« on: September 12, 2014, 12:24:24 AM »
Aha. That was it. I somehow was under the impression that the autoconnect script automatically took care of that. Once I entered the right address into the inspector, it worked just fine. Switching that out with the "menu" scene from your included examples worked even better. That way at least the correct address is listed for the player to select. I'll eventually have to figure out a full-on master game server so that people can search online for active game lobbies, but this is great for now.

Thanks for the tip  :)

9
TNet 3 Support / Stuck on "Connection" Screen
« on: September 10, 2014, 01:13:52 PM »
Hi,
so I've followed the examples and created the basic game.

If I start TNserver, I can connected to it and play the game just fine on one computer. The problem is, if I start the server and then try to connect on any other computer in the house, it loads the start scene with the "Connecting" text, and just sits there.

The server shows the Gateway and External IP's and says that all ports were opened successfully: lobby server started on port 5129 with interface 0.0.0.0 and game server started on port 5127.

I know this could be a lot of things, but any thoughts on what to check? Are there any diagnostics I can add to the scripts to help figure out what's going on? I'm running the server on Windows 7, and the first time I ran it I did make sure that both the "private" and "public" checkboxes were checked, then restarted it.

I'm a little concerned because if I'm going to release something publicly, it has to just work without the end user having much IT knowledge and I thought this was what Tnet was specifically good for. On the other hand, if it's something peculiar that I've messed up with my own network setup that has nothing to do with Tnet, then obviously I need to figure that out, too.

All help and thoughts are appreciated. Thanks.

10
NGUI 3 Support / Re: How to properly create a textfield that scrolls?
« on: November 22, 2013, 06:14:03 PM »
Bumping this old thread because it hasn't really been resolved, there is no real step-by-step tutorial on how to do chat windows, and the example hasn't been updated since ArenMook said in this thread that it was no longer the correct way to do this.

I, too, have just got a chat window working from the included example by copy-and-pasting from the example into my project and making the necessary corrections. However, the scroll function doesn't work just like the others. In my case, the UIText List and other components are under a 2D camera connected to a 2D UI Root like the other examples (I also have a lot of HUD elements there). The 2D camera is set to Depth Only, etc., and then there is a standard 3D perspective camera for the player. Everything is working perfectly except for the scrolling.

Since the scrolling is dependent on clicking on the collision trigger attached to the Text List, which is under the 2D camera that's below the main scene, would I be right in thinking that there's no way for the player to actually click on it from the main camera?

I can get my game to work without the scrolling, but it would be a nice feature to add. I'm just now sure how it would be hooked up in a 3D environment. I've tried hooking it up under the main camera so that the collision was actually on-screen, but that didn't seem to work either, though there's probably something obvious I missed.

Any thoughts?

11
NGUI 3 Support / Re: How to do a circular progress bar?
« on: July 20, 2013, 10:48:39 AM »
Aha! Thanks  :)

12
NGUI 3 Support / How to do a circular progress bar?
« on: July 19, 2013, 11:03:14 PM »
Okay, so I've been watching/reading too many tutorials and now I can't remember where I've found things.

I'm trying to do a progress bar, but instead of a bar that fills, I'd like to take a sprite that has an image of a circle and slowly reveal it, if that makes any sense. I thought I had seen somewhere where there was a setting in one of the scripts to select a straight or circular "wipe", but maybe I'm mistaken.

Anyway, anyone have any thoughts on how to do this?

Thanks

13
Sorry, I should have said - I'm trying to make an in-game scoreboard by building a string from player names stored in an array and sending that string to the text field of the UILabel using the "Set Property" action in Playmaker. For example:
"Player 1 \n Player 2 \n Player 3"

Which, I was assuming from the documentation, was supposed to work, though as I say, it looks to be rather out-of-date. It updates the text just fine, it just ignores the line feeds.

If this doesn't work, then what would be the correct way to do this?

14
I need to send a text string to a label at runtime that consists of several segments seperated by new line feed character. The NGui docs say to use \n in the text string to do this, but it doesn't actually work. It just prints that along with the rest of the text on one long line.

I have Encoding checked, but unfortunately, the docs are obviously for an outdated version of the label and the options are not the same, so I don't know if things have changed or what. I am using the full version of NGui, not the free one, if that makes a difference.

Does anyone know how to do this?

15
Hi,
Love the package, but I'm having a few issues. I'm converting a project from straight Unity networking. The player is a vehicle, so it's input forces that are interpolated using M2H's "NetworkRigidBody.cs" script. This works just fine in the original project, but I'm looking for a similar solution with Tnet.

From reading the posts here, it seems that there's supposed to be no need for this with Tnet, but I'm seeing horrendous jittering, the same as I had with the original project Until I added the interpolation script. the way it would work is that the network view would watch the script, the script would interpolate/extrapolate where the player was supposed to be, then the network view would send the data using stream.isWriting, etc. I have no idea what would be analogous to this in Tnet. Anyone have any ideas?

It would be so immensly helpful if there was an fps example included in the package that people could build on, or even just something using the character controller. The included click-to-move sample is sort of helpful, but I don't think it's really all that applicable to the majority of users. Is anyone working on this?

Pages: [1]