ID:150753
Aug 1 2001, 7:13 pm
|
|
okay..i seen on a few game where it turns night time. my question, how do you do it? thanks to any one who helps.
|
Aug 1 2001, 8:00 pm
|
|
first off, how big are your maps? night and day consumes the cpu, and if you have a big map, its a no can do.
|
In response to FIREking
|
|
On 8/1/01 11:00 pm FIREking wrote:
first off, how big are your maps? night and day consumes the cpu, and if you have a big map, its a no can do. they are fairly small maps. |
In response to XgavinX
|
|
ok, this is how it can be done.
make this turf, and make it have a checkerboard type of black dots, one icon state will be on, which contains the dots, and one icon state will be off, which is just a masked icon picture turf nighttime icon = 'night.dmi' icon_state = "off" layer = 5 var night = 0 New() spawn while(1) sleep(3000) nighttime() return ..() proc nighttime() if(night == 0) icon_state = "on" night = 1 return 0 if(night == 1) icon_state = "off" night = 0 now, that is kind of sloppy, but mess wit it a bit and see what you get. all you have to do is draw that turf onto the entire map. its layer 5 so it shouldnt replace any other turfs. |
On 8/1/01 10:13 pm XgavinX wrote:
okay..i seen on a few game where it turns night time. my question, how do you do it? thanks to any one who helps. world New() ..() for(var/area/outside/O in world) spawn() O.daycycle() // kick off the daycycle when the world is made area outside // lay this area on the map anywhere you want it to change from night to day proc daycycle() luminosity = (luminosity + 1) & 1 // toggle luminosity between 1 and 0 spawn(10) daycycle() // change the timing by chaning the number in the spawn Use on any sized map you like, no lag, and luminosity effects like torches will work properly. You do have to understand luminosity for this method to be effective. |
In response to Shadowdarke
|
|
On 8/2/01 5:33 am Shadowdarke wrote:
luminosity = (luminosity + 1) & 1 // toggle Not that it makes any difference at all, but I like to use: luminosity = 1 - luminosity for toggles. I just find it easier to read. |
In response to FIREking
|
|
On 8/1/01 11:00 pm FIREking wrote:
first off, how big are your maps? night and day consumes the cpu, and if you have a big map, its a no can do. Once again, your answers are misleading. It's not "night and day" that consumes CPU, it's creating large numbers of images or objects that does it. So it's only a "no can do" if you do it with icon arithmetic, masking images, or anything like that... I do it the simple way. Just set the luminosity of the main outside area to 0 for night and 1 for day. No, it doesn't look as "cool" as making all the icons dim or anything like that... but if the point is to be functional rather than cool, well. |
In response to Skysaw
|
|
On 8/2/01 6:01 am Skysaw wrote:
On 8/2/01 5:33 am Shadowdarke wrote: Hehee, I knew I was overcomplicating that. Too much Shapeshifter is rotting my brain :P |
In response to Shadowdarke
|
|
thanks i really apprecitate it. i'll put you on my credits, and your name is in my source code as well(incase i ever release my MUD as open source)
|