I can get my player to aim his gun 4 directions depending where the mouse is and fire on mouse click. Even if I have 8 directional sprites, he will only face four of them. Is there a way to make him face diagonal too?
yes, use the diagonal sprites. I think you have to check "Use diagonal views" in the general menu
I don't see a use diagonal views anywhere. I have the diagonal ones placed in the view and it only seems to use them to turn the character left right up or down more smoothly. But it won't actually stop on these diagonal loops. Like, if the mouse is at the top of the screen, he will face up, if its at the right of the screen, he faces right and so on. But if I were to place the mouse at the top right corner, he should use his up-right loop, instead it either stays up or turns to the right. I hope this isn't confusing..
It's on the 'Character' window (so obviously, you'll have to set it for each character you want to have 8 views). In 2.6 it's called No diagonal loops, in 2.7, it's just Diagonal loops.
Oh, yes. That's already on. But all that does is make the character turn smoother cause it animates it, but it still doesn't actually stop on the diagonal loops when the mouse is in a diagonal position.
What's the code you use to have the character face the mouse position?
I use in repeatedly execute:
character[EGO].FaceLocation(mouse.x, mouse.y);
Doesn't work for me either (v2.71 Beta 2). Unless someone has any other ideas, I think this should be reported to CJ.
You could probably force it to hold the diagonal loops with a bit of scripting - it depends on how exactly your game is set up (e.g. you could do it, but it'd look strange if the character was also walking).
But yes, it should definately be reported.
Hm, well if my rooms did not scroll, then I could put hotspots in the corners, and change the view, loop or frame to a diagonal one when the mouse rolls over it.
Maybe you could use transparent, non-clickable GUIs placed in the corners of the room?
Or, if you're using 2.7+, you could use some fancy maths (such as the stuff [...] has in this post (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=21384.msg261236#msg261236)) to work out the angle of the mouse relative to character.x, character.y (or character.x - GetViewportX(), character.y - GetViewportY(), since you've got scrolling rooms), and set the loop accordingly. Been a while since I did that sort of maths though, so I couldn't tell you exactly what you'd need to do.
EDIT: And of course if you weren't too bothered about accuracy, you could probably fudge through it with some more basic maths.
Hm, I realized changing loops when mouse goes over the hotspot is a bad idea because my character moves all over the room, it would only work if he stayed in the center. But I know you can face diagonal if you set the right coordinates, so maybe there's a way to just face these hotspots?
Ha, I made it work. Just took some mouse and character coordinates and assigned LockViewFrame to them. Thanks for the help anyway!