Mattsuharu

Regular
Regular
Joined
Apr 15, 2022
Messages
174
Reaction score
47
First Language
English
Primarily Uses
RMVXA
Sorry, I know I made a post above, but this is a different question:
As I said in the post above, I'm using a card game script

When I create a card with a <card_impact:> and that same card has a "follow-up" skill with yanfly follow-up scirpt, it will add the <card_impact:> of that skill to the current card impact.

This is the regular window for the first card impact:

1686404287357.png

But then, after 1 second before I can even pick the card/s for the current impact, the next skill of the follow up will add the cards of the next impact.
1686404471902.png

Sorry, I'm not that good to explain myself correctly. The example here is the next:

Skill ID 158 has a <card_impact: xxx> that will pick 3 cards from my extra deck, and send them to the gy. After that, I want it to make a follow-up to skill 159. Which have a <card_impact: yyy> that see the 3 cards of the top of my deck, pick one, and add it to the hand.

The problem is that before I can pick the 3 cards from my extra deck, the 3 cards of the top of my deck will appear in the choice windows, and now the game is asking me to pick what card I want to add to my hand, and that include the cards of my extra deck of the first impact. Making it a completely mess.

The problem seems to be that the Follow-up Skill script doesn't wait for other choice windows and/or skills to resolve before applying itself. Is there some way to add a "wait" method to the follow-up script to check if a choice window is on screen?

Thanks again in advance, and sorry if I'm not good to explain myself!
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,312
Reaction score
11,490
First Language
German
Primarily Uses
RMMV
Most likely the mechanics work similarly to skills with attached common events, which means that the menu is handled independently of the skill but after the skill.
And the follow-up script works by adding actions after the skill itself, ignoring the attached effect.

If that is the case you'll probably need a follow-up modification to the card script and completely ditch the yanfly script - such a modification should be easier than a compatibility patch between the two if the timing of the effects really wroks the way I assume.
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,504
First Language
English
Primarily Uses
RMVXA
Can you throw a sample project our way to work with?
 

Mattsuharu

Regular
Regular
Joined
Apr 15, 2022
Messages
174
Reaction score
47
First Language
English
Primarily Uses
RMVXA
Can you throw a sample project our way to work with?
Yes, I actually can give you my entire project if you want to check it out. (Sorry, its a mess of scripts.)



But if you want a simplified project with just the 2 scripts I could do it.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,763
Reaction score
892
First Language
English
Primarily Uses
RMXP
That would be an awesome idea, @Mattsuharu because the current file is a rather large one indeed.
 

Mattsuharu

Regular
Regular
Joined
Apr 15, 2022
Messages
174
Reaction score
47
First Language
English
Primarily Uses
RMVXA
Okey doki! Here it is. It's a very short sample, with the most indispensable scripts on it. There's a chest and a battle test. First you have to open the chest to add a cards to the extra deck (sorry, I couldn't do it by default because I didn't make a "starter extra deck" command in the card game script).
Once the cards are in the extra deck, you can start the battle with the skeleton. Then you should try the card Pot of Prosperity. You will see first it will ask you to remove 3 or 6 cards from the extra deck. Pick whichever you want. Then, you will see that when you have to pick which card to remove, it will add the 3 (or 6) cards of the top of your deck to that choice window before you could even pick the cards to remove from the extra deck. And if you pick a card from the extra deck, it will add it to your hand, which shouldn't be the case.

 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,504
First Language
English
Primarily Uses
RMVXA
The problem is that before I can pick the 3 cards from my extra deck, the 3 cards of the top of my deck will appear in the choice windows, and now the game is asking me to pick what card I want to add to my hand, and that include the cards of my extra deck of the first impact. Making it a completely mess.
Not entirely sure which way this is to go.
Does the Extra Desk Monster suppose to be in the list that you can pick or is just the Dark Crusader in the second image suppose to be part of only three to show up?

I played with the yanfly follow up skills script and found and interesting variable, but it will have to be defined better to make the script function normally + compatible with the card game.
Yanfly follow up skill line 253, change the 1 to 0.
It works if you select the 6 card option but gets into a loop for the 3 card option.

Not the solution, but interesting.

It's like the extra deck is getting added and not removed of before the list is displayed.

