Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Works-In-Progress (http://www.alice.org/community/forumdisplay.php?f=14)
-   -   My Final Project: and FPS (http://www.alice.org/community/showthread.php?t=1165)

Ch0pStickS 01-28-2008 06:50 PM

My Final Project: and FPS
 
1 Attachment(s)
Go to my latest post to see complete version.

danica 02-09-2008 02:04 PM

hi, thx for posting your work here.
but the project is so complicated that i cant even understand how you did.
would it be possible for you to post only the camera control part, as its the most important part for a bunch of ALICE user, as i understood.

thx again.
ps: a few explanations would be great too.
________
[URL="http://www.classactionsettlements.org/lawsuit/zoloft/"]Recall Zoloft[/URL]
________
[URL="http://www.girlcamfriend.com/cam/Sexdollxx/"]Sexdollxx[/URL]

Ch0pStickS 02-11-2008 07:49 PM

Mouse Control Demonstration
 
1 Attachment(s)
alright, turns out i put a half done copy in there, so actually half of it isn't implemented, but the controls are mouse to llok, wasd to move, and 1,2,3 to go to a certain weapon.

Here is a simplified version using only the camera, and movement.

W- move forward
A- move left
S- move backward
D- move right

hold enter and click on the crossfire to calibrate screen.

Look by using the mouse.

To permanently save calibration to your screen setup, go to world properties, and run the world so that you can see both variables, calibrate left and calibrate top.
Calibrate in world, memorize the numbers that pop up, end the world, input the numbers into the reverted calibrate left and top, save the world.

Also in world properties is Sensitivity. Choose 1-10 and by increasing sensitivity, the mouse looks faster.

Calibration just measures if you are pressing enter or not.

danica 02-12-2008 12:04 PM

thank you, i try it immediately .
________
[URL="http://www.ford-wiki.com/wiki/List_of_Mazda_platforms"]LIST OF MAZDA PLATFORMS HISTORY[/URL]
________
[URL="http://livesexwebshows.com/"]Web Shows[/URL]

Ch0pStickS 02-28-2008 05:35 PM

any thoughts of it?

lanceA 02-28-2008 08:41 PM

I'm not into violence so I haven't downloaded it. However I do believe that one of the subscribers made a valid comment when he said he could not understand your code.

Regardless of the project, you should always include comments in your code so that others might understand what your are doing.

Good luck with your continued programming.

Ch0pStickS 02-29-2008 12:49 PM

no not the game im talking about, the MCD thats a attatchment in one of my previous posts. It's supposed to be a plain demo of how it works without any game. so theres no violence, just a screen that moves with your mouse and WASD keys

DrJim 03-01-2008 10:04 AM

Actually Lance A would probably like the game if he downloaded it, since it seems impossible to actually [B][I]hit [/I][/B]anything, no matter how much violence you [B][I]try [/I][/B]to use. :)

But I would certainly echo his point about the importance of comments in your code, even if you don’t plan on ever giving the code to anyone else. First, the comments give you a framework to organize the code, and second, the probablility of you remembering what all of the actual, fairly abstract programming details meant a few weeks after the code was written is not too high.

For example, you comment that you can permanently enter the calibration for the center of the screen. Unless you have figured out how to freeze the size of the play window (which I can’t find in the code), this simply isn’t true. I suspect you found this out during development - but either that fact never regisitered explicitly (you undoubtedly had a lot else on your mind) or then, with the more stable code, the fact slipped your mind.

I am not being critical – you said you were pressed for time on this project and it is a very nice piece of code. It’s actually the first time I’ve seen code that was able to relate key and cursor controlled actions to specific points in an Alice world – something both others and myself have tried without your success.

Code that doesn’t work is not worth documenting – and usually if the code works and fills enough of a need, someone will come along and complete the documentation. It has been my experience however, that the easier the latter task is, (i.e., the better internal documentation there is in the code) the better the final result turns out to be.

Ch0pStickS 03-02-2008 05:15 PM

well for the little thing about freezing the calibration point to a certain degree, i just thought that if you run alice on the same computer, the screen always loads to the same exact position and size, but that's just what ive seen through my version of alice, (windows vista). Alright so here's how i did it, and it's not really a lengthy and complicated code. It uses alot of the world functions, mouse distance from top edge, and mouse distance from left edge. I made a certain box where it wouldnt move if it was in it, because it would be annoying to have to enter the mouse exactly in the center to stop the screen from moving. So i just did If (mouse distance from ___ edge is > than the calibrate left" (which is technically the mouse distance form left edge if the mouse is in the center) minus 15) then you can move the screen. So that technically makes a box where the screen doesn't move instead of a single center point. So now that it wont move in the center, we have to make it move out of the center. To do that i just made it so that the x-axis (which is actually just a sphere that i tried to make as close to the center of the screen as possible, which is invisible) will turn left at speed = calibrate left minus mouse distance from left edge so for example, when you calibrate it, then the calibrate left is the same as the mouse distance from left edge when the mouse is in the center. So calibrate left minues mouse distance from left edge is 0 when the mouse is in the center, so it wouldnt move at all. but if it is at the edge, then calibrate left minus distance from left edge would be calibrate left.. So you would turn left at speed calibrate left. But if you turned that fast it would be crazy... so, i minimized it by. making a sensitivity variable. So that number, would be divided by 11 - sensitivty and multiplied by 400 so it would divide it by that AND 400. I found 400 with guess and check. So if you set sensitivity to 10 it would not divide it at all besides 400, and if it was 1, it would divide it by 10*400 so the greater the sensitivity the faster you would turn. Same thing with the up and down, but instead of x axis, it is the camera, instead of calibrate left, it is calibrate top, and instead of mouse distance from left edge, i made it mouse distance from top edge. I made these methods do together and also had it loop infinitely. So to sum it all up it is, turn "this speed" per second for .05 of a second.
y-axis vehicled to camera which is vehicled to x-axis.

Also, for the movement part, i just made the wasd keys made the x-axis move forward backward, left or right depending on which key you press.

For Calibrate I made it so that when enter is pressed, it changes "calibrate" to true, and when it is let go it changes "calibrate" to false, so it technically measure when enter is pressed. Then i made it so if mouse is pressed on y-axis/cursor, then if calibrate is true, it will set calibrate left to mouse distance form left edge, and set calibrate top to mouse distance from top edge.

The whole aiming part can be found in world method, Aim

Movment can be found in world events

Calibrate can be found in world events/ world method, Calibrate

if there are any further questions, let me know

Ch0pStickS 03-02-2008 05:19 PM

what do you mean by documenting code?


All times are GMT -5. The time now is 10:45 PM.

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