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

Pages: [1] 2
1
NGUI 3 Support / Re: Ngui Button collider problem
« on: August 29, 2015, 04:59:09 AM »
I have had the same issue as well. However I have figured out why this is happening. When you lower the resolution on the standalone of the game. Lower than the resolution your PC is set at, the colliders of the buttons are thrown off. More so on the buttons set on the right side of the screen than the left.

To fix this: If you set your monitor resolution to the resolution you are going to test the standalone game on before you start the game. Everything will work as intended. So, if your user needs to set their resolution on the standalone to a lower one than their native resolution. Then they will need to change their PC resolution through windows before launching the game.

This seems to have fixed the issue across multiple alpha testers we have testing our game. I am working on a 'work around' that doesn't involve the user changing the PC's resolution before going into game. If I achieve this I will post here with how I was able to fix it.

I hope this temporary fix helps others.

2
NGUI 3 Support / Re: A few questions
« on: September 19, 2014, 09:06:43 PM »
No, the data is from my GameManager from a few scripts I made and attached to it. I have an idea on how to go about this. I do thank you for your help. I will post back if I have anymore questions.

Thank you again.

3
NGUI 3 Support / Re: A few questions
« on: September 19, 2014, 04:24:07 PM »
Ok so I figured it out. I filtered the UISlider script to send it's value to a script I wrote:
  1. using UnityEngine;
  2. using System.Collections;
  3. using Assets.Code.Interfaces;
  4. using Assets.Code.States;
  5. using System;
  6.  
  7. public class MakeLableWholeNumber : MonoBehaviour
  8. {
  9.         public GameObject label1;
  10.  
  11.                 // Use this for initialization
  12.                 void Start ()
  13.                 {
  14.                         label1 = GameObject.Find ("/GameManager/UI Root/Control - Colored Progress Bar/Thumb/Label1");
  15.                 }
  16.        
  17.                 // Update is called once per frame
  18.                 public void Update ()
  19.                 {
  20.                        
  21.                 }
  22.  
  23.                 public void MakeItemAmount()
  24.                 {
  25.                         UILabel label = label1.GetComponent<UILabel> ();
  26.                         label.text = Mathf.RoundToInt(UIProgressBar.current.value * 1000f) + "";
  27.                 }
  28. }
This gave me not only the amount I needed(1000 items max) but will allow me to do more with everything later. Now I don't need it right at this moment, but I see a problem with it going past 1000. So my original question about setting the Value in UISlider, being 0-1, is still valid. Is there a way to up it? That way I can do above 1000?

Thank you again for your time.

Edit: Ok I found the value from the '1-0 Value slider' in UIProgressBarEditor. Sadly if changed from 0-1 to 0-100 it automatically sets the value to 1(In inspector) and you can't change it. If someone could point me in the right direction on where to edit to get the value slider to do more than 0-1 that would be amazing.

Another issue I am having is how to get the UISlider's Value to start at 0.001 vs 0.01(default). If someone could point me to the script and line where to change this, I would be most appreciative. Thank you.

4
NGUI 3 Support / Re: A few questions
« on: September 18, 2014, 06:14:20 PM »
Thank you Nicki. I am just going to have all the UI elements on one panel and turn each item off with "SetActive" that way when you hit "I" It fades the HUD for the Inventory. Thank you for the help though.

I do have two other short questions:
1) With a UILabel, how do you send a number to it? I have tried this
  1. UILabel lbl = GetComponent<UILabel>();
  2. lbl.text = "Hello world!";
but the 'lbl.text' does not work with numbers(obviously). I have looked around this site and could not find anything. I even dove into UILabel and UISlider.

2) Also if there is a way to make the UISlider "Value" to be more than 0-1? Something like 0-1000? If not I can multiply the value before it gets to the UILabel. I just need to know how to send numbers to a UILabel before that can happen.

Thank you in advance.

5
NGUI 3 Support / Re: A few questions
« on: September 12, 2014, 06:18:44 PM »
Ok another question, with this one I hope to be less of a thorn in your side.

I have made my inventory, looks amazing! It works amazing, thank you! I however come up with another problem. How do I make another UI root and camera that goes with it? Here is what I am trying to do:

I have a camera on my inventory UI, that works just fine(via NGUI). I was wondering how I am able to make a inventory and then a HUD  this way. Every time I create a new panel, UI, etc, through NGUI it always attaches itself to the original UI root. So what I am asking is if there is a way to make another UI root so I can stick another camera on it and make another viewport for the HUD. I know how to toggle the prefabs through "SetActive" and it works. That way both the HUD and the Inventory are on the same UI root. Sadly everything under the one UI root has to be(and reverts back no matter what) to the layer the UI root is. I was just hoping to have 2 'viewports' as it were so things are not all in one space. If not possible I understand, honestly I was just trying to make it look clean.

Another way to ask my question would be, how would you set this up to be 'clean' looking? Thank you for your time again!

