Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Mouse movement for FPS
Old
SirThorfinn
Senior Member
 
SirThorfinn's Avatar
 
Status: Offline
Posts: 232
Join Date: Sep 2010
Location: Some where Unreal!
Default Mouse movement for FPS - 09-12-2010, 05:41 PM

Ok i'm still perfecting my methods and I've seen the mouse movement example but i'm not sure how to make it work in a different world like the one I've been working on so the mouse when moved (without clicking) will also move the head of your player

(Note: I set the head movement <for now> to the arrow keys because i was experimenting with controlling the game with a joystick using JoytoKey to emulate joystick commands to keyboard keys)
Solider 2.a2w
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 09-12-2010, 05:51 PM

What I do is I have a "body" object, which is just a cube from the objects folder that I renamed "body", and I set it point of view to the camera (right click cube and do methods, set point of view, camera). Then I go to the camera property and do set the vehicle of the camera to the "body". I then use the "body" to look side to side, and the "camera" to look up and down. The reason you can't have the camera looking side to side also is because if the camera is looking up, and then you tell it to turn left or right, it will go at an angle and screw up the screen. You will also have to move using the "body" instead of the camera from now on.

P.S. If you have a character that walks in your game, you dont need to make the body, just use the character in the place of every time I said "body" in the above directions, including setting camera vehicle to character.

Here is a world I just made that basically shows how to do it, you can see my other recent worlds to see how I get the scrolling also in case you want to put that in:
Attached Files
File Type: a2w MouseLookingExample.a2w (239.5 KB, 56 views)


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301

Last edited by Dameria; 09-12-2010 at 07:49 PM.
   
Reply With Quote
Takes more work...
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Unhappy Takes more work... - 09-12-2010, 05:51 PM

Ah, with those mouse movement methods you have to do some scripting, which is beyond your normal drag-and-drop.

I'm feeling lazy right now, but just enable scripting in Alice, copy the world script, paste it into your own world, and copy the methods as well.

Otherwise, use the pre-built world and kind of 'restart' using that world.


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.
   
Reply With Quote
Old
SirThorfinn
Senior Member
 
SirThorfinn's Avatar
 
Status: Offline
Posts: 232
Join Date: Sep 2010
Location: Some where Unreal!
Default 09-12-2010, 05:54 PM

Quote:
Originally Posted by debussybunny563 View Post
Ah, with those mouse movement methods you have to do some scripting, which is beyond your normal drag-and-drop.

I'm feeling lazy right now, but just enable scripting in Alice, copy the world script, paste it into your own world, and copy the methods as well.

Otherwise, use the pre-built world and kind of 'restart' using that world.
OK so how do enable scripting so i can copy and past it?
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 09-12-2010, 06:03 PM

Quote:
Originally Posted by debussybunny563 View Post
Ah, with those mouse movement methods you have to do some scripting, which is beyond your normal drag-and-drop.

I'm feeling lazy right now, but just enable scripting in Alice, copy the world script, paste it into your own world, and copy the methods as well.

Otherwise, use the pre-built world and kind of 'restart' using that world.
You don't have to do scripting, I did it with simple drag and drop.

EDIT: PS look at my first post, I have the world in it.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
What to do...
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow What to do... - 09-12-2010, 06:03 PM

OK. Find a folder called .alice2 on your computer. Inside there should be an XML document called AlicePreferences. Right-click, and select Open With > Notepad.

Search for enablescripting, and scroll a bit to the right of that, where it should say "false". Change that to "true".

Re-open Alice and it should be there. Right click on the world object, and one of the options is edit world script. There you go!


Oh, didn't see your post there, Dameria.
I meant that for full mouse control, meaning that you can make the mouse never go off the screen.


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.
   
Reply With Quote
Old
SirThorfinn
Senior Member
 
SirThorfinn's Avatar
 
Status: Offline
Posts: 232
Join Date: Sep 2010
Location: Some where Unreal!
Default 09-12-2010, 06:03 PM

Quote:
Originally Posted by Dameria View Post
What I do is I have a "body" object, which is just a cube from the objects folder that I renamed "body", and I set it point of view to the camera (right click cube and do methods, set point of view, camera). Then I go to the camera property and do set the vehicle of the camera to the "body". I then use the "body" to look side to side, and the "camera" to look up and down. The reason you can't have the camera looking side to side also is because if the camera is looking up, and then you tell it to turn left or right, it will go at an angle and screw up the screen. You will also have to move using the "body" instead of the camera from now on.

P.S. If you have a character that walks in your game, you dont need to make the body, just use the character in the place of every time I said "body" in the above directions, including setting camera vehicle to character.

Here is a world I just made that basically shows how to do it, you can see my other recent worlds to see how I get the scrolling also in case you want to put that in:
thanks ill check it out
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 09-12-2010, 06:07 PM

Quote:
Originally Posted by debussybunny563 View Post
Oh, didn't see your post there, Dameria.
I meant that for full mouse control, meaning that you can make the mouse never go off the screen.[/SIZE]
Well I just fix that by adding a "scroll" to my mouse control, which makes it so that when your mouse goes to the end of the screen it just scrolls to the side. It is not in this example because I made this quickly, but you will see it in my Sniper example when I post it (I still need to finish the multiple subpart death animations).


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.