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

Pages: [1] 2
1
NGUI 3 Support / Re: TweenPosition: moving to another gameobject
« on: July 14, 2014, 04:09:28 AM »
This happens because when you call TweenPosition.Begin, it's in local space. You change it to world space afterwards, but the "form" and "to" values are already set to local values. I'll add an extra function that accepts the world space as an optional boolean parameter.

Thx Aren,
that would be exaclty what I was looking for. ;D

2
NGUI 3 Support / Re: TweenPosition: moving to another gameobject
« on: July 11, 2014, 03:43:58 AM »
Hm, looks like the problem was the worldspace option:

Using
  1. TweenPosition.Begin(m_FlyingGeleeEffect, m_FlyGeleeEffectLength, m_GeleeEffectTarget.position).worldSpace = true;
Worked for the target position, but fu**s up the start position.

In the end I had to use
  1. TweenPosition l_TweenPosition = m_FlyingGeleeEffect.GetComponent<TweenPosition>();
  2. l_TweenPosition.worldSpace = true;
  3. l_TweenPosition.from = m_FlyingGeleeEffect.transform.position;
  4. l_TweenPosition.to = m_GeleeEffectTarget.position;
  5. l_TweenPosition.duration = m_FlyGeleeEffectLength;
  6. l_TweenPosition.enabled = true;
  7. l_TweenPosition.PlayForward();
with a TweenPosition already on the gameobject.

Would be very nice, if TweenPosition.Begin() would accept worldSpace as an parameter, so it can init in the right way.  ::)

3
NGUI 3 Support / TweenPosition: moving to another gameobject
« on: July 11, 2014, 03:18:43 AM »
Hey guys,

I feel quite stupid but i cannot get the position tweener run like I want:
  1. TweenPosition.Begin(m_FlyingGeleeEffect, m_FlyGeleeEffectLength, m_GeleeEffectTarget.position);
Should simply move the m_FlyingGeleeEffect gameobject to the target position (a transform in another branch under the gui camera and layer). Instead its moving super little, in the wrong direction.

I played arround with camera matrixes but nothing works.

When i simply set
  1. m_FlyingGeleeEffect.transform.position = m_GeleeEffectTarget.position;
The effect lands on the right position, so the transforms itself are not the problem.

What am I missing? Thx in advance..

4
NGUI 3 Support / Re: EventDelegate causing infinite loop
« on: July 09, 2014, 08:17:40 AM »
hi retn,

we used to add event delegates like that:

  1. EventDelegate.Add(letsPlayTween[1].onFinished, OnFinished);
(instead of letsPlayTween[1].onFinished.Add (new EventDelegate(OnFinished)); )

But what are you trying to achieve? Loading from resources, creating and destroying the lobby endless times does not sound like good practice and cost lots of time and work for the garbage collector.

Can't you refresh the values of the lobby instead?

5
NGUI 3 Support / Re: Adding item to UIGrid on index 0
« on: July 09, 2014, 07:57:43 AM »
Sorry Tripwire,

I misread your post first time. You can simply add

  1. clone.transform.SetAsFirstSibling();

somewhere in your code after adding and before Reposition(). Adding a transform (also over NGUITools.AddChild) will always add it at last position. With this code it will then be put on the first place (Top), you won't need extra sorting then.

Just tried it out with my own scrollview, this time it should be really what you wanted ;)

6
NGUI 3 Support / Re: FixedSizeOnMobile not working on WP8
« on: July 09, 2014, 07:43:30 AM »
Thx Aren,

that solved the problem! ;D

7
NGUI 3 Support / Re: Adding item to UIGrid on index 0
« on: July 08, 2014, 03:22:46 AM »
Make sure you set up the right Content Origin in your UIScrollView. Setting the origin to Top should order your list like you want it, having the first item at the very top.

8
NGUI 3 Support / Re: FixedSizeOnMobile not working on WP8
« on: July 08, 2014, 03:12:36 AM »
We changed all UIRoots to FixedSized and its working for wp8. I still dont understand why wp8 is not counted as mobile..

9
NGUI 3 Support / FixedSizeOnMobile not working on WP8 (Solved)
« on: July 07, 2014, 06:55:21 AM »
Hi guys,

we got another problem with windows phone (using Unity v4.5.1f3, NGUI 3.6.4b):

