Wednesday, March 8, 2017

Day 23: Finishing Dialogue & Character Stats

To finish the dialogue system (for now), I added some script to the sign post so it would be part of the system.

Now that the sign is added, I can now interact with it. Unfortunately, I forgot about the problem with the dialogue box sizes. I'll try to fix that.

I changed the size of the panels a bit, and it seems to work only if the screen is a certain size. For some reason, it stretches the panel if the screen is stretched. It's fine for now, but I'm not really happy with it. I might come back at some other time and fix it.

I can now continue on to the next tutorial video: "Character Stats". This will include things like damage, health, etc.

First of all, I created a script called BaseStat, which is the class that every stat is based on. I will be adding stuff later on, but this is what it looks like so far.

I then made another class script called "StatBonus" which will control the added stats, like buffs, debuffs, and equipping a weapon.

Next class I will continue the tutorial.


















Tuesday, March 7, 2017

Day 22: Dialogue System Continued

To start, I made a script that will help control what specific NPCs say.

Now I have this thing in the NPC script component in the NPC object. It allows me to simply type whatever into the boxes, and the NPC will say it. I can also set the name.

I added a lot more script (which would take a while to explain)...

And this is what I ended up with in the end. Unfortunately, the dialogue seems to be running through twice, which I'll have to fix. I'll also have to fix the size of the text, since it sometimes goes past the edges of the box.

To fix the double-dialogue, I simply needed to delete these lines. For some reason, the guy in the tutorial said to put them in, yet it works without them.

And after tweaking the size of the boxes a bit...

It's still messed up.

Next class I will first try to fix the dialogue box, then I will continue the tutorial.










Monday, March 6, 2017

Day 21: Blender

Today Unity decided not to work, so instead, I took the opportunity (sorry) to learn a bit about Blender, the popular 3D graphics designer used by most game devs.

I started with a complete beginner tutorial to learn the interface.

First off, camera movement. Middle mouse button is used to orbit a specific point.
Ctrl+middle mouse button is used to zoom in/out.
Shift+ middle mouse button is used to pan the camera.

Some of the options on the 3D view window can be toggled using T and N.

The "header" (which is located on the bottom for some reason) contains most of the basic tools and options I would be using when making 3D models.

To select an object, I right-click on it. It doesn't seem very intuitive, but I'll just have to get used to it.

"User preferences" allows me to change settings such as display, controls, hotkeys, etc.

Next class I'll probably go back to doing the Simple RPG in Unity (if it works) and leave Blender for my Side Project posts.


Sunday, March 5, 2017

Side Project - Post 1: Water

Since the tutorial I'm currently working on doesn't show how to add realistic-ish water, I decided to find a tutorial myself. I found an overwhelming amount of tutorials...that didn't really help. A lot of them required assets that I would have to buy in the Unity Asset Store. However, I did stumble onto one tutorial by Pix Lab Games...

In the tutorial, Pix Lab says that in the Unity "Standard Assets" pack, there is actually 4 different types of water. All I need to do is drag it into the world and edit it there. I used "Water 4 Advanced", the most realistic water in the pack.

And it looks really good.

The nice thing about this water is that it uses cameras (the ones seen in the gif) to create a "reflection" effect. Although it's not shown in my gif, the water also has an effect for where the water meets terrain, but only on "high" quality.












Friday, March 3, 2017

Day 20: Dialogue System and Interactions

First of all, I needed to add to the script to prevent the player object from interacting with an object until it is within a certain range.

Well this is a problem. It appears to be calling the "Interactable" function infinitely many times until I stop it. I need to find a way to only call the function once.

To solve that problem I added boolean called "hasInteracted". When the player starts moving, it is set to false. When it reaches the interaction distance, it is set to true. So since the "Interact" function is only called if "hasInteracted" is false, then it only calls the function once.

After adding a "!" just before "hasInteracted && playerAgent != null...", it worked perfectly!

Now I can finally set up the dialogue UIs. First, I started with a simple panel, which I called "Dialogue".

I then scaled the panel down (it was taking up the entire screen), and added a button labeled "continue".

Then I added another, smaller panel, with the text "Name". And that is the basic dialogue UI. I imagine the tutorial will have me add some scripts that show the dialogue and name based on what I'm interacting with. I will continue the tutorial next class.

Thursday, March 2, 2017

Day 19: NPCs and Interacting - continued #2

To stop the player before it reaches an interactable, all I had to do is add a "stopping distance" of "3f", which stops it 3 feet (?) away from the interactable.



I then made the base script for a sign post, which will have dialogue added to it in the next tutorial video.

It didn't work until I remembered to add a tag to the sign, but once I did, it started working.

And that concludes the "NPCs and Interacting" tutorial. Next class I will start the "Dialogue System and Interactions".



















Wednesday, March 1, 2017

Day 18: NPCs and Interacting - continued

To continue from last class, I added a script that made the player move to the interactable object when the object is clicked. Now, the original move script allows the player to move, but I need another script to make the player move to the interactable object before the player interacts with it.

I then made an NPC script and added it to my NPC as a component. This is only a base script, but I can build off of it for each NPC.

I needed to do the same thing for the PickupItem as well.

Now when I click the NPC or Pickup, it interacts with it, and moves towards it.

I just need to make the player stop just before the NPC, otherwise it passes through the box. That, however, is what I will work on next class.