6
NGUI 3 Support / Re: A few questions
« on: September 11, 2014, 05:39:34 PM »
Ok this helped me a lot as I have not worked to much with layers through unity. Before I was using all layers though code only. In fact most everything I do is with code vs unity's panels. My old UI system I built though code used one layer and keys toggled on and off the UI(HUD and Inventory). So I thank you for being patient with me. Sorry it took so long to understand what you were trying to convey.

Thank you again, I will be back with more questions if necessary but for now I can move forward.

7
NGUI 3 Support / Re: A few questions
« on: September 06, 2014, 01:05:23 PM »
So sticking each camera on the same layer will have one render over another if 'I' is pushed? Like I said I have one cam turn off and another on to get an 'inventory'. The problem is, I want what is on another panel I made in NGUI to overlay the one on my current FPS camera(Not made by NGUI). Or at least add NGUI properties to my current FPS camera. I am really at a loss for words on how this is done. Now I am not saying you are wrong, it's just because I don't know what you mean. How will the game's layers help in this situation?

I hate saying it but I might need a bit of a detailed walkthrough on this, if you would not mind.
Thank you

8
NGUI 3 Support / Re: A few questions
« on: September 05, 2014, 05:02:09 PM »
Ok so things have been long going. I stopped the UI system to work on other areas I needed to fix. I am back on the UI system again. I have built a UI system with NGUI for both my inventory and HUD. The problem I am getting is calling the UI for the inventory with the 'I' key and have it overlay the main camera. I know the answer is staring me in the face. I have made the UI panel for my inventory. I just don't know how to have to come up on my Main Camera.

I can make unity switch from the UI panel's camera I have made for the inventory then back to the main camera with no problem. What I was hoping is to get an overly of the inventory window over my FPS view. So when I hit 'I' it shows on the screen and you can still see the FPS view in the background. I guess what is stumping me is getting NGUI attached to my FPSCamera prefab. So for the sake of argument, lets say I am using the Controller that comes with unity.(The prefab has the name of "First Person Controller" under the "Standard Assets/Character Controllers/" if you import the "Character Controllers" Asset.)

So with that Prefab how would I go about adding a HUD and an Inventory system. Like I said I already have it so the user can switch between a UI Panel and the main camera. That however does not put the Inventory UI over the main camera, it's taking the user to a 'new' camera. That's not what I want. I want the inventory UI to overlay the main camera. I also want to do something similar to the HUD, it will only come up when the player is hit(I already have the code for that) and fade after a few seconds.

I am just confused on how to attach it to the main camera I have already made. That way no matter what way you are looking with the mouse(In First Person View) the inventory will still come up on that camera. I have even watched most all the walkthrough vids. So if it was there in your walkthroughs, please post where and I will go over it again. Or if there is another thread on this I would be more than happy to read it over. I would ask if you could possibly give me some step by step on how you would attach it that would be amazing!

Thank you.

9
NGUI 3 Support / Re: A few questions
« on: August 05, 2014, 04:38:40 PM »
Well you have been such a big help! However I have to ask another stupid question. I think you have explained it but I am confused as my situation is a bit different. After the Title screen and the options menu I have a FPS cam prefab that is called into game via code so that it's not there until you are out of the menu. What I need is to build a HUD on the FPS cam that is called into the game. How would I do that? I figure I would have to add it to the prefab itself. Sadly I don't know how to go about doing this. If you can direct me to a tutorial or if it's as easy as making a main menu.

Thank you in advance.

10
NGUI 3 Support / Re: A few questions
« on: July 26, 2014, 01:12:47 PM »
Ok here is the other file. Sorry I had to double post.

11
NGUI 3 Support / Re: A few questions
« on: July 26, 2014, 01:12:01 PM »
Ok another question:
I have made my buttons as I have said before. That was super easy and I thank you and your crew for this. I am however having an issue with the button placement. I have used your anchor system to get it to resize to the screen so no matter what resolution the game is set at the button will resize accordingly. My problem is that the button stretches to an inch of the side of the screen. I have made some progress with adding an invisible sprite and anchoring it to this. Sadly it doesn't make for a good look on lower resolutions. Is there a setting to set the offset of the anchor? I will post some pictures here if you don't mind taking a look as I think that my words don't do the issue justice.

What I am trying to do:
Make a button that resizes when the screen resolution changes.
Sizes we support:
1920 x 1080
      |
      |
     \ /
640 x 480
Everything in between those. I just need the button not to be almost the size of the screen when using 640 x 480. Thank you in advance.

I will have to post twice to get all the pictures as it's 1.3MB  ::)

12
NGUI 3 Support / Re: A few questions
« on: July 26, 2014, 01:05:05 AM »
Awesome that's exactly what I want. Thank you so much! Also I was able to start my State Machine from a button by setting it up like you(or one of your employees?) did on the walkthroughs here. I made an invisible sprite and gave it a script to start it. I am sure I will have more questions soon. I hope you do not mind me adding them to this thread.

