RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Night And Day System (RM2K)

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 86
Hello, allow me to introduce myself. I am Dalkin, and this is my first post. I have been useing RM2K for... A very, very long time but I had never serously sat down to make a whole game. I started an ambitious project about a month ago and will take me quite some time to make... I don't really think I'll ever be posting it here because it is very large as it is. Its over 100 megabytes big right now simply because the sound track uses WAV files that I recorded from other sources... Games like soul calibur 2, Final Fantasy 12 and plenty of world of warcraft. So that means distributing it over the net is quite out of the question.

Now, for a long time I have been trying to figure out a good RPG formula. I thought that "legend of zelda" style dungeons with elaborate puzzles was the only way to go, but then I started playing alot of RPGs and found that almost all dungeons were linier, so... what compelled me to play an RPG anyway? Layers and layers of depth.

So, in addition to the main quest, I am adding quite a few features, but my development on the game has stopped for quite a while... It seems Im hung up on one detail that I can't figure out. That is the night and day system. Im done the first section of the game, but I am afraid to progress further because the night and day system will affect everything else in my game.

Im sorry if this is a little tedious but I'll post the entire event in detail here. First of all, I don't want the night and day system to become active until the player reaches a certain point in the game, very early on. In order to activate it the hero must step on the event. So... I'm going to detail my work so far on this night and day system:

Page 1:
Switch: Check The Archives
(note, this is a switch event that progresses the story. Right now I have a small town with a nothern path and an eastern path. The eastern path is accassable from the start of the game, but not passable until you can rapple down the cliff formations. I did not want the player to trigger the night and day system until they need to check the archives in the games largest city. Hope that makes sence.)

Hero: Kael Need
(Note: just some extra insurance. Kael is the main character... actually now I dont know why i have this in here.)

Event Commands:
Change Switch: Star the clock!
(This activates the 24 clock.)

Idealy, I would like the 24 hour clock to run all the time, except for when the player is inside a house or a dungeon. Also, I don't want the interriors of these kinds of places to become darkend. The problem is, I don't really want to make a tonn of pages and switches for every single house in the game to ensure that its always bright inside. So I need a solution to that. Secondly, I already have a very tiny mini dungeon in my game... And in order to create a fog effect, I adjusted the screen tones in it to give it a smoky look. The problem is, the 24 hour clock will also use screen tones. Amd I am worried about how the 24 hour clock would overlap with my dungeon fog screentone. Idealy, I'd love to hop into the dungeon... while it is night time in the game world... Stop the 24 hour clock and explore the dungeon while it is foggy, then hop back out and have it still be exactly where the player left off. For this I have no idea what to do.

So, anyway heres my working clock:
(now remeber the page above prevents the clock from starting before I want it to start. So once the hero steps on that part, it switches into page 2)

Page 2: KEEP IN MIND THIS IS FOR NOON. This is very important.
Switch: Start the clock!

Command List:
Timer Operation: Create 0m50s
(Note: while this feature is incompleate, I decided to test it useing a 50 second clock. Once it is done, I'll use a 24 minute timer)
Timer Operation: Starttmr
Fork Optn Timer: 0m.00sless
Set Screen Tone: (R100G100B100S100), 0.5sec
(Note: this particular page is also for Noon.)
<>
Else Case
<>
End Case
Change Switch: (24 hour clock: dusk)-on set
Change Switch: (Start the clock!)-Off Set

Page 3:
Switch: 24 hour clock: dusk
Fork Optn Timer: 0m40s.less
Set Screen tone:(R080,G080,B080,S080),0.5 sec
Change Switch: (24 hour clock: night) On set

so anyway, every page is pretty identicle to that. Noon successfully turns to dusk. dusk turns to night... Night turns into
dawn, dawn turns to morning and morning... Well morning is a different story. Heres the page.

Switch: 24 hour clock: morn
Fork Optn Timer: 0m,10s.less
(Note: the time of day changes every 10 seconds fyi)
change switch: (star the clock!)-on set

Now...
Im sure what I've done wrong is blatently obvious to some of you, but I can't figure it out. In a perfect world, Once the timer reaches 0, then the event entitled "Start the clock!" would trigger to turn the second page back on (which is why I turned it the switch off once it moves to dusk) which would restart the clock as it hit zero thus enabeling this event to continue to cycle in a loop forever.

Then... I still got to turn it off when I go into dungeons, I belive I can stop the timer for those, but I am not sure.
Any ideas?




****
GG FUCKING FAGGOT
Rep:
Level 88
Lulz.
what you can do is,instead of using a timer,use a 1 sec wait and variable + 1.
so once you stop the ''timer''(switch operation = OFF) you can turn it back on to its exact momment.
example.

let's say your day last 1 min and your night as well. after 20 secs,(variable + 20)it'll stop. BUT your variable will still stay +20. so when you get out,simply turn on the switch and it'll continue. so everytime you go inside a dungeon or a house,just turn the switch OFF and ajust the tint. that's all =D

i rather using variables and wait command(in paralell process) instead of a timer. i find that easier when it comes to situations like yours.

hope I helped you out  :-\

**
Rep: +0/-0Level 86
I think I see what your saying... The problem is, the varibale command is one I have never worked with because I have no idea what it does.

I was planning on learning it, because it seemed to me that its used for random events... And I wanted a few of those...

The one thing I don't understand is you said to use a variable instead of a timer, then said to stop the timer... Any possiblilty you could explain it a little clearer to me? I'll try and see what I can do in the meantime...

**
Rep: +0/-0Level 86
Oh also...

The reason for the 24 hour clock is that so many events can take place during certain times of the day...

Is this possible?

...oh, having no luck with variables... Sorry, more help required.  :(

****
GG FUCKING FAGGOT
Rep:
Level 88
Lulz.
add me on msn(look at my profile) else. look

Parallel process means: the code is gonna repeat itself.
lets say again you have 1 min for the day, 1 min for the night.

the code will be:

Wait 10 tenth of a sec(means a sec)
variable[X] + 1
Cond Branch [X] = 60 then
tint screen and other switches.
the the way it'll work is like this:

wait 1 sec
var + 1
wait 1 sec
var +1(2)
wait 1 sec
var + 1(3)

it forces the variable to +1 every second,because the conditional branch blocks it.

****
Bitch
Rep:
Level 87
Bits'n'Pixels
I don't really think I'll ever be posting it here because it is very large as it is. Its over 100 megabytes big right now simply because the sound track uses WAV files that I recorded from other sources... Games like soul calibur 2, Final Fantasy 12 and plenty of world of warcraft. So that means distributing it over the net is quite out of the question.

Seriously?  That's a crap reason to not post it.  i use sendspace, they can take up to 300megs per file, and if you .rar the game it's size will drop a lot at that size.  If nothin' else, you could even post screenies/videos/info about it, because if it's got that much in it, and you've made better than rtp music with other games then it's gotta be worth seein'.  No excuses, mine's is up, everyone else's is too; get yours up nao!

**
Rep: +0/-0Level 86
I'll be posting something when its ready to be posted. I was thinking of makeing a special edition with the epic music and a distribution version with the midi music in it.

*
A Random Custom Title
Rep:
Level 96
wah
tl;dr. Please add pictures. Or at least use code boxes. I haven't really look at this because this looks horrible in terms of what a good tutorial would be. It's like making a sentence without grammar or punctuation or an essay without indentation for paragraphs :P

**
Rep: +0/-0Level 86
Ok so.. heres the code I have so far.

its like 50% right now. The only thing wrong with it is that when I go into houses, I can't figure out how to keep the clock running but tint the screen at 100,100,100,100 so that its not night or day in the house as well.

Actually, now I don't know why I have all those variables in there... Guess I got to re-read HolyQ's post. This guy is great.

**
Rep: +0/-0Level 86
oh yeah...

The weird messages I put in there was just to make sure i know it was working. Also Im going to upgrade my game to the RM3K engine...Can I just copy and paste?

Oh anyway, when I relized I wasn't even following holyQ's insturctions I tryed to do it exactly, but im not sure where I went wrong, so Ima gonna post my new code too. Which doesn't seem to work, obviously my error and lack of understanding when it comes to variables.

****
GG FUCKING FAGGOT
Rep:
Level 88
Lulz.
the code is good,but each part of the code has to be in a different page. else the switches are useless.

and anyway, the code has to be in ''common event'' so it runs all the time. you can find ''common event'' in the database.

thx for the greatness compliment =P

******
Rep:
Level 89
Let's attack agressively.
The weird messages I put in there was just to make sure i know it was working. Also Im going to upgrade my game to the RM3K engine...Can I just copy and paste?

Yes, actually you can use it normally with RM2K3, the only thing that will change is the battle system.

Like HolyQ said, is better having it as a common event rather than a event on the map...