A lot of BASIC Questions

Sorry if I have been clogging up the forum with all of my basic questions.

These questions are pretty basic, but I hope some one can answer them for me.

  1. Is there a way to store variable so when the player, say, picks up a key, he can then open a door?

  2. Is there a way to make an inventory system?

  3. I know there is probably a way to do this, but how could I make it so the only way a player can click on an object, is when they are a certain distance from it.

  4. How do I make the cursor stay in the middle of the screen, but make the user be able to unlock it from the middle of the screen and then put it back again?

  5. How do I change the look of the cursor?

  6. How do I change the look of a cursor just for the moment the user has hovered over a certain object?

  7. Is there some way to make a loading screen? There doesn’t have to be a loading bar.

  8. Are there any tutorials out there that would teah me how to make a conversation between a player and an NPC?

  9. How could I make a health system? A ammo system? A Hunger and Energy system (You know, like if the player’s Hunger bar is low, the player has to eat something to make it go up, like The Sims)?

I am deeply sorry for asking so many questions. Please forgive me. I know all of these questions probably won’t be answered, but I would be very grateful is some one were to try to answer some of them.

Thanks.

This tutorial may help you figure out answers to these.

All of these problems have relatively simple solutions (except perhaps the NPC conversation, which could get a bit complicated). While I could answer most of them for you now, it would be a really big post. It’s probably better if you pick somewhere to start (having a character that walks around and opens doors, for instance) and just dive in. If you have questions about problems you are actually facing, ask them here and we’ll be glad to help. Chances are that by the time you’ve made it half-way through your list, though, you’ll have a pretty good idea of how to approach the other half.

So pick one and we can start from there. :slight_smile:

welcome director ; )

i’d definitly take the tutorials for a spin, for what you’re asking particularly the FPS one available here:

http://unity3d.com/Documentation/Manual/Tutorials.html

and don’t be shy about asking on the forums - everyone has to start somewhere - people are very helpful here if you get stuck ; )

Everything you’ve asked about is entirely possible and in each case there are multiple ways to implement the desired functionality. Therefore as indicated it really would be best for you to give the tutorials a read and go from there. Once you have more specifics about how and where you want to store data we can better advise on ways to efficiently and appropriately implement the various elements above.

Some info to help start you along the way:

  1. Yes, there are many ways to store variables so that you can use their values to allow/disallow various interactions.

  2. Again, yes there are ways to do inventory systems, whether using arrays or custom data classes or ???

  3. It’s very easy to get the distance between two objects in your scene (the player and the clicked object) so that you can allow/disallow the click interaction (this is very similar to item #1 above).

4, 5, 6: Have a look at these two sections of the docs: Screen.lockCursor, Screen.showCursor

  1. You can customize the web player loading screen, or you can implement your own loading scene (web player and standalone) if you’d like. For information on customizing the web player loading screen, which is a Unity Pro-only feature, go here: Customizing the Unity Web Player loading screen

  2. No, not directly. This is likely the most complex task you’ve asked about, cover the other topics first. After that you can worry about storing various conversation prompts/responses to create a dialog experience.

9 Easily, you’re just storing variables related to particular objects (playerHealth, playerHunger, etc) then checking those values to determine game behavior (tell the user their hungry if playerHunger gets too low, if they ignore you then you decrement playerHealth, and so on).

Don’t be sorry, just get busy! :slight_smile: There’s a lot to learn and everyone here on the forums is willing to lend a hand. Have fun!

Thanks for all your help guys!

I’m gonna get a start on this program.

I’m going to dive right into it and try to learn everything I can myself, then maybe I can get somewhere!

Thanks!

Heads up on player/NPC conversations check out nafonso’s recent Showcase thread:

Master’s Thesis Demo - The Market

Check out his master’s thesis demo… :slight_smile: