Joined
Apr 8, 2021
Messages
2
Reaction score
1
First Language
English
Primarily Uses
RMMV
I'm making a horse breeding mini game and came across a bug I have no idea how to fix.
The player gets to choose one of two horses - a male or a female - and can put it into one of two stable stalls - stall 1 or stall 2. A number gets assigned to the variable Stable x Horse Type. So if the male horse gets put into stable one, then the Stable 1 Horse Type = 1. If the female horse gets put into stable one the variable would be Stable 1 Horse Type = 2. If the male gets put into Stable 2 then the variable would be Stable 2 Horse Type = 1 (and the female would be =2).

So that all works great.

My issue is that I have a page (page 4 on both events) where if the player tries to breed the horse with itself, a message pops up saying "You cannot breed a horse with itself. Please choose a different horse." And it works fine if the player selects the male horse first to start breeding, but doesn't work if the player selects the female horse first to start breeding.
I have two switches - Horse Breeding M Start and Horse Breeding F Start. I even tried putting the female horse in the first stall (she was originally in the second stall) and it still didn't work. So I have no idea what's going on.

So here are my event pages for the first stall:

stall1-eventpg-1.jpgstall1-eventpg-2.jpgstall1-eventpg-3.jpgstall1-eventpg-4.jpgstall1-eventpg-5.jpgstall1-eventpg-6.jpgstall1-eventpg-7.jpg

And here are my event pages for Stall 2:

stall2-eventpg-1.jpgstall2-eventpg-2.jpgstall2-eventpg-3.jpgstall2-eventpg-4.jpgstall2-eventpg-5.jpgstall2-eventpg-6.jpgstall2-eventpg-7.jpg

If anyone can help me figure out why my Horse Breeding F First switch isn't working, I would really appreciate it. Thank you!
 

Attachments

  • stall2-eventpg-1.jpg
    stall2-eventpg-1.jpg
    1.1 MB · Views: 6

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,000
Reaction score
1,520
First Language
Dutch
Primarily Uses
RMMV
page 2 and 3 are incompleet event that you show, 4 and 5 might be better
in an else brance.

not sure why you check stall 1 and stall 2 as if condition if not
on the condition page itself, which is probably better to check stall 1
if it's female or male, same with stall 2, but I dont know the exact reason
or how it should run ingame for this event. (I might miss understood it).
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,118
Reaction score
611
First Language
English
Primarily Uses
RMMV
You have to be very careful trying to use multiple event pages as if/else conditions...they're not designed to work that way, and it's easy to get something mixed up like you did here.

It would be more elegant to outsource this entire process to a common event or write a function for it that you stick in a plugin.

However.

The reason you're failing is because of page 6. That has the conditions of First Breeding Thingy is Female, and horse type is >= 1. That will check as true and execute, so the game won't keep looking down to page 5, with First Breeding Thingy Female and horse type is >= 2.

If you swap those pages, it ought to work.
 

CleanWater

Independent Developer
Veteran
Joined
Apr 8, 2017
Messages
707
Reaction score
858
First Language
PT-BR
Primarily Uses
RMMV
The programming logic for this could be:

If (variable horse == variable horse){
You can't breed your horse with itself, choose another one
}
else{
Do your things here
}

You may use a conditional branch for this. :wink:
 
Joined
Apr 8, 2021
Messages
2
Reaction score
1
First Language
English
Primarily Uses
RMMV
Thank you everyone for your replies!! I really appreciate it! This is my first time trying to figure out how to do something that I didn't have a tutorial for. I basically adapted a farming system tutorial to try to create the breeding thing, but obviously I have a lot more fine-tuning to do.
I really appreciate everyone taking their time to help me out. Thank you!
 

Latest Threads

Latest Posts

Latest Profile Posts

I am SO HYPED to share this trailer with everyone when its done. I almost want to tear up i had no idea how far i came along with Fallen Feather in these last 3 years.
how it looks from the top
Hike was successful guys! I made it to the top!
Add Film-like Visual Effects During Test-Play, Deploy Games with Electron | RPG Maker News #69

brain broken as soon as i figure out whats wrong with my game im taking a long nap

Forum statistics

Threads
112,185
Messages
1,066,444
Members
145,784
Latest member
lafa
Top