The scaling style FixedSizeOnMobile on UIRoot is not working on WP8 (on iOSX and Android it's running fine),
the GUI never scales and is always way to small. If we change the setting to FixedSize only, the scaling works fine.

Edit: Just tried the new version 3.7, still same problem.

10
NGUI 3 Support / Bug: REFLECTION_SUPPORT - Windows Phone
« on: May 07, 2014, 02:00:14 AM »
Hi Aren,

I just ran into a bug: Buidling on a windows phone fails:

  1. Assets/NGUI/Scripts/Internal/PropertyReference.cs(167,17): error CS0103: The name `mField' does not exist in the current context
  2.  
  3. Assets/NGUI/Scripts/Internal/PropertyReference.cs(168,17): error CS0103: The name `mProperty' does not exist in the current context

Looks like windows phones don't support reflections. Most of the time, your scripts handle that just fine, but it looks like you forget some code. The function Reset in the class PropertyReference (line 165) should look like that, then it compiles again:
  1.         public void Reset ()
  2.         {
  3.                 #if REFLECTION_SUPPORT
  4.                 mField = null;
  5.                 mProperty = null;
  6.                 #endif
  7.         }
  8.  

Keep up great work!

11
NGUI 3 Support / Re: Unity animations are not working
« on: January 29, 2014, 05:43:40 AM »
Merci beaucoup  ;D

12
NGUI 3 Support / Unity animations are not working
« on: January 28, 2014, 11:00:51 AM »
Hi Aren,

our game developper prefers to make animations over the unity editor instead of using tweens. This works fine for manipulating the transform values of an UI element. But i.e. changing the color brings strange behaviours. When changing a label or sprite color over the inspector, the change can be seen in game immediately. However, when it is changed by the unity animation, the color in the inspector changes but not in the game. Only on some rare moments, the color does change in game but without any interpolation.

What are we doing wrong? Is there an extra option to set?

Thx in advance and kind regards,
grofie

13
TNet 3 Support / Re: Multiple Servers on LAN?
« on: December 09, 2013, 07:00:25 AM »
Hi ArenMook and junjettrasmonte,

I ran into the same problem and wanted to make sure you guys (especially junjettrasmonte) solved it similar  :

Its theoretically possible that our game runs with multiple servers in one lan, since each player can be a server.
The implementation is still quite basic, the join menu is not much more than the TNet example. I could not find the TNUdpLobbyServer script on any gameobject (so its hard to enable or disable the it), but the lobby still seams to work fine. I only got the previously described error with the lobby servers overwriting each-other.

I solved the problem by simply removing line 194 in TNServerList.cs ( list.Clear(); ). That way the list does not get cleared before receiving a new list from another lobby server so that multiple lobby servers are working.

I don't like this approach since I had to manipulate a TNet script, but I don't see any other way. The lobby servers are on only for a short time. When a second player joins, the game gets private immediately, the client can go offline any time so the lobby server would have to change. Since I have to choose to use a local or a remote lobby server on starting a game server (TNServerInstance.Start), it would mean I would have to restart a game server whenever the lobby server goes offline, besides the trouble of synchronizing the whole operation.

I hope I could make myself clear. Maybe you guys have a better approach for this problem and are willing to share it with me  ::) !?

14
TNet 3 Support / Re: Time synchronisation and manual ping
« on: December 02, 2013, 05:49:45 AM »
Hi Aren,

thx for your answer. Four seconds is quite long, since my initial countdown is only three seconds long. The first ping is super high, probably because of level loading. At least the ping is updating on server side when the client sends a RFC.

Still would be nice if the ping could be forced manually. I could write a setter of the ping interval, but I do not want to hack into the TNet code..

15
TNet 3 Support / Re: Time synchronisation and manual ping
« on: November 28, 2013, 03:34:15 AM »
Thanks Manmax for your answer, but it missed my point a bit:

A few milliseconds of inaccuracy wouldn't be bad. But now I got inaccuracy for half a second, which is quite obviously on the start of a racing game. Like I mentioned, the problem is the ping which always stays high on the same level. When I got pings like 250ms, but the actual ping on two local instances should actually be around 16, that's not a surprise. The ping is calculated on level start, so it is quite high because of the level loading process. But I still don't get why the ping is not getting updated afterwards.

The game didn't go far yet (no big data processing), my computer here at work is amazingly fast, so the profiler data is inconspicuous.


//supplement

While writing this post I got an idea myself:

My initial approach was like this (like the quote in the first post): On level start the server sent his time to the other player every half second while the countdown went down. The client tried to calculate the offset between his time and server time with the added ping. Since the ping did not get updated, the offset differed around two times the ping.

Now I let the client send (empty) RFC calls to the server in similar intervals. By that at least the ping on the server side gets updated and now shows the expected 16-17ms. The ping on client side still stays wrong on high level and does not get updated. To avoid this problem I simply add the ping twice on server side now. Now the time is the equal (enough) on both instances.

I am not totally happy with this solution, because it feels a bit like a hack (sending empty RFCs, using only the server ping) and not like the solid way to do this, but at least it is working. I am going to test it with higher latency now.

Any hints or opinions are still welcome.  ;D

Pages: [1] 2