This works.
Add a note tag to the cards to not show up. <exclude from extra>
Add this below the card scripts
Ruby:
class RPG::UsableItem < RPG::BaseItem
  attr_accessor :exclude_extra
  #-----------------------------------------------------------------------------
  # Add card attributes
  #-----------------------------------------------------------------------------
  alias r2_load_notetag_for_extra_excludion load_notetags_pc27_cardgame_skill
  def load_notetags_pc27_cardgame_skill
    r2_load_notetag_for_extra_excludion
    @exclude_extra   = false
    self.note.split(/[\r\n]+/).each { |line|
      if /<exclude from extra>/i =~ line
        @exclude_extra = true
      end
    }
  end
end

class Window_CardSelect < Window_SkillList
  def make_item_list
    @data = @cards.reject { |card| card.exclude_extra }
  end
end
After some help from Kyonides to understand what I did wrong, please use Kyonides version which I'm going to change mine to as well.
 
Last edited:

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,763
Reaction score
892
First Language
English
Primarily Uses
RMXP
Keep in mind it's still Ron's code but improved a little bit to avoid too many unnecessary and problematic processes.

Ruby:
class RPG::UsableItem < RPG::BaseItem
  attr_accessor :exclude_extra
  #-----------------------------------------------------------------------------
  # Add card attributes
  #-----------------------------------------------------------------------------
  alias r2_load_notetag_for_extra_excludion load_notetags_pc27_cardgame_skill
  def load_notetags_pc27_cardgame_skill
    r2_load_notetag_for_extra_excludion
    @exclude_extra   = false
    self.note.split(/[\r\n]+/).each do |line|
      if /<exclude from extra>/i =~ line
        @exclude_extra = true
      end
    end
  end
end

class Window_CardSelect < Window_SkillList
  def make_item_list
    @data = @cards.reject{|card| card.exclude_extra }
  end
end
 
Last edited:

Mattsuharu

Regular
Regular
Joined
Apr 15, 2022
Messages
174
Reaction score
47
First Language
English
Primarily Uses
RMVXA
Thank you both! I'm gonna try it out!
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,153
Reaction score
16,960
First Language
English
Primarily Uses
RMMV

I've moved this thread to RGSSx Script Support. Thank you.

 

Mattsuharu

Regular
Regular
Joined
Apr 15, 2022
Messages
174
Reaction score
47
First Language
English
Primarily Uses
RMVXA
@Roninator2 So I tried it out. It worked, but not really as I inteded. The problem keep being that the Follow-up script try to play the next skill before I could even resolve the current one:

1686613089223.png
Yes, now thanks to your script the cards that not relate to the extra deck doesn't show up, but the skill trying to play right now is the one that make me pick a card.

Here's the problem:

The skill I want to create must do the follow 3 steps:

1st) Choose between removing 3 or 6 cards from the extra deck.
To achiev this, I used the Yanfly Input combo script, but instead of creating a combo, I use it as a choice skill option. This way, the player can choose if it want to remove 3 or 6 cards from their extra deck.
1686613291838.png

2nd) After picking one of the 2 choices, the skill according to that choice will play. Said skill will make me pick cards from my extra deck to banish.
1686613344739.png

3rd) If the player picked the "Banish 3: Excavate 3", then the 3 cards of the top of the deck should show, and the player would be able to pick one of those card and add them to the hand.

Now, the problem is that the follow-up skill script is trying to play the step 3 before I can even resolve step 2, unless I pick the 3 cards from the extra deck EXTREMELY FAST. Looks like the follow-up skill script have some kind of 2 seconds pause, but it ignores if another skill with a choice option like this is playing.

So, the step 3 instead of making me look at the top 3 (or 6) cards of my deck and pick one to add to my hand, it pick one of the extra deck cards and add them to my hand instead.

I had similar problems with other skills that overlap when trying to resolver another skill.
I know there's some script codes that said things like "wait_for_message" or "wait_for_effect". I'm pretty sure that some of those should be used in some code line of the follow-up skill script, but I can't figure out what type to use and in which line :c maybe the solution is easier than it looks but I can't find it.

Still, I'm immensely thankful for your code!
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,504
First Language
English
Primarily Uses
RMVXA
@Mattsuharu issue seen and understood a little better now. basically your doing two follow up skills and they are all getting merged into the one.
I don't believe it was ever intended to work that way.
I don't know if the actions can be processed a piece at a time.
I'm sure others have done this so it will take a little bit of effort to figure it out.
@kyonides could probably assist in getting this started.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,763
Reaction score
892
First Language
English
Primarily Uses
RMXP
Don't mention me! =_=¡ I'm too busy with my own stuff as to take care of a script rewrite.
 