You guys are amazing. Thank you again!

13
NGUI 3 Support / Re: A few questions
« on: July 23, 2014, 03:36:31 PM »
NGUI performs its own raycasts underneath mouse and touch events, provided the camera that sees the object you're interacting with has a UICamera script attached. NGUI won't perform raycasts into the screen that's not under the mouse or touch event. You can create a custom input method for NGUI that would do that, however (set UICamera.onCustomInput).
Thank you. Is this how I get game data information to show on the UI for the HUD? I will search for it as well. I have not had time to dive into NGUI as I have been watching the tutorials. Just thought I would ask here in case I can not find it.

How to get the text come up on the screen? Enable the game object that has the UI element you want. Not sure I understand the question. Do you want it to be in the world space, part of your 3D world? If so, create a game object, attach UIPanel to it, and add widgets underneath it. You'll want to scale the panel object so that it's small first though (0.01, 0.01, 0.01 for example). You don't need the UIRoot for in-game UIs.
I was meaning a HUD. So if you look at a specific rock it says "Use bla to do bla" on the players view.

I should also mention that my game is a first person shooter. Thank you again for your time.

14
NGUI 3 Support / A few questions
« on: July 22, 2014, 01:24:23 PM »
Hello everyone,
A little about my company and myself before I begin:

The name of our company is FireCreation. We are a small group of 18 people. We are obviously using Unity to build our first game for retail use.

I am 32 years old. I am the lead code designer as well as our company's CEO. I have years of experience with C++, LUA, HTML1, and HEX. I started modifying an old game called Marathon, Marathon 2, and Marathon Infinity(in HEX). Followed by Unreal(the first Unreal) and Unreal Tournament(A forum of C++). Then I moved on to Arma, Arma 2, Arma 2 Operation Arrowhead, DayZ the mod, and the mod Domination 2(Arma is C++ oriented). I then turned my sights onto modding Rust(LUA via Oxide). Now I am working with C# in Unity. Even though I might know a great deal of C# I still do not know everything.

I have a few questions, some might have already been asked. Some I might find by the time someone answers them. I want to say sorry in advance for any duplicate questions that someone has already asked. I also want to say sorry for questions that might be obvious to a seasoned coder in C#. I am still learning some of it's advance capabilities. I am also watching all the tutorial videos that these fine people here have made for us. Sadly not only do I have to take care of my company, but I have a wife and an 11th month old that demands quite a bit of my time. So I watch those amazing videos when when I have time.

Now for my questions:

I am using a State Machine for our game. I also created a preliminary UI system before I bought NGUI (I am attaching it to this thread, anyone can use it if they need although with NGUI it has become moot). What I am trying to do is get a UI to come up when the user looks at the item in question. I had it working with my little UI script. I have RayCast always on(another script) and I also got it to read when nothing is being 'hit'. So what I am asking is how would I get NGUI to have text come up on the user's screen when RayCast hits a specific item?

I am also using a State Machine to have persistent terrain, items, etc. So how would I add the main menu to what I already have? As of right now I have every item(gameobjects, scripts, the State Machine itself, etc) attach itself to an empty gameobject. I tried to attach the 'Control - Background' to this gameobject but I get an error. The UI Root does not child itself to the gameobject but the 'Control - Background' does. I know I am going to need the UI Root for the entire game. How would I go about Getting the UI Root to be persistent through the loading of each scene with my State Machine(child it to the empty gameobject like the Control - Background)? I have thought of making the UI Root replace the empty gameobject and attach everything to the UI Root. Yet before I rip that apart I was hoping to get a few ideas, if any.

There will be more questions to come as I watch more of the tutorials. I will use this same thread to ask them when they arise. I want to thank everyone in advance for even taking the time to read this. I also want to thank the Developers of NGUI. You guys are awesome! Your application will cut my development time in half. The one thing I have noticed with new indie game developers now a days, is they might be pushing out games with amazing gameplay but they forget to have something as basic as a comprehensive UI. To me the UI is just as important as gameplay. It is the first thing you see when the user loads into the game.

So again thank you for your hard work, you have gained an avid supporter!

15
NGUI 3 Support / Re: NGUI context menu missing in latest Unity
« on: July 21, 2014, 02:12:38 PM »
I updated to 4.5.2f1 from 4.5.1f3 and the context menu is there but I did have an issue similar to yours. It might help you. Here is the post(at the bottom) http://www.tasharen.com/forum/index.php?topic=10451.0 I had started a UI of my own before I bought this amazing program. It seems having a GUISkin activated takes the pulldown menu out of Unity. I don't know if this is a bug or something that is supposed to happen.(I was going to take this script out anyway it did however take a some trouble shooting to figure it out.)

Also start a new project, if the menu is there in a blank project then I would look in your code and see if there is anything that 'might' conflict.

I hope this helps.

Pages: [1] 2