![]() |
Day/Night system
I'm working on a basic day night system for practice. Here is what I have so far as it is really basic. Still adapting to GS2. I was wondering if anyone could give me any suggestions and help me improve on it.
NPC Code: |
Use a timeout, and possibly timevar to gauge the time so it's around the same for everybody.
|
seteffect and changeimgvis should have parenthesis around the params. The image ID shouldn't be less than 200 if it's meant to only show on one player's screen, and the x/y coordinates are tile-based in the level, not pixel-based on the screen. In the for loop you need to set "client.time", not check it, and it won't get to 24 since your loop wants it to be less than or equal to 23. Otherwise, I agree with what Jer said.
Also, use PHP tags instead of CODE tags. It's easier to read. Here's some of what you have fixed: PHP Code:
|
Ah Thank you. Yeah the GS1 is still coming out. How exactly would the timevar work?
|
Quote:
Due to the forums protection replace [percent] in the script with an actual percent sign. PHP Code:
|
i gave it a try too, but neither the minutes, nor the hours are accurate for my timezone,(off by like 20 minutes and like 5hours), and i think atleast the minutes should be accurate, right?
|
timevar isn't meant to give your local time. It increases by 1 every 5 seconds, and I believe is based off of when Graal2001 went online.
|
I see. So I could just set the client.time variable to timevar with a mod of 24.
I'm wanting a full day to last about 3 hours in-game. Would this be the most efficient way for that? This seems like a full day would be an actual 24 hours. I was playing around a bit with it and did temp.timevar = timevar % 24; It goes up by 10 every time it's called and keeps going up. |
If you use 1 timevar tick is equal to 1 hour, an in-game day will take 2 minutes.
It would probably be better to use timevar as minutes: (replace [p] with a percent sign....) PHP Code:
|
I made a script that holds a day on graal equal to a day irl, containing the clock that riot just showed, and your effects, i now know how effects work :P
you can use it if you want, it's mostly your work anyway. I also made it run synchronised to atleast 4-5 seconds on my own time. PHP Code:
|
Nice. Here is what i'm working with so far. It's got a few errors that i'm working on atm. I'm currently tweaking trying to fix the problems. Too much nyquil in my system atm lol. Damn flu....
PHP Code:
|
All times are GMT +2. The time now is 01:23 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.