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
3,912
Reaction score
1,488
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
957
Reaction score
504
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
855
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

Working on a case. Get all the evidence to prosecute some bad guys. :kaojoy:
But, the game development schedule delayed. :kaoswt2:
The moral of the story: No good deed goes unpunished... I guess...
Except that, nothing to see here. :kaoswt2:
just beat ff7 original for the first time since 2010. having played remake last year, I have a much better appreciation for the original oddly enough. I still like some of the character presentation in remake more, but the original's got a lot going for it.
Ever reach that moment in your life when your juggling a dozen or more projects that you know will never be made but don't have the heart to delete them? Ugh, I hate those moments...
:kaosigh: Why must you hurt me so?
my main character isn't the warrior of light or the chosen one, he's a self righteous, invasive try hard who gets ahead of himself and makes a critical error, resulting in a downward moral spiral that, eventually, leads him to truths that make him a better man, and im DAMN proud of that.

Forum statistics

Threads
111,451
Messages
1,061,200
Members
144,817
Latest member
tocurse
Top