Hello community, earlier I asked in the IRC channel about one or two of my specific questions but I am a little stumped. I have done extensive searching on the subject and unfortunately have found nearly nothing relating to this. So my various questions are below, I appreciate any time you may spend reading these questions and would even greater appreciate some assistance.
Table of Contents
- 3D Isometric Camera
- Character Controller (Specific)
- Non-Playing-Character Interaction
- Basic Enemy AI / Path-finding
- Grid Based World
- Equipment Graphic Change
1. 3D Isometric Camera Character
I have seen multiple threads on this and the standard responce seem's to be along these lines;
For an Isometric camera: Create an empty GameObject called 'CameraTarget' at (0,0,0). Create a camera at (0,0,-10). Parent the Camera to the CameraTarget. Set the rotation of the Camera Target to (30,45,0) then check 'Orthographic' under the Camera settings. Adjust the > 'Orthographic Size' camera setting to change the amount of zoom. Move the CameraTarget around the world to change the focal point on the map.
Which is all well and good, however I need to make it so that the camera alway's focuses on one character; as in, when the character moves in a direction it follows, which will be mentioned later on when I get to my grid related questions, so the kicker here is; how do I make it so that the camera constantly focuses on the character who should alway's be in the center of the screen?
2. Character Controller (Specific)
Alright, seeing as how everything in the game will be running off a grid, I do not want to have eight-directional movement, I only wish for enemies and the player to be able to move in four directions;
The question and principle is simple, however I do not quite understand how I would limit the player to this system, following on from that I only want the player to be able to move in one direction at a time and at one grid-square per-move. I was told this has something to do with 'Lerpz' but I am unsure.
3. Non-Playing-Character Interaction
A very basic concepts of all game's is interaction with NPC's but I am unsure of how I should go about doing this, now; I want the player to be able to double click on the square that the NPC's sprite resides on and it to open a context menu that has various options as depicted in the bellow figure;
The other issue here is limiting the distance between the player and the NPC that way you must approach the NPC, and be within one grid square of his/her current position before the NPC will respond. When a failure to communicate with the NPC occurs, I would like a small notification to pop up that says something along the lines of '(X) doesn't hear you.'
4. Basic Enemy AI / Path-finding
When it comes down to it, I do not need very much for this, each enemy will have two functions;
- Spell Cast (Range Limited to Enemy Sight)
- Melee Cast (Next to the player, Simple Assail or Skill Usage)
How would I make the enemy cast a spell if it has the required Energy and is within sight-range, and if that fails or the prerequisites are not met, it will venture to path-find via the grid system to you and then begin attacking with melee? The system doesn't have to be very intelligent, in fact a basic model would suit this project as it's nothing too hard-core strategy related. Ideas?
5. Grid Based World
To quickly recap, the entire world is mapped and played out on an invisible grid, using only one elevation level and two different tile functions;
- Open (Can be walked on.)
- Closed (Cannot be walked on.)
Simple enough for the most-part but it's gotten a little more complicated, how do I render a grid to design the world in beforehand, and when that is done, how would I make it so that when the cursor hovers over an open grid-square a small cursor icon appears similar to a move-to icon. The reason the world is grid-based is because I have a tile set of images I intend to / would like to use.
6. Equipment Graphic Change
This one is a quick one, how would I make it so that when an item is equipped using an inventory or character panel script the model of the player changes to reflect this, assuming I have all of the models needed for it to be changed?