Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [Solved] Anyone can solve my dilemma?, Rmxp event
Vexus
post Jan 9 2012, 05:38 AM
Post #1


Level 19
Group Icon

Group: Revolutionary
Posts: 397
Type: Mapper
RM Skill: Intermediate




I'm making a random variable in an inn in which you get a room based on the random number between 1 to 5.

I also have a script with day/night system and I made it so you rent a room for till 8 am of the day afterwards (Which works) then when you exit the room the door locks itself automatically and you have to rent another room if you want to sleep in the inn.

Now the problem. I rent a room and go into the room, fast forward time to 8 am of the day after and when I exit the room the door gets locked alone. (So far it works) Then I go to rent another room the random variable chooses a random room which is available but for some reason it's working 50% of the times it's like the switches in the event just get totally skipped.

At first I thought it was maybe lag but there is only 1 parallel event in the room so I don't think it's lag. I also tried putting wait after every switch maybe this way they work well but nope still skips them sometimes. The way I know the event worked is that after you are given x room a switch goes on that makes the inn keeper go on event page 2 which is just random words then at 8 am it goes back to first page.

I'll upload a screenshot with my current event maybe you gets can figure it out why it's making this problem.

Clicky


The left part is the event which gets activated when I go near the reception and the right part is the parallel event. (It's page 1 and 2)

Thanks for the help maybe I can solve this problem.

This post has been edited by Vexus: Jan 9 2012, 10:22 AM


__________________________
Current Project/s:
Go to the top of the page
 
+Quote Post
   
Titanhex
post Jan 9 2012, 06:52 AM
Post #2


Guru of Water
Group Icon

Group: Revolutionary
Posts: 1,096
Type: None
RM Skill: Masterful
Rev Points: 5




I understand what you're doing, I just don't understand the way you're doing it.

Theoretically:
When you speak to the innkeeper, that's when the random 1 through 5 number should be generated. If you decide to take that room number, then you don't need a switch saying you have. 0 = No Room rented. 0 < means you rented room one through 5.

I don't know why you're doing it in a parallel process, but it looks like your parallel process has a condition that's the same as it's action.
(If Inn Time is ON is the triggering condition. The actions in that page turns Inn Time ON though. Seems redundant.)

The parallel process should check the time of day. If it's past check out time, it should only let you open that door if you're standing on the other side of the door (Example; Coord X = 12, Y = 9), which would essentially mean you're leaving the room. This keeps you from being locked inside, but still prevents you from re-entering that room.

If you have a room rented in that Inn, then the innkeeper should tell you you can't rent another room. The check is just if the room rented out is above 0.
You really don't need to make 5 switches.

This post has been edited by Titanhex: Jan 9 2012, 07:04 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Vexus
post Jan 9 2012, 07:01 AM
Post #3


Level 19
Group Icon

Group: Revolutionary
Posts: 397
Type: Mapper
RM Skill: Intermediate




When inn time is on the parallel goes to page 2 which is the pic on the far right.

Never thought on making the random variable on the inn keeper I'll try that.

Still can't understand why after the first time I get a room sometimes the switches on/off get skipped.

Thanks for the help.

The random variable I made is the npc goes to check which room is available (There will always be one) and then tells you "Room 2 is available" and so room 2 gets unlocked while the other rooms remain locked.

This post has been edited by Vexus: Jan 9 2012, 07:03 AM


__________________________
Current Project/s:
Go to the top of the page
 
+Quote Post
   
Titanhex
post Jan 9 2012, 07:08 AM
Post #4


Guru of Water
Group Icon

Group: Revolutionary
Posts: 1,096
Type: None
RM Skill: Masterful
Rev Points: 5




I suggest trying it how I suggested in my edited post. (Edited it not long ago)

You should be able to cut down your switches to just one variable.]

I'll edit my post in a sec here to show you.

Here's how I'd do the innkeeper:



Rinse and repeat for each room number. Just paste the Conditonal Branch Room # == 1. You could even make it easier on yourself by putting the dialogue as "Room \v[1] is available for the night. It's 200 zen." Then you just copy and paste and not even have to change the dialogue.

As you can see, it checks if the room # rented is 0.

If it's not, he tells you what room # you have rented.

If it is 0, he finds you a room through a random number of 1 to 5.

If you take that room, he takes your gold. If you don't take it, the # is put back at 0.

The parallel process for check out would just be
@If Hour Variable == 8
@Variables: Room # = 0

And since the door event takes you out no matter what then all you gotta do is make it so doors only let you in when you have that room # rented. (I assume you've done this already anyways)

This post has been edited by Titanhex: Jan 9 2012, 07:50 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Vexus
post Jan 9 2012, 07:15 AM
Post #5


Level 19
Group Icon

Group: Revolutionary
Posts: 397
Type: Mapper
RM Skill: Intermediate




Don't know if it means anything but the 5 rooms are separate from the actual room and you transfer into them.

Now I placed the random variable into the inn keeper event but now after the first time the random door doesn't open it's like the switches get just skipped.

Also the variable that checks the time is not exactly counting but working with the day/night script.

This post has been edited by Vexus: Jan 9 2012, 07:16 AM


__________________________
Current Project/s:
Go to the top of the page
 
+Quote Post
   
Titanhex
post Jan 9 2012, 07:30 AM
Post #6


Guru of Water
Group Icon

Group: Revolutionary
Posts: 1,096
Type: None
RM Skill: Masterful
Rev Points: 5




What I've suggested should work in my post before this. I don't see it being a problem unless you have something you didn't to mention to me that'd complicate it.

Here it is slightly improved to show you how it works:

Spoiler


This post has been edited by Titanhex: Jan 9 2012, 07:43 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Vexus
post Jan 9 2012, 07:45 AM
Post #7


Level 19
Group Icon

Group: Revolutionary
Posts: 397
Type: Mapper
RM Skill: Intermediate




I'll try it out thanks for the help.


__________________________
Current Project/s:
Go to the top of the page
 
+Quote Post
   
Titanhex
post Jan 9 2012, 07:52 AM
Post #8


Guru of Water
Group Icon

Group: Revolutionary
Posts: 1,096
Type: None
RM Skill: Masterful
Rev Points: 5




Cool. Good luck! I trust this does the job :3

Incase you were wondering the problem with your switches, it didn't look to me like they did anything. I didn't see them being used in your example besides Inn Time. That's why I suggested this revision.

This post has been edited by Titanhex: Jan 9 2012, 07:54 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Vexus
post Jan 9 2012, 08:30 AM
Post #9


Level 19
Group Icon

Group: Revolutionary
Posts: 397
Type: Mapper
RM Skill: Intermediate




The inn 1 to 5 are the switches of the doors and the switch inn is the 2nd page of the inn keeper (This was how I could know the event worked as the inn keeper asks you if everything is ok).

[Edit]

I did it sort of like yours (Added the switches for the doors and inn keeper 2nd page) and now the problem is that after I fast forward time and exit room door closes and when I try to rent a room again the npc goes to check which room is available but nothing else happens the npc just stops there and if I try to trigger the event again same thing happens.

[Edit 2]

Nvm adding erase event in the parallel that makes variable back to 0 fixed it.

Thanks a lot.

This post has been edited by Vexus: Jan 9 2012, 09:55 AM


__________________________
Current Project/s:
Go to the top of the page
 
+Quote Post
   
Titanhex
post Jan 9 2012, 09:07 PM
Post #10


Guru of Water
Group Icon

Group: Revolutionary
Posts: 1,096
Type: None
RM Skill: Masterful
Rev Points: 5




Oh yeah good point. I forgot about the seconds. But good to hear you fixed it.


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 04:57 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker