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

Pages: [1] 2
1
TNet 3 Support / Error on TNAutoCreate
« on: March 15, 2014, 01:00:03 PM »
Hi,
I have got a problem with TNAutoCreate, sometimes I have got problem when it creates object, but I don't konw where the problem is:

  1. (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WebPlayerGenerated/UnityEngineDebug.cpp Line: 53)
  2.  
  3. ArgumentException: failed to convert parameters
  4.   at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
  5.  
  6. System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  7.  
  8.   at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, BindingFlags invokeAttr, System.Reflection.Binder binder,
  9.  
  10. System.Object[] index, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  11.  
  12.   at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) [0x00000] in <filename unknown>:0
  13.  
  14.   at TNAutoSync.OnSync (System.Object[] val) [0x00000] in <filename unknown>:0
  15.  
  16.   at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  17.  
  18.   at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
  19.  
  20. System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  21. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  22.   at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
  23.  
  24. System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  25.  
  26.   at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  27.  
  28.   at TNet.UnityTools.ExecuteAll (TNet.List`1 rfcs, Byte funcID, System.Object[] parameters) [0x00000] in <filename unknown>:0
  29.  
  30.   at TNObject.Execute (Byte funcID, System.Object[] parameters) [0x00000] in <filename unknown>:0
  31.  
  32.   at TNObject.Start () [0x00000] in <filename unknown>:0
  33.  
  34. (Filename:  Line: -1)
  35.  
This error appear sometimes not always. What's wrong?

2
NGUI 3 Support / UISlider bug
« on: March 09, 2014, 05:15:59 PM »
This code doesn't work:
  1.         float energy = 0;
  2.  
  3.         void Update () {
  4.                 energy += (1*Time.deltaTime);
  5.  
  6.  
  7.                 GameObject.Find("Control - Simple Progress Bar").GetComponent< UISlider >().value  = (energy/100);
  8.         }
  9.  

To fix it I must use:
  1.         float energy = 0;
  2.  
  3.         void Update () {
  4.                 energy += (1*Time.deltaTime);
  5.  
  6.                 GameObject.Find("Control - Simple Progress Bar").GetComponent< UISlider >().value = (float)(System.Math.Truncate((double)(energy/100)*100.0) / 100.0);
  7.         }
  8.  

Is very easy to reproduce.
I think this should be fixed.

3
NGUI 3 Support / Resize tiled sprite
« on: March 09, 2014, 03:25:48 PM »
Sometimes i have margin of 1px, I do not understand how to solve it:


https://www.youtube.com/watch?v=iKDg9FWN3WA&feature=youtu.be

4
NGUI 3 Support / Sprite Alpha
« on: March 04, 2014, 11:52:08 AM »
Hi,
I can't change alpha of a sprite when I instanziate a object.

  1. GameObject user = NGUITools.AddChild (list, user_selection);
  2. GameObject removeUser = user.transform.Find ("RemoveUser").gameObject;
  3.  
  4.  
  5. if (TNManager.isHosting)
  6. {
  7. Debug.Log("Is host");
  8. removeUser.GetComponent< BoxCollider > ().enabled = true; // Work
  9. removeUser.GetComponent< UISprite > ().alpha = 1; // Doesn't work
  10. }
  11.  

Collider is correctly activated but alpha of sprite doesn't have variations. Why?

5
TNet 3 Support / Channel data at creation
« on: March 04, 2014, 10:49:07 AM »
Hi,
I'm making a part of code in order to create channel and lobby where there is a list of existing channel.
My problem is that I can't to set data of channel using TNManager.channelData at the moment to create channel it self.


CREATE:
  1. TNManager.JoinChannel(channelIDFirstAvailable, "myscene", false, 999, "");
  2. TNManager.channelData = json_stanza;

LOBBY:
  1. void OnChannelList (Packet response, BinaryReader reader, IPEndPoint source)
  2. {
  3.         // Read all incoming channel data
  4.         for (int i = 0; i < channels; ++i)
  5.         {
  6.                         ChannelEntry _newChannelEntry = new ChannelEntry();
  7.  
  8.                         _newChannelEntry.id             = reader.ReadInt32();
  9.                         _newChannelEntry.players        = reader.ReadUInt16();
  10.                         _newChannelEntry.limit          = reader.ReadUInt16();
  11.                         _newChannelEntry.password       = reader.ReadBoolean();
  12.                         _newChannelEntry.persistent     = reader.ReadBoolean();
  13.                         _newChannelEntry.level          = reader.ReadString();
  14.                         _newChannelEntry.data           = reader.ReadString();
  15.  
  16.                         Debug.Log("_newChannelEntry.data === "+_newChannelEntry.data); // Empty data
  17.         }
  18. }

If I'm doing in this mode:
  1. TNManager.JoinChannel(channelIDFirstAvailable, "myscene", false, 999, "");
  2. TNManager.client.BeginSend(Packet.RequestSetChannelData).Write(json_stanza);
  3. TNManager.client.EndSend();

It will work perfectly but I don't understand the reason why I don't have to use TNManager.channelData

6
TNet 3 Support / OnChangeHost event
« on: March 02, 2014, 10:10:41 AM »
Hi,
I'm trying to launch a client's function, at the change of the host, I try in this way:

  1. void Start()
  2. {
  3.         TNManager.client.packetHandlers[(byte)Packet.ResponseSetHost] = MyOnSetHost;
  4. }
  5. void MyOnSetHost(Packet response, BinaryReader reader, IPEndPoint source)
  6. {
  7.         Debug.Log ("ONSETHOST");
  8. }

But the MyOneSetHost function doesn't been called. How can I do it?

7
NGUI 3 Support / Issue with LoadLevelAdditive
« on: February 28, 2014, 01:57:52 PM »
I need to load an extra scene (Called "loading") at the "base" scene using: Application.LoadLevelAdditive("loading");
When I set it as:
void Start()
{
Application.LoadLevelAdditive("loading");
}
there is a moment that the added scene is not load, and I see the basic scene. This is very annoying.
If I do:
void Awake()
{
Application.LoadLevelAdditive("loading");
}
NGUI graphics of "basic" scene is in low quality, but I solve the problem of the moment when I see only the basic scene.
There is the same problem(low quality on ngui of basic scene) when I launch Application.LoadLevelAdditive in the previous scene, putting the NGUI panel of the "loading" scene

with DontDestroyOnLoad(gameObject);

8
TNet 3 Support / Player data
« on: February 27, 2014, 12:54:34 PM »
Hi,
I don't understand how to write data attribute of currently player in order to it is visible to other player.
I'm writing:
  1. void Start()
  2. {
  3. TNManager.player.data = "team0";
  4. }

If I start it with other client:
  1. foreach(Player player in TNManager.players)
  2. {
  3. Debug.Log(player.data);
  4. }

But I have null as value

9
NGUI 3 Support / Transform parent
« on: February 26, 2014, 11:34:08 AM »
Hi,
I'm trying to instantiate a sprite startup that represents user. In this mode user can choose which team to play by clicking on the logo of one of the two teams.
My problem is that when I clicking on the logo and it starts ClickTeam1(), my gameObject moves correcty but sprite aren't vsible (I insert a image to help you to understand me)
It works good if I remove comment on the line of code in order to generate other prefab, but I only want to move the existing one.




  1.         public GameObject user_selection, grid_viewers, grid_team1;
  2.         GameObject user;
  3.  
  4.         void inizialize()
  5.         {
  6.                 user = (GameObject)Instantiate(user_selection, new Vector3(0,0,0), Quaternion.identity);
  7.                 user.transform.parent = grid_viewers.transform;
  8.                 user.transform.localScale = Vector3.one;
  9.                 grid_viewers.GetComponent< UIGrid >().Reposition();
  10.         }
  11.  
  12.         public void ClickTeam1()
  13.         {
  14.                 //user = (GameObject)Instantiate(user_selection, new Vector3(0,0,0), Quaternion.identity);
  15.  
  16.                 user.transform.parent = grid_team1.transform;
  17.                 user.transform.localScale = Vector3.one;
  18.  
  19.                 grid_team1.GetComponent< UIGrid >().Reposition();
  20.                 grid_viewers.GetComponent< UIGrid >().Reposition();
  21.         }

10
TNet 3 Support / Channel master
« on: February 20, 2014, 03:53:29 PM »
Hi,
I want that every channel have a master, that starts something. Do this it's very easy because when someone creates a channel I can set him as master.
The problem is when the master user left the channel. I want, in that case, that someone else can set himself as master. Which is the best way to do this? I don't want thath more than one user can do this.

11
TNet 3 Support / Recovery data channel
« on: February 20, 2014, 07:50:16 AM »
hi,
I need to set same values like data of current channel and to recovery where I want in order to update.
Now I'm able to set using:
TNManager.client.BeginSend(Packet.RequestSetChannelData).Write(json_string);
TNManager.client.EndSend();

But I don't understand how to recover date of current channel from the server

12
NGUI 3 Support / Prefab Button OnClick
« on: February 19, 2014, 06:59:19 AM »
Hi,
I'm instantianting prefab that contain UI Button in this way:


void Generate()
{
   GameObject new_room = (GameObject)Instantiate(prefab_room, new Vector3(0, 0, 0), Quaternion.identity);
   UIButton new_room_button = new_room.GetComponentInChildren< UIButton >();
   EventDelegate.Add(new_room_button.onClick, ApriStanza);
}

void ApriStanza()
{
   Debug.Log ("Clicked");
}


It works, but how can I excute a method of a script of another gameobject?
Assuming that I have a gameobject called MyTest with a script MyScript and OpenRoom method. So how can I excute that?

13
NGUI 3 Support / Table
« on: February 14, 2014, 07:56:38 AM »
I have some trouble with tables. I create a table with KEEP WITHIN PANEL and 2 columns.
I insert sprites there . Now It works well untill 2 or more GameObject. If I insert one gameobject  aligns on right in spite of left. I don't understand what is wrong.

14
TNet 3 Support / Cheat
« on: February 10, 2014, 05:25:27 PM »
I'm trying to do a test with cheat engine 6.3 with a game that I develope with TNET.
I don't undertand how to solve problem with speed hack. It actives with a click from software.

How is it possible to notice this cheat without passing movement of own character to an authoritative server?

15
NGUI 3 Support / Sprites psd
« on: February 07, 2014, 09:11:41 AM »
Hi,
I want to say where can I found psd of spray at the begging of this tutorial:
https://www.youtube.com/watch?v=OT0hTxjjkY4

They aren't into the examples in the package

Pages: [1] 2