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

Pages: [1] 2
1
TNet 3 Support / Offline / AI Player
« on: August 17, 2014, 05:02:43 PM »
Hi there, I'm new to TNet so please forgive me if any of this is obvious or wildly wrong (had a search, couldn't find anything really that useful).

I want to create AI players (completely offline mode), and as seamlessly as possible combining single and multiplayer capability for a real-time strategy. My understanding is that all networked game units are TNObjects, are associated with the TNPlayer via TNObject.ownerID.

How would I go about manually creating/joining AI TNPlayers, so that I can create AI scripts that simulate object management in the same way that a real player would? The main aim being to use the TNObject uuid and TNObject.ownerID association in offline gaming as it would be online.

P.s. saw a similar query on 'Virtual Clients' - however this doesn't seem to maintain the uuid/ownerID association.

Or am I going about this completely wrong....? Thanks!

2
NGUI 3 Support / Re: Update NGUI in a project worked with NGUI (older)
« on: January 14, 2014, 10:44:54 AM »
I don't think there's too much to worry about since 3.0.6 - as Paul said there may be some rework required but while you're still in development it's best to keep at the bleeding edge of NGUI versions.

Familiarize yourself with the update process and don't fear it, you'll thank yourself later.

Here's what I do:
- Open Blank Scene in Unity
- Back up previous NGUI version
- Delete NGUI project folder
- Download latest NGUI from asset store
- Uncheck 'Examples' folder and import (not necessary but I like to keep my project tidy)
- Read the latest release notes!! :)

I just updated a project that has come out of feature-freeze from NGUI 2.5.1 and survived!

3
NGUI 3 Support / Re: 3.0.8 f4 UIInput no text bug?
« on: January 06, 2014, 06:04:41 AM »
Text rendering looks great once more in f5.

Thanks

4
NGUI 3 Support / Re: 3.0.8 f4 UIInput no text bug?
« on: January 05, 2014, 09:54:32 PM »
high-five Aren, I feel your pain! Font rendering feels like it has undergone many iterations and I can appreciate it's a tricky feature to get perfect for every case and everyone's needs... anyway will check out f5 tomorrow and attach the font if problem persists.

5
NGUI 3 Support / Re: 3.0.8 f4 UIInput no text bug?
« on: January 05, 2014, 12:47:21 PM »
Perhaps this is related to UILabel text printing changes...?

I have just updated to 3.0.8f4 from 3.0.8 and noticed if you've had 'Max Lines' set to '1' on a one-lined UILabel it makes the text absolutely tiny. Setting it to '0' fixes the font rendering, however this is causing me problems with UIInputs and passwords field as hitting enter is now appending line-feeds into passwords!

Even more annoyingly I can't say with confidence this is the problem as after testing it out in a blank, fresh scene everything works fine  :-[


edit: I have to say that I'm really not enjoying the recent text print 'tweaks'. It feels now like 'ShrinkContent' is far less effective at maximizing the use of potential space within a UILabel's specified dimensions. Also the Vertical pivoting on Shrunk text feels way too high... (image attached).

