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.

Author
Message
Murdock 743
20
Years of Service
User Offline
Joined: 16th Jun 2004
Location:
Posted: 15th Jun 2005 05:49
I made this for a throttle (just vars right now...) but I cant seem to stop the numbers from passing 100 or going no lower than 20.

Thanks,
Christian
PS we will see if my snipplet worked or if I did this wrong..
Murdock 743
20
Years of Service
User Offline
Joined: 16th Jun 2004
Location:
Posted: 15th Jun 2005 05:50
nope didn't work its in the source oh well...
Cheers,
Christian
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Jun 2005 06:03
Have you tried something like this?



Murdock 743
20
Years of Service
User Offline
Joined: 16th Jun 2004
Location:
Posted: 15th Jun 2005 06:14
no I was attempting to use subrotines that would allow the user to know when he hit max throttle/ speed or min throttle/ speed and limit the speed... however I can figure that much out thank you now I have a limited throttle!!!
Cheers,
Christian
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 15th Jun 2005 06:47
Murdock 743,

To edit the good method that Lost in Thought has shown you, and make it better. Try this:



Speed has to be less than 100 for it to increase. Therefore, it will not increase when it is equal to 100. So, your limit set for speed is 100. Same goes for the value of 20, that the lowest number speed can be is 21, to be enabled to decrease by 1. So, if speed is equal to 20, it will not decrease. The above method saves you a couple of uneccessary extra lines of code.


+NanoBrain+
Murdock 743
20
Years of Service
User Offline
Joined: 16th Jun 2004
Location:
Posted: 15th Jun 2005 06:52
Thank you
Christian

Login to post a reply

Server time is: 2024-09-23 21:21:00
Your offset time is: 2024-09-23 21:21:00