Mattsuharu

Regular
Regular
Joined
Apr 15, 2022
Messages
174
Reaction score
47
First Language
English
Primarily Uses
RMVXA
Hehe, no problem guys. You already helped me a lot in the past. I'm extremely grateful already. If some day someone want to try to fix this up, this post would still be here waiting. Anyways, thank you both so far.
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,504
First Language
English
Primarily Uses
RMVXA
I guess it may take longer unless other members like TheoAllen or KK20 or A-Moonless-Night or others can pop in and advise on how to get the actions to pause until the one action is complete before doing the next one.
I'm spending little bit of time on it, but I basically need to research how to do it.
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,504
First Language
English
Primarily Uses
RMVXA
A solution, but maybe not the best.
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: PC27 - Card Game fix         ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║ Fixes compatibility between PC27    ╠════════════════════╣
# ║ Card game and Yanfly Follow Up Skill║    10 Jun 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Plug and Play                                            ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Details:                                                 ║
# ║   Will make the card select window continue to update    ║
# ║   when open.                                             ║
# ║   Reason for this is when you use Yanfly Follow Up       ║
# ║   Skill script and you have one skill follow up with     ║
# ║   a second and the second follows up with a third,       ║
# ║   The third skill is processed immediately.              ║
# ║                                                          ║
# ║   With this, the card select window will continue to     ║
# ║   update until the second skill is finished.             ║
# ║   Then the third skill will be processed.                ║
# ║   Investigated and found this solution for               ║
# ║          Mattsuharu                                      ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker - except nudity           ║
# ╚══════════════════════════════════════════════════════════╝

#===============================================================================
# Scene_Battle
#===============================================================================
class Scene_Battle < Scene_Base
  alias r2_card_select_combo_skill  process_select_cards
  def process_select_cards(effect_name)
    r2_card_select_combo_skill(effect_name)
    @input_combo_skill_window.hide
    @input_combo_info_window.hide
    @actor_command_window.deactivate
    while @card_select_window.active do
      update
    end
  end
end
 

Mattsuharu

Regular
Regular
Joined
Apr 15, 2022
Messages
174
Reaction score
47
First Language
English
Primarily Uses
RMVXA
A solution, but maybe not the best.
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: PC27 - Card Game fix         ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║ Fixes compatibility between PC27    ╠════════════════════╣
# ║ Card game and Yanfly Follow Up Skill║    10 Jun 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Plug and Play                                            ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Details:                                                 ║
# ║   Will make the card select window continue to update    ║
# ║   when open.                                             ║
# ║   Reason for this is when you use Yanfly Follow Up       ║
# ║   Skill script and you have one skill follow up with     ║
# ║   a second and the second follows up with a third,       ║
# ║   The third skill is processed immediately.              ║
# ║                                                          ║
# ║   With this, the card select window will continue to     ║
# ║   update until the second skill is finished.             ║
# ║   Then the third skill will be processed.                ║
# ║   Investigated and found this solution for               ║
# ║          Mattsuharu                                      ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker - except nudity           ║
# ╚══════════════════════════════════════════════════════════╝

#===============================================================================
# Scene_Battle
#===============================================================================
class Scene_Battle < Scene_Base
  alias r2_card_select_combo_skill  process_select_cards
  def process_select_cards(effect_name)
    r2_card_select_combo_skill(effect_name)
    @input_combo_skill_window.hide
    @input_combo_info_window.hide
    @actor_command_window.deactivate
    while @card_select_window.active do
      update
    end
  end
end
OMG It worked! You're my god! You deserve the heaven and everything else. Thanks so much Roni!
 

Latest Threads

Latest Posts

Latest Profile Posts

I was wondering if I should ask the question
"Who Is Dalph?"
But I met him pretty fast and his answer was extremely helpful. So yeah. That probably answers it.
So in hindsight, I could have made a double-post in this category instead of setting up a post on a different site and figuring out how to share and then linking...
I'm pretty sure me watching Netflix while having sushi just led to me eating the tail of my tempura shrimp.
1696004095642.png
...and now he even makes resources, too! xD

Forum statistics

Threads
134,906
Messages
1,251,787
Members
177,724
Latest member
VampireFraulein
Top