Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Need help on a function.Keep getting a syntax error.

Author
Message
AJ Schaeffer
15
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 3rd Aug 2010 22:05




Im new to functions and im not sure why it highlights the line that says "Function ControlCamera...." and in the error log thing it says syntax error.

Attachments

Login to view attachments
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 3rd Aug 2010 22:30
I think it doesn't like you placing that function inside of a loop. Functions are supposed to be placed at the end of the code, and called from other locations, like this:



AJ Schaeffer
15
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 3rd Aug 2010 22:39
I dont want to sound like a slacker or anything but how would i make it have boundaries (make the camera not be able to do a full 360 when looking up or down)?

@BMacZero thanks for the help so fast
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 3rd Aug 2010 23:05
No problem. For your second question: you just need to check if the angle the user is trying to move the camera to is outside of the range you want it to go to. You could replace this line:


With something like this:


AJ Schaeffer
15
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 3rd Aug 2010 23:34
@BMacZero thanks but the camera doesnt move up or down at all. What i meant was to keep it from looking too far down

like in the picture attached, the player can only look that far up, and that far down.

Attachments

Login to view attachments
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 3rd Aug 2010 23:49
Ah, I forgot to factor in the fact the MOUSEMOVEY clears its value when you read it once...I'll just write it in your code so I can make sure I do it right



If you have any questions about it, please ask .

AJ Schaeffer
15
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 4th Aug 2010 00:01
OMG thank you SOOOOOOOOOOOO much you have given me hope to finish my game!
Eminent
14
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 4th Aug 2010 02:38
Name it Attack of the Cylinders .
AJ Schaeffer
15
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 4th Aug 2010 02:43
lol look at my other help question please

Login to post a reply

Server time is: 2024-11-23 10:56:09
Your offset time is: 2024-11-23 10:56:09