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 / day/night cycle

Author
Message
Cyril Grey
19
Years of Service
User Offline
Joined: 28th Jan 2005
Location:
Posted: 6th Jul 2005 07:52
This little snipit is a day/night cycle for 3d environments.
It currently runs a whole cycle in a 1 min time period, but you can easily change it to be 10 min, 1 hour, whatever you need. It doesn't start until the clock reaches "00" or "30", so it may take up to 29 seconds to begin the cycle, depending on you clock at startup. After that, it will run continuously

I actullay wanted to make it as a function, but I can't figure out how to get the variables to pass properly. Would someone be so kind as to convert this snipit into a function? I appreciate your help.

Happy Game Creating!!!

Cyril

With math all things are possible
Robot Booger
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location:
Posted: 6th Jul 2005 08:37
Did you try making the variables global?
Cyril Grey
19
Years of Service
User Offline
Joined: 28th Jan 2005
Location:
Posted: 6th Jul 2005 11:35
no i didn't. can you give me an example of how to make a variable global?

Thanks

Cyril

With math all things are possible
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 7th Jul 2005 13:30
global varname [= value] [as vartype]
those in brackets are optional
if you dont specify what variable type (integer, float, string, etc) the default is integer



If you want anything DB related hosted, log in (with ws ftp or something) www.lysergium.net with username public@lysergium.net and password public. you'll be directed to lysergium.net/public
Cyril Grey
19
Years of Service
User Offline
Joined: 28th Jan 2005
Location:
Posted: 9th Jul 2005 01:15
global myvar = 0.03 as float

This snipit looks like it will always pass 0.03 to the function if you had a function like:

myfunction(myvar)

But will it allow the function to pass the new value back to the main program once endfunction is arrived at?

That is, if myvar changes to 1.06 in the function, will it still be 1.06 when it cycles back throught the main program and back to the top of the function again? Or will it revert back to 0.03?

Thanks for your help

Cyril

With math all things are possible

Login to post a reply

Server time is: 2024-11-27 22:49:48
Your offset time is: 2024-11-27 22:49:48