![]() |
Day/Night
1 Attachment(s)
HI! I made a Day/night event that works fine for me but could someone please tell me how to halt it happening inside, But i still want it to be night if it was night when you entered, day if it was day when you entered etc. I attached a shot of the common event incase it helps. Yeah I did go back to using rm2k tho i still dont have a game in mind I have a few ideas.
|
First thing's first - insert another Fork as the first line, with a switch being the condition (xxxx:TimeInEffect). Now, you'll need to move all of the other forks into that first fork statement. The best way to do that is to select the first statement you need to copy, hold shift, and then click the last line to copy (while still holding shift, obviously). That'll select everything so you can right-click + cut, then paste the lines into the fort statement.
On any "Outside" to "Inside" teleportation events, disable the xxxx:TimeInEffect switch. In any "Inside" to "Outside" events, enable that switch. Any event where you stay inside or outside, you won't need to add anything. The screen will still be whatever color you have it set at, it'll still be "morning", etc - it'll just stop time from moving.
|
I think you have to wait a little while before it shows up. Takes a minute or two with me. I dont really understand your post so... Please could you wait a little while to see if it works? Thanks.
|
1 Attachment(s)
Basically, if you want time to stop, disable the "TimeInEffect" switch. If you want time to go, enable "TimeInEffect".
The structure is something like it is below, with your forks instead of the comments.. |
Ok I get that but my system has waits in it not timers, does that matter?
|
Try this..
CODE HAS CHANGED AFTER A QUICK RUN-THROUGH IN MY HEAD.
After reviewing the code, I wonder if the "waits" will simply advance one time period and THEN stop. Not what you want. It might be best to do something like this: (Pseudocode time!) <>Branch: TimeInEffect is ON ...<>Add 1 to "0024:Hour" variable ...<>Branch: Hour = 6 ......<>Branch: Hour = 11 .........<>Branch: Hour = 15 ............<>Branch: Hour = 20 ...............<>Branch: Hour = 24 ..................<>Set Hour to 0 ..................<> ...............:End ...............<>Set screen as Night ...............<> ............:End ............<>Set screen as Afternoon ............<> .........:End .........<>Set screen as Mid-Day .........<> ......:End ......<>Set screen as Morning ......<> ...:End ...<>Wait x seconds ...<> :End It's color-coded so you can see where the branches are nested. Change the hours to whatever you feel are appropriate. This one's based on a 24-hour model I once used... the bonus is, you can have events that are based on the hours of the day! So you can have, say, a door to a shop that's disabled when Hour > 18 (6pm) or Hour < 6 (6am) or something. And, of course, a "watch" item might come in handy to tell the time. You'll just use it to call a common event, that only consists of this line: <>Message: "The time is \v[24] o'clock." Change the 24 to whatever your "Hour" variable number is.. if it's [0001:Hour] then you'd change it to 1, for example. |
Ok Thanks!
|
I have go tthe time thing to work and all but what about houses? If I enter one at night it still is night indoors and if i set screen tone upon entering the house then if i leave its still day. (Entered at night screen changed to day left it was 21 hours and daytime) help please!
|
You don't want the inside of houses to be dark as well? Okay then..
Change the parts where you set the screen tone to setting a "xxxx:TimeOfDay" variable (set it to 1 for morning, 2 for mid-day, 3 for afternoon, 4 for night) (Changes are in red) <>Branch: TimeInEffect is ON ...<>Add 1 to "0024:Hour" variable ...<>Branch: Hour = 6 ......<>Branch: Hour = 11 .........<>Branch: Hour = 15 ............<>Branch: Hour = 20 ...............<>Branch: Hour = 24 ..................<>Set Hour to 0 ..................<> ...............:End ...............<>Set TimeOfDay = 4 ...............<> ............:End ............<>Set TimeOfDay = 3 ............<> .........:End .........<>Set TimeOfDay = 2 .........<> ......:End ......<>Set TimeOfDay = 1 ......<> ...:End ...<>Branch: TimeOfDay = 1 ......<>Set screen to morning ......<> ....:End ...<>Branch: TimeOfDay = 2 ......<>Set screen to mid-day ......<> ....:End ...<>Branch: TimeOfDay = 3 ......<>Set screen to afternoon ......<> ....:End ...<>Branch: TimeOfDay = 4 ......<>Set screen to night ......<> ....:End ...<>Wait x seconds ...<> :End -------------------- The logic is this: Check if time is active ...Add 1 to hour ...Check if new hour changes the time of day - if so, set the TimeOfDay variable ...Set screen to whatever time of day it is ...Wait x seconds for hour to pass ----------------- Reactivating time will automatically set the screen to whatever time of day it is, after incrementing it one hour. Thus, a house effect is this: ------------------ (timer common event) -> Hour is 23, TimeOfDay = 4 (timer common event) -> Set screen to night (even if it's already night) (timer common event) -> Wait x seconds for hour to finish Deactivate time Teleport inside house (timer common event) -> Hour wait finishes, waiting to reactivate time for next hour In house, do whatever Telport outside Activate time (timer common event) -> Hour increases, 24 (timer common event) -> Hour set to 0 (timer common event) -> Screen change to night (timer common event) -> Wait x seconds for next hour -------------------- Basically, going inside and spending more than an hour inside, will make you "lose" an hour when going outside. (If it's 4, and you spend 5 hours in there, the time when you leave will be 5, not 9 - since time's stopped based on the logic above.) However, the TimeOfDay will automatically reset the screen color when time is reactivated, if you spend more than an "hour" there. It actually resets the screen color every hour, even if the screen is correct, but you won't see the effect transitioning from dark to dark since they're the same color. If you want, I can give you the code for having the time be constantly going and only changing the screen: 1) Every hour 2) On a direct command to update the screen If you want THAT, that's no problem. |
I tried that system and got it looking EXACTLY alike to your version. It doesnt frigging work! :mad: The first change worked but that was about it. The screen tone never changed again after the first and stayed the same even when the switch was turned off when entering a house. It got me really peed having to try and get it working for about 2 hours.
|
2 Attachment(s)
I wasn't in a programmin' mood at that point. I made some HUGE logical errors there.. Sorry about that, 'twas one of those days. Today, after going through the code I gave you, I'm completely embarrassed about the stupidity of that code. Why I thought nesting was a good idea when it's dependant on being equal to something is beyond me. You can probably see the flaw right away when it's simplified..
Code:
if x = 4 then Oh well. Going to dig up my old day/night routine, screenshot it, and attach it. ------------------------ Okay then, After a bit of thinking I've dug up my old day/night routine. 3 parts to it originally, but a quick test shows that a 4th routine might be useful. These have already been tested, at least on RM2k3.. still, I think the 4th addition might be rather useful to you. Saves a bit of time coding, at least. (Let's try.. this. These are the two "Call" events. Simply call them when appropriate. You want to call the "HouseTime" one when you are going into a house, and the "RestartTime" one when you leave. For some reason they're not attaching the right way.) http://zelaron.com/forum/attachment....achmentid=1903 http://zelaron.com/forum/attachment....achmentid=1904 |
Ok I have the first two common events Day.night and Update time but In the screenshots there are 3 and whats this of a house event? I tried all four things (Two attachments worked fine but two links didnt) and I think im missing some.
|
2 Attachment(s)
Yep. Those other 2 didn't attach. (Worked for me before, but it was probably cached.)
Going to attempt attaching them again. |
Ok thanks. It works fine now woohoo! Thanks again.
|
Whew, you're welcome. I should've done that in the first place...
|
All times are GMT -6. The time now is 04:37 PM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.