I'm trying out the first person movement method, and I have some questions about what is possible with the base Adventure Creator asset, and what needs some custom scripting.
Main Questions:
1) Turning without using the mouse. I have reviewed the available input axes, and I understand horizontal and vertical are for movement in those directions, not for turning. Further, I see the cursorhorizontal and cursorvertical axes, and the manual says to have them set to mouse movement. I'm not quite sure what they are used for. I have tried them out but I can't seem to figure out their purpose. Are they used to simulate horizontal and vertical mouse movement?
2) Simulating interactions. I understand for most adventure games the mouse is the main source of input for interactions, but I would like to create a keyboard shortcut as well. As I have it set now, when walking around in first person mode with the cursor locked to the center and the mouse used for moving the camera, there is no way to detect hotspots or "click" on hotspots to cause interactions. I have the playervicinity hotspot method on, but it still only detects hotspot when the cursor is unlocked, and therefore the player can no longer "look around".
Is there any way to have my cake and eat it too? I want hotspots to be detected while the cursor is locked, and I want to be able to use a key (such as space bar) to "activate" hotspots, again, when the cursor is locked.
Other Issues:
3)Jumping. Jumping using the default Adventure Creator input axis is very hit or miss. Sometimes it works perfectly, sometimes it doesn't work at all. Other times, if the player's side is against a collision cube, it works, and when the player is standing away from it, it does not. Has anyone else had this problem? I've been looking for the jump script with no luck, and I haven't really seen any description of the jump feature on the website or the manual. Any help would be appreciated.
4)Attacking. This game is an rpg adventure, and therefore combat is required. I want the player to be able to attack nearby enemies by both clicking on them with the context sensitive interaction method (which I believe is doable, and I'm sure I can figure it out) and also by clicking a key (1-9 for instance) or an onscreen attack button. The latter two methods are what I'm interested in. In a situation where an enemy is standing in front of the player, is there a way to detect the enemy's hotspot without using the mouse? I understand this question is similar to
#2, but I'm also interested in figuring out how to cycle through targets (multiple enemies in melee range) and figuring out how to fire ranged attacks at far away enemies who are outside the player vicinity trigger object. I would imagine that I can send out a trigger object from the player's position, but I'm not sure how to figure out how to aim it at the enemy hotspot in the distance. Perhaps a "backup" ranged player vicinity trigger object, but then there is the problem of how to differentiate between the two. Is any of this doable with the base AC package?
5)Minimap. Perhaps this is more of a Unity question, but I would like to be able to create an onscreen minimap. I understand Unity Pro has a feature in which you can render a separate camera view into a texture, and perhaps display that in a 3D menu. However I would ideally like to use Unity free for the project, as this is just a hobby. Is there any straightforward way of making a menu element show a scrolling map of the area as well as a marker showing the player? This question might warrant it's own topic, or possibly a post on a more Unity specific forum, but I thought I'd ask to see if anyone has done something similar.
6)Inventory and "magic" items. I want the game to have special items which use a single inventory item texture, but have different properties. Such as X armor of Y, having the properties of X and Y, versus A armor of B, which uses the same armor texture but has different properties. I understand how to randomize these features and I appreciate the very useful parameter tool which makes this much much easier, but I'm trying to conceptualize how exactly to give these items these properties.
I believe that upon adding the item to the inventory, I can set certain variables which would then be checked upon examining the item. For instance, after adding "armor" I can set variable "prefix" to X, and variable "suffix" to Y, and then examining/using/equipping the item will check the variables and send the appropriate responses. However, I am unable to figure out how to "save" these variables for each particular item. If I pick up one "armor" and it has the properties X and Y, and then pick up another "armor" and want it to have different properties, and then have both of these armors in my inventory, the variables would change to the latest properties for each item. One possible solution I can think of is to GENERATE new variables for each item. This could get a bit messy, as I intend there to be many many items in the game, but it may work if the variables are deleted when the items are removed. But moreso, how would I even go about having the game generate variables for me? I presume scripting is involved, and maybe a basic idea of where to begin can help. Also, any other ideas for meeting this goal will be welcome.
As for the inventory, I would ideally like each item to be a different size, so that large items (like spears) take up more inventory slots in a grid than small ones (like rings). I'm thinking of a situation like in the Might and Magic and Diablo games, where "inventory tetris" is part of the game, and somehow pretty rewarding. Is this possible? Or would it be a huge mess? The only nonscripting solution I can think of is having multiple inventory items be used for larger items (such as 5 items make up a shield) but this is terribly messy solution, and I don't think it would be worth it.
That's all I have for now, I'm sure there will be more when I can think of them. Thanks as always for the help!
Comments
1) For freeaiming with the mouse, yes: CursorHorizontal and CursorVertical must be set to mouse movement. But if you want to map them to e.g. keyboard keys, or a Controller axis, then it'll still work. You can use these axis to control free-aiming with something other than the mouse.
2) There's nothing preventing Hotspots from only activating if the cursor is unlocked. Try using the default Demo player prefab, Tin Pot - set Movement method to First Person and Detect Hotspots to Player Vicinity. You can map the axis "InteractionA" to the keyboard, but this is only available when your Input method is set to Keybord Or Controller.
3) If you want more robust jumping / FP movement in general, I suggest using the UFPS asset, which AC is compatible with.
4) You'd almost certainly need to bolt on some custom scripting, since AC isn't built for combat. However, when your Hotspot detection method is set to Player Vicinity, you can set Hotspots in vicinity to Cycle Multiple. If more than one Hotspot is within the detection trigger, you can then use the CycleHotspotsLeft/Right buttons to select each one. (This feature was originally intended to emulate Grim Fandango's control scheme, but should work here, too)
5) Can't help with this, I'm afraid. You shouldn't need to worry about integrating with AC's Menu system though.
6) Would you not be able to use AC's Global Variable system to store these Variables? As for "Inventory tetris", no - it's not possible. This may become more viable when Unity's new UI system is officially released, as I'll be integrating it with AC. But again: bear in mind that AC is not specifically designed for combat / RPG games.
1/2) When the cursor is locked, it should remain in the centre - allowing you to free-aim. When unlocked, free-aiming will not be possible, but the cursor can be moved around the screen. Hotspots should be selectable in both modes. What do you mean exactly by the mouse being "enabled"? That's separate to it being unlocked.
Unity is capable of mapping multiple keys to the same axis, if that's what you're getting at.
3) You don't need to go through the Menu system to simulate input. Just the Input: Check Action. If the Action returns false, loop it back onto itself so that it runs again. If the containing ActionList is set to Run In Background, it won't interrupt gameplay.
4) A "Hotspot: Check current" Action wouldn't cut it, because you'd then have to create one for each and every enemy in your game. Better to use parameters to pass this onto a "generic" ActionList asset that affects whatever GameObject you tell it to. Assuming you've declared this asset as "actionListAsset", it's first parameter is set to be your active Hotspot, and said Hotspot has a ConstantID script on it, this code should assign it:
actionListAsset.parameters[0].SetValue (GameObject.FindWithTag (Tags.gameEngine).GetComponent ().GetActiveHotspot ().GetComponent ().constantID);
You'd then have to run the asset manually, so as not to change the parameter to anything else:
AdvGame.RunActionListAsset (actionListAsset);
For more on parameters, see this tutorial.
6) I understand what you want, but again this comes down to the adventure-focus of AC. With this and the "inventory tetris", I really would advise looking for a more dedicated asset.