UILabel rendering was perfect (for me) before this update :(

6
NGUI 3 Support / Re: Nested UILabels inheriting parent's alpha
« on: December 29, 2013, 12:33:33 PM »
Ah, ok, must have missed that buried in the patch notes.

Thanks.

7
NGUI 3 Support / Nested UILabels inheriting parent's alpha
« on: December 29, 2013, 09:31:10 AM »
Hi - I've noticed that nested UILabels appear to be inheriting parent's widget's alpha and couldn't see any obvious reference to this in the patch notes.

This is after upgrading to 3.0.8 from 3.0.6 f6.

The unnested appearance is the desired effect, however the nested layout is used extensively throughout the game and hence this is happening in a lot of places.

Wondering if anyone else is experiencing this?


[edit: I think this applies generic widget nesting - not just UILabels]

8
Hook into the event using EventDelegate:

http://www.tasharen.com/ngui/docs/class_event_delegate.html

  1.  
  2. public class OptionsToMain : MonoBehaviour {
  3.   public UIToggle soundToggle;
  4.  
  5.   void Start() {
  6.     EventDelegate.Add(soundToggle.onChange, OnSoundToggleChange);
  7.   }
  8.  
  9.   void OnDestroy() {
  10.     EventDelegate.Remove(soundToggle.onChange, OnSoundToggleChange);
  11.   }
  12.  
  13.   void OnSoundToggleChange() {
  14.     if (soundToggle.value) {
  15.     } else {
  16.     }
  17.   }
  18.  
  19. }
  20.  

Hope that helps

9
NGUI 3 Support / Re: Dynamic font always in front
« on: November 28, 2013, 10:30:14 AM »
Yes sorry I see now... not sure then.

I've had this kind of problem in older versions (2.6 I think) where, depending on which UILabel happened to be rendered first, it's depth (taken from Z position in the transform) would be applied to all subsequent labels within that panel. Not sure how this applies to 3.0+ as I haven't encountered it.

You could try throwing a panel onto their shared parent and see if that has any effect.

10
NGUI 3 Support / Re: Prebaf button losing target.
« on: November 28, 2013, 10:22:58 AM »
Hook into the onClick event...
  1. void CreateButton() {
  2.   UIButton createdBtn = ;// code to create and get the UIButton component
  3.   EventDelegate.Add(createdBtn.onClick, OnCreatedButtonClick);
  4. }
  5.  
  6. void OnCreatedButtonClick() {
  7.   Debug.Log("Button Pressed");
  8. }

Don't forget to EventDelegate.Remove(...) when appropriate.

HTH

11
NGUI 3 Support / Re: Dynamic font always in front
« on: November 28, 2013, 10:04:18 AM »
Camera rendering order?

Check the 'Depth' component on the standard Unity Camera class. Perhaps your UI camera should be set to a lower depth than the camera rendering your 3D world.

12
NGUI 3 Support / Re: NGUI/Open/Atlas Maker does not show the atlas maker!!!
« on: November 25, 2013, 12:35:14 PM »
I had this problem with the Widget Wizard.

In my case it was a Unity Window problem.

Try going into Window -> Layout -> Revert Factory Settings

Hope that helps.


Ps. I've always found that support has been excellent!

13
NGUI 3 Support / Search game hierachy for UILabel content
« on: November 25, 2013, 12:02:21 PM »
Hi all,

Does anyone know a way of searching the game hierarchy for text contents of UI Labels that are specified within the editor tree at design time?

Any help much appreciated
Thanks

14
NGUI 3 Support / Re: Can you have Toggle in a toggle?
« on: October 23, 2013, 04:03:06 PM »
I was also getting a NullReferenceException, but I've now adjusted my code to include ArenMook's changes and it works now. Thanks Aren!

kunionjp - Have you looked at the contents of

  1. /// <summary>
  2. /// List of all the active toggles currently in the scene.
  3. /// </summary>
  4. static public BetterList<UIToggle> list = new BetterList<UIToggle>();
  5.  

Within UIToggle.cs?

Bearing in mind that the active Toggle list is static, that would suggest a UIToggle reference is being retained in between Scene changes, and I would guess that its "OnDestroy" isn't being called.


15
NGUI 3 Support / Re: need tips for creating a text console
« on: September 17, 2013, 03:33:38 PM »
Or you can maintain the use of Debug.Log and just use the Unity Log Callback: http://docs.unity3d.com/Documentation/ScriptReference/Application.LogCallback.html:

Then unfortunately you'll need to handle the rendering yourself. I'd suggest looking at using a DraggablePanel: http://www.tasharen.com/?page_id=4444

[edit]Although probably overkill if you're not too bothered about scrolling up through the log's history

Pages: [1] 2