Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Time System question(Maybe Resolved)

I'm currently making a Online RPG Game Using RPG Maker Xp!
I do want to make a Hotel...
But its something i don't know!
It's i want that when you talk to a man there you can buy a room!
Here is the question!
When you buy the room i want you that you can have it a chosen time to time!EXAMPLE: The day when you buy it to the chosen Day!
How do you do this?
Or can you actually do that?

Ufalama123

If this is in wrong forum just move it to the right!

It's maybe resolved but i cant test because i cant get a server!
 
Well, if you're looking for a day/night system, there is a script available for it (though I'm having to get it looked at right now for bugs).
However, I believe you can do this using the timer, variables, and user-input. Do you know how to work with variables?

EDIT: Okay, I worked with it a bit, and yes it can be done using switches, variabless, the timer, and common events. It'll be a bit complicated, but I can help you out.
 
I'm going to need a bit of info though. Are you planning on having your game run in real time? If not, how long are you looking to make a 'day'. Also, are you planning on charging a certain amount of gold for each day. I just need to know these things so I know how much instruction to give you.
 
PhoenixTilea":2vr83ndk said:
I'm going to need a bit of info though. Are you planning on having your game run in real time? If not, how long are you looking to make a 'day'. Also, are you planning on charging a certain amount of gold for each day. I just need to know these things so I know how much instruction to give you.
Yes i shall!
 
PhoenixTilea":167yk1sx said:
Well, if you're looking for a day/night system, there is a script available for it (though I'm having to get it looked at right now for bugs).
However, I believe you can do this using the timer, variables, and user-input. Do you know how to work with variables?
I don't know how to get it!
I need a tutorial on how to make time /day,night System!

EDIT: Okay, I worked with it a bit, and yes it can be done using switches, variabless, the timer, and common events. It'll be a bit complicated, but I can help you out.

I don't know how to get it in the game!
What i know:
How to get to the script editor

What i dont know:
Which part of the script editor!(EXAMPLE: Main, scene-map)
I don't know which of them!
 
....Okay.....
Well, you don't need a script to do this. There is a script that will change it from day to night, but that's not what you're asking about.

Okay, you need to start by creating some variables and a switch. You need to create 3 variables: one for the number os days the person wants the room, another for the number of days that have passed, and another for the amount of gold to charge the player. You'll aslo need to create a switch to turn on when the player receives the room key.

So, for example:

Variables:
001: Days
002: DaysPassed
003: Price

Switch:
001: RoomRented

All right, after you do that, you'll want to create a common event. Just go into your database and create a common event called 'Rent' or something like that. Set the trigger to none'.

On the event page, show a message reading something like "For how many days would you like the room?" and then use an "Input number.." process. Set the number of digits you want the player to be able to enter. If you don't want them renting the room for more than 9 days, just allow one digit. You also need to set the variable that this information will be stored into, which would be the variable "001: Days" from above.

Now, start the timer. Go to 'Control Timer" and set it at 0 min 0 sec to start. You'll also want to turn on the switch we set "001: RoomRented"

And, you need to give them the room key "Change Items", then set the amount of gold they have to pay. To do this, we want to control out variable "003: Price". First, set it equal to "001: Days", and then create another control to multiply it by a constant the represents the number of gold per day, maybe 100 gold or something. After that's done, create an event that will remove gold from that inventory equal to the variable 'Price'

So, you're event will look sort of like this:

Code:
@>Text: For how many days would you like to rent a room?"
@>Input Number: (001: Days) 1 digit(s)
@>Control Timer: Startup (0 min, 0 sec)
@>Control Switches: (001: RoomRented) = ON
@>Change Items: (Door Key) +1
@> Control Variables: (003) = (001)
@>Control Variables: (003) *= 100
@>Change Gold: - Variable (003)

And we'll add more to that after we create another common event.

So, do that. Create a second common event. Call it something like 'TimePassage'. This will be used to measure the number of days the player has had the room and will dispose of their room key. Set the trigger to "Parallel Process' and set the condition switch to "001: RoomRented".

Now, create a conditional branch. Set the condition that the variable "002: DaysPassed" is 'equal to' the variable "001: Days". You want the box checked that allows you to set actions for when the terms do not apply.

So, when this condition is met, you want to remove the room key from the player's inventory, stop the timer, and turn off the switch we made. This will disallow the player to get nto the room anymore.

Then, in the 'Else' section, we need to set the measure of time. We'll need to create another conditional branch. Let's say you want a day in your game to be 5 minutes in real time. Set the condition to the timer is at 5 minutes and 0 seconds or more, and this time uncheck the box to set events for when this isn't true, because we don't need it. Under this branch we want to manipulate our day counting variable "002: DaysPassed". Go to Control variables and choose 'Add' and the constant 1. Also, you'll need to stop the timer, and then create another even to restart it back at zero.

So, this even will look something like this:

Code:
@>Conditional Branch: Variable (002) == variable (002)
___@>Change Items: (Door Key) -1
___@>Control Switches: (001) = OFF
___@>Control Timer: Stop
___Else
___@>Conditional Branch: Timer 5 min, 0 sec or more
_____@>Control Variables: (002) += 1
_____@>Control Timer: Stop
_____@>Control Timer: Startup (0 min, 0 sec)
___Branch End
___@>
Branch End

All right, so now we want to go back to our other common event we created and call this one. So, add to it 'Call common event: "002:TimePassage".

So, yeah, there's a lot to it, but this should work. If you have any questions about something, just let me know! You can set the variables and swtiches to whatever name or ID you want, of course; I'm just giving examples.
 
Ufalama123":av2khjbb said:
PhoenixTilea":av2khjbb said:
Well, if you're looking for a day/night system, there is a script available for it (though I'm having to get it looked at right now for bugs).
However, I believe you can do this using the timer, variables, and user-input. Do you know how to work with variables?
I don't know how to get it!
I need a tutorial on how to make time /day,night System!

EDIT: Okay, I worked with it a bit, and yes it can be done using switches, variabless, the timer, and common events. It'll be a bit complicated, but I can help you out.

I don't know how to get it in the game!
What i know:
How to get to the script editor

What i dont know:
Which part of the script editor!(EXAMPLE: Main, scene-map)
I don't know which of them!

I hope it work!
I can't test it!
I need a server first!
But its't 100% my computer and i haven't allowed
But if i get i will try if it works!

But anyway thanks!
 
Oh, and another note, when you go to turn off your switch, make sure it's the last thing you do in that section, because once you turn it off, it will shut off that common event, and the other things that need to get done won't. I didn't think about it when I wrote up the code.

I also made a mistake when I said you had to call that second common event. It's a parallel process, so it'll run automatically. You don't have to call it. I typed that up at like... 3 in the morning. ^_^
 
Ufalama123":13cna0t4 said:
Ufalama123":13cna0t4 said:
PhoenixTilea":13cna0t4 said:
Well, if you're looking for a day/night system, there is a script available for it (though I'm having to get it looked at right now for bugs).
However, I believe you can do this using the timer, variables, and user-input. Do you know how to work with variables?
I don't know how to get it!
I need a tutorial on how to make time /day,night System!

EDIT: Okay, I worked with it a bit, and yes it can be done using switches, variabless, the timer, and common events. It'll be a bit complicated, but I can help you out.

I don't know how to get it in the game!
What i know:
How to get to the script editor

What i dont know:
Which part of the script editor!(EXAMPLE: Main, scene-map)
I don't know which of them!

I hope it work!
I can't test it!
I need a server first!
But its't 100% my computer and i haven't allowed
But if i get i will try if it works!

But anyway thanks!
Ehhh I did quote wrong!
Whatever
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top