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 - broknecho

Pages: [1] 2 3
1
Other Packages / Re: UISK: Error with Latest TNet
« on: July 19, 2013, 11:07:55 AM »
Works Great!   Thanks!  Your support speed is unmatched  :D

Also just to add, I was in the editor with a brand new empty project.  Windows version of Unity.

2
Other Packages / Re: UISK: Error with Latest TNet
« on: July 19, 2013, 09:53:21 AM »
Stack:
  • UnityEngine.Object.CompareBaseObjects (lhs=System.ArgumentException: ToString  can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.
    Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function., rhs=(null)) in C:\BuildAgent\work\7535de4ca26c26ac\Runtime\ExportGenerated\Editor\UnityEngineObject.cs:47
  • UnityEngine.Object.op_Inequality (x=System.ArgumentException: ToString  can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.
    Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function., y=(null)) in C:\BuildAgent\work\7535de4ca26c26ac\Runtime\ExportGenerated\Editor\UnityEngineObject.cs:144
  • UILabel.MakePixelPerfect () in D:\Projects\Unity\NetAttack\Assets\NGUI\Scripts\UI\UILabel.cs:568
  • UILabel.set_text (value="192.168.x.xxx") in D:\Projects\Unity\NetAttack\Assets\NGUI\Scripts\UI\UILabel.cs:143
  • UIDirectConnect.OnResolvedIPs (local={192.168.x.xxx}, ext={96.51.xx.xxx}) in D:\Projects\Unity\NetAttack\Assets\StarlinkUI\Scripts\Custom\UI\UIDirectConnect.cs:49
  • TNet.Tools.ResolveThread (obj={TNet.Tools.OnResolvedIPs}) in D:\Projects\Unity\NetAttack\Assets\TNet\Common\TNTools.cs:148

I just manually removed a few digits from the IPs above.

3
Other Packages / UISK: Error with Latest TNet
« on: July 19, 2013, 01:44:20 AM »
Hey!

I tried starting a brand new project tonight and I'm getting a weird error after importing the TNet Integration part of the UISK setup document.  The packages I have imported (and in this order):

1- Import UISK 1.0.0.0 from the asset store
2- Import NGUI from download link v.2.6.3
3- Import TNet from download link v1.7.2c

Following the UISK setup document, when I get to the step right after you import the TNet Integration package where you are to go to the Direct Connect to test this step, there is an error:

CompareBaseObjectsInternal  can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.

This happens right after click the "Direct" button and when it's loading the internal/external address.  The internal Address is updated but it's erroring around where it's updating the UILabel for the external address.

The call stack shows the exception in the UIDirectConnect.cs script.

Also I'm using Unity Free v4.1.3f3.

Please let me know if you need any other information from my setup.

Thanks.

4
Well I think I figured this out.  Basically it was a wild goose chase in the wrong direction thinking it was due to me just changing the UI (and the associated scripts).

Basically what was happening is that some of collision information was getting sent over an RFC.  When inside the Unity editor, the TNObject.uid's were actually getting set correctly as new objects were spawned.  This is WITHOUT a server started.  But when I compiled, the TNObject.uid was not incremented thus leaving a uid of 0 for all objects.  So when I Sent a message to an object, it seemed to have picked the first one it found with a uid of 0.

Anyhow, it wasn't due to changing the UI but it was from a disconnect in the way I instantiated the server/channel before I switched over to StartlinkUI!

That was a fun one.  :P

5
Yeah for sure I agree.  I actually did try disabling a lot of the cameras one by one to see if something was there but could not figure out why a completely different scene with completely different cameras was getting affected....and only in the build version.  Have never seen this behaviour before.

I will also go over all the layers again on everything to see if something is out of place.

I'll keep digging and I thank you for your input!

Thanks again for the tools!

Scott

6
Well I have confirmed that it's not really that the physics are offset, something is completely messed up with the collisions all over the place.

I reverted the changed I made bringing in the StarlinkUI Menu Scene and everything worked again.  I will go and recreate the Starlink UI menu screen with a very basic window setup and see if I can find what created this problem.

To me it does seem like it is a camera issue as that is definitely the biggest change from my old build but I still find it very weird that it works perfectly in the Editor and it's just broken in the BUILD version.

7
Hmmm well that did point me at a few things where the menu scene cameras were all culling the wrong layers.  But I am only seeing two Camera's in my gameplay scene: Main Camera and then my original UI Root (2D) -> Camera.

Is it weird that it works perfectly in the editor?

8
Hello!

I went through and replaced a main menu scene that was made up of just NGUI and some TNET code with the Menu Scene from the Starlink UI SK.  So now the Play buttons will just move into my Gameplay Scene.

Everything is working great so far except when I BUILD the project to a windows client, all of the physics collisions in GamePlay scene are all completely offset.  I'm just wondering if you can think of something in the Menu Scene that could affect the physics simulation somehow?  The collisions work perfectly in the editor but as soon as I build, they look to be offset to where they should be.  By offset, I mean that I have seen a bullet collide visually with a enemy but a DIFFERENT enemy off to one side is actually collided with.

Please let me know if you need any more information about what I have setup.

Thanks!
Scott

9
NGUI 3 Support / Re: Radial, Windward-like health bars
« on: April 16, 2013, 09:11:58 AM »
Technically because that bar is about 30% of a full circle, you could make a circle that would be 100% of that (it would be probably be 3-4 times the size of the boat in this example).  Then just constraint the radial fill to that 30% area.

OR

Looking at it more, it kinda just looks like a vertical fill on a sprite that is curved.  That is probably the easiest.

10
NGUI 3 Support / Re: auto scroll score board
« on: April 13, 2013, 12:21:51 AM »
Hmmmm yeah after thinking about it later, I thought that might happen.   I wonder if you need to just show the visible section then.  Like if you are at spot 1000, only show scores 990-1010 (20 scores) or something along that line.  That defeats the ability of scrolling the list but will at least show you and the surrounding scores.

Or maybe have a list of 20 labels that are just recycled as you run and continually rotate them with new text values.  This would kinda simulate a  scrolling list but you are just recycling 20 labels over and over.

So 1-20 -> 2-21 -> 3-22 -> and so on.

I'm just throwing ideas out as I have not built something like this.  I will try to experiment with it though in the next few days to try some of these ideas.

~Scott


11
NGUI 3 Support / Re: auto scroll score board
« on: April 11, 2013, 04:44:52 PM »
Hmmm not too sure why the X is change on that dragPanel.  I will have to dive into the SpringPabel.Begin code to look if it's changing the position of that object.  Looks like it's the one changing with all the buttons moving along with it due to the parenting.

In regards of the 1000 lines of a high score, I would probably have a Prefab called HighScoreEntry.  This would have a UILabel under it which would display what you want. 
Also, you would need a HighScoreList that parents each of the Entries.  This list could have a script on it that keeps track of each entry included things like Player ID.  Then if you need to find a specific Player ID, you could get the HighScoreEntry associated with it and slide down to it.

HighScoreList - This would have a HighScoreListScript on it that would have a Dictionary<int, HighScoreEntry> on it where the int would be the player Id. 
   -> HighScoreEntry1
   -> HighScoreEntry2
   -> HighScoreEntry3
   ...
   -> HighScoreEntry1000
      ->UILabel
      ->HighScoreEntryScript.cs - This would references the UILabel and other properties like Player ID, Name, Score, etc.  It would build the UILabel.text


I'm just at work though so I can't test this out till later but i think would be one solution that could work.

~Scott

12
NGUI 3 Support / Re: auto scroll score board
« on: April 11, 2013, 12:43:53 AM »
Try out this style:  http://www.youtube.com/watch?v=GZy-uPm42T8

If your scoreboard is a dragable panel that is clipped to it's outer panel like in the video, I think you'll have what you're looking for.
It is the SpringPanel that I believe you are talking about but should still be able to take in your current score item and slide down to it from the top score.

13
TNet 3 Support / Re: TNManager.Create and PoolManager
« on: April 10, 2013, 11:21:26 AM »
This pattern won't work for you anymore due to TNManager.Create not actually give you a GameObject reference back.  TNManager.Create has a void return type and defers the creation to the network code. 

The new Pattern is to do something with the Object in it's Start Method.  So when your poolmanager creates an object, it's done at that point.  You then have to go into the Objects Start method and do something there.  In my game, I am using the start method of my game object to register itself with whatever it needs to.

So your poolmanager should be:

  1. public void SpawnNew(Vector3 pos, Quaternion rot)
  2. {
  3.     ...
  4.     TNManager.Create(this.prefab.gameObject, pos, rot); //assuming this.prefab is a Transform.
  5. }
  6.  
  7.  

Then in each Start Method of your objects:
  1. public class MyObject: TNBehaviour
  2. {
  3.  
  4.     void Start()
  5.     {
  6.         //This if could probably be removed if you need each client to register their own version of the object.
  7.         if(tno.isMine)
  8.         {
  9.             //Register myself with something if needed.  Like:
  10.             PoolManager.RegisterNewObject(this);
  11.         }
  12.     }
  13. }
  14.  

14
TNet 3 Support / Re: Server Spawning objects
« on: March 28, 2013, 10:19:44 AM »
The first person to join a channel is automatically set as the Host.  You test this by using:

  1. if(TNManager.isHosting)
  2. {
  3.     //Do hosting Stuff
  4. }

If that person leaves the channel, someone else in the channel with become the "Host" and then that IF statement will start working from their client.  I quoted "Host" because it's still really just a client.  It just has a kind of authority given based on the isHosting being set to true.

Your standalone server is more of a message relayer if that makes sense.

15
NGUI 3 Support / Re: Question about UI Button Label
« on: March 28, 2013, 10:12:16 AM »
you should use:

  1. newBtn.GetComponentInChildren<UILabel>();

That should get you the UILabel under the button.

Pages: [1] 2 3