gonna wait for a hotfix then i guess
Doing some deep dive bugtesting that "until" loop doesn't seem to work in the way you'd think it would. Like Eccma isn't wrong in how he THOUGHT it would work, but it definitely doesn't work that way. You would think "until we run out of babies or milk is below 150" would cause the loop to HALT once milk got below 150, but it doesn't. Even with TWENTY BABIES and manually lactation level of 10 they will desperately suck every last drop of milk they can get from her barren breasts and will not run away.
My best guess here would be the "until" is just a modified while loop checking if it's TRUE instead of the programming norm of invalid; null; or FALSE, but since one of the variables is "no more babies" then it will always execute exactly the number of times we have babies regardless. So basically to fix this statement you remove the nested lactation_level check so children can actually run away from their barren mother:
until babies.empty? || $game_player.actor.lactation_level < 150
currentFeeding=babies.shift
currentFeeding.addData["MouthStats"] ? tarRace = currentFeeding.addData["MouthStats"] : tarRace = "Human"
$game_player.actor.stat["EventMouthRace"] = tarRace
overEVloadRB("Data/HCGframes/OverEvent_MilkFeeding.rb",parallel)
end
Goes to:
until babies.empty?
if $game_player.actor.lactation_level >= 150
currentFeeding=babies.shift
currentFeeding.addData["MouthStats"] ? tarRace = currentFeeding.addData["MouthStats"] : tarRace = "Human"
$game_player.actor.stat["EventMouthRace"] = tarRace
overEVloadRB("Data/HCGframes/OverEvent_MilkFeeding.rb",parallel)
end
end
If there is a "break" command in RPGMAKER then he could use that instead of a second conditional for optimization, but they already got weird shit like "until" instead of just "while" so I don't trust it existing.
As for the one triggering the "I never have milk!" While she's busy using her surplus to make cheese...
Well that one is pretty easy to fix assuming I understand what Eccma was trying to do...
We take:
temp_play_lost_child_dialog = 1
temp_play_humchild_dialog = 0
until babies.empty?
currentFeeding=babies.shift
p currentFeeding
if !currentFeeding.addData["LonaHumChild"]
$game_party.lose_item(currentFeeding,1)
overEVcall_msg("commonH:Lona/FeedingChild_MilkNotEnough",parallel) if temp_play_lost_child_dialog ==1
temp_play_lost_child_dialog = 0
else
temp_play_humchild_dialog = 1
end
end
if temp_play_humchild_dialog
overEVcall_msg("common:Lona/Milk_feed_notEnough",parallel)
overEVcall_msg("common:Lona/preg_miscarriage_end1",parallel)
end
and replace the "temp_play_humchild_dialog = 0" to instead be "temp_play_humchild_dialog = 1" and in the else statement we swap it to setting it to 0 instead of setting it to 1.
This means she will say her milk isn't enough if one of her children DOES leave. Leading into a very sad moment of the game telling you the child ran away because you have no milk and then her harsh realization "I don't have enough Q.Q" and finally "I'm a terrible mother".
So in testing I found that there is ALSO 2 bugs in this script, which I assumed RPGMAKER just works that way, but no they were really dumb bugs....
Brownie points if you can spot both of the bugs I fixed... This event now works I BELIEVE as intended... I also condensed the two while loops into one, because that's the first thing my optimization brain spots as bad optimization.
until babies.empty?
currentFeeding=babies.shift
if $game_player.actor.lactation_level >= 150
currentFeeding.addData["MouthStats"] ? tarRace = currentFeeding.addData["MouthStats"] : tarRace = "Human"
$game_player.actor.stat["EventMouthRace"] = tarRace
overEVloadRB("Data/HCGframes/OverEvent_MilkFeeding.rb",parallel)
else
$game_party.lose_item(currentFeeding,1)
if temp_play_lost_child_dialog == 1
overEVcall_msg("commonH:Lona/FeedingChild_MilkNotEnough",parallel)
temp_play_lost_child_dialog = 0
temp_play_humchild_dialog = 1
end
end
end
check_over_event
#p babies
#temp_play_lost_child_dialog = 1
#temp_play_humchild_dialog = 1
#until babies.empty?
# currentFeeding=babies.shift
# p currentFeeding
# if !currentFeeding.addData["LonaHumChild"]
# $game_party.lose_item(currentFeeding,1)
# overEVcall_msg("commonH:Lona/FeedingChild_MilkNotEnough",parallel) if temp_play_lost_child_dialog ==1
# temp_play_lost_child_dialog = 0
# else
# temp_play_humchild_dialog = 0
# end
#end
if temp_play_humchild_dialog == 1
overEVcall_msg("common:Lona/Milk_feed_notEnough",parallel)
overEVcall_msg("common:Lona/preg_miscarriage_end1",parallel)
end
You can install the bugfix for yourself with the attached file by extracting and overwriting LonaRPG\Data\Scripts\Editables\40_OverEvent_Check.rb