"Wait" in the script
#1
Hello everyone
I've got (hopefully) simple question.
How I can put "wait" into script? I have CMS script and I made automatic animation when character is giving something away. Problem is that I would like animation to show first and message appeared after but I can't find the way. Animation and message appearing in the same moment.

Code:
if @od_text
      $game_player.animation_id = 5
      @oo_box = Window_MessageOoBox.new(x, y - 16, "   Given  ")
      @oo_box.back.opacity = 0 if $game_system.message_frame == 1
      @oo_box.z = self.z
      @od_text = nil
    end

Any simple solution to solve it?
Have a good one!
Reply }
#2
1.times { Graphics.update }

Replace 1 with any specific number. Take into consideration that 1 second should be equal to Graphics.frame_rate which is usually 40 fps.

Well, VX or VX Ace documentation said Graphics.wait was the same as the code above so...
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#3
Thumbs Down 
(02-23-2020, 02:57 AM)kyonides Wrote: 1.times { Graphics.update }

Replace 1 with any specific number. Take into consideration that 1 second should be equal to Graphics.frame_rate which is usually 40 fps.

Unfortunately it doesn't work. It freezes the game for x frame rates and then animation and message comes simultaneously
Reply }
#4
I see. The previous solution would freeze all content when evoked. If placed before the animation ID, everything freezes before anything happens. If placed after the animation ID, it still freezes before control is returned to, what I am assuming, is the Scene_Map code before the custom message window is evoked.

The Scene_Map itself already has a wait count system, handled by the Interpreter class itself. This SHOULD sufficient as the
$game_system.map_interpreter.update
command is executed before it attempts to reach the message system code in Scene_Map's update method.

Perhaps a statement like...
$game_system.map_interpreter.wait_count = 20

It will NOT run right away. You cannot just put values into wait_count straight into the Interpreter class because the wait_count value is kinda protected. So... add the following very SIMPLE script:

Code:
#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :wait_count               # Time to pause the map in frames
end

Once that is done, you should be able to use the above sample command. It works in map events Laughing + Tongue sticking out
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#5
(02-24-2020, 01:10 AM)DerVVulfman Wrote: I see.  The previous solution would freeze all content when evoked.  If placed before the animation ID, everything freezes before anything happens.  If placed after the animation ID, it still freezes before control is returned to, what I am assuming, is the Scene_Map code before the custom message window is evoked.

The Scene_Map itself already has a wait count system, handled by the Interpreter class itself.  This SHOULD sufficient as the
$game_system.map_interpreter.update
command is executed before it attempts to reach the message system code in Scene_Map's update method.

Perhaps a statement like...
$game_system.map_interpreter.wait_count = 20

It will NOT run right away.  You cannot just put values into wait_count straight into the Interpreter class because the wait_count value is kinda protected.  So... add the following very SIMPLE script:

Code:
#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :wait_count               # Time to pause the map in frames
end

Once that is done, you should be able to use the above sample command. It works in map events Laughing + Tongue sticking out

Closer, but still not it Confused
Animation and message still appears simultaneously. Waiting applies AFTER message (Player can't move for x time). But at least there is no graphic freeze.
Reply }
#6
The message system... does it add new content to the Scene_Map class? If that is the case, placement of a new wait counter routine may be critical.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#7
Mmm... well, I guess you'd need to separate animation and message update calls. Perhaps you could include an if statement where it checks out if there's an animation id not equal to 0 and then you let it update the animation but return right after that. It gotta be placed before the message update method is called.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#8
The default wait routine in Scene Map part of the $game_system.map_interpreter.update command in the update method's main loop and runs before the default message update. So it should have worked by default. My inquiry is to know if any changes were made to Scene_Map. That would be key.

(02-24-2020, 02:05 AM)Whisper Wrote: Animation and message still appears simultaneously. Waiting applies AFTER message (Player can't move for x time). But at least there is no graphic freeze.
According to this, the message and animation show simultaneously... then waits. If the custom message system is added to the start of Scene_Map's update method, this would be the result.

Likely example.
Code:
def update
  yadda - yadda - yadda
  new message system     <-- Executes Message Immediately
  yadda - yadda - yadda
  beginning of original code
  default screen graphics  <-- Executes Animation Immediately
  default wait code          <-- NOW WAIT
  default (and unused message)
  yadda - yadda - yadda
end

So yeah, look at the script and see if there's any Scene_Map code. If so, we can always add a custom WAIT command before the message system's custom update just for you.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#9
Sorry guys but nothing works :(
CMS doesn't add anything in Scene_Map. Whenever I try to add any condition like "show message when timer = 0" script will freeze (unless condition is met). It's "all at the same time or nothing at all".
I'm using Scrolling Message System EX by Slipknot, edited by LiTTleDRAgo and modified by me.
Thank you for your time, guys. I don't want to bother you so much for such a minor problem. However, if you want to "dig" the topic, here are all scripts I'm using. I would send you whole game but its 2gb at this moment xD Command that trigger process I'm trying to fix is /od in message field, and main commands you will find at 811 line of "Scrolling MS EXX*"

https://send.firefox.com/download/353e58...PPz5Ly_D5A
Reply }
#10
Well, if that depends on parsing the message text, it's always wait till the message window is displayed to process the request... So I seriously doubt such approach will ever work as you expected.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Plugin or Script help with Item menu, SKill menu, and Equip menu JayRay 2 62 Yesterday, 03:09 AM
Last Post: JayRay
   Script compatibility help Lord Vectra 3 4,602 07-25-2021, 11:42 PM
Last Post: DerVVulfman
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 15,839 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   Skill Cooldown script Fenriswolf 11 16,438 12-10-2019, 11:10 AM
Last Post: Fenriswolf
   Help iwth script (RGSS Player crash) Whisper 3 8,529 06-17-2017, 05:03 PM
Last Post: Whisper
   Help modifying a script Keeroh 7 10,209 06-11-2017, 04:43 PM
Last Post: DerVVulfman
Question  Mog Menu script: help me stop the crazy picture movement during transitions Zachariad 4 9,852 05-31-2017, 05:10 AM
Last Post: Zachariad
   Actor names in Quest Script jreagan406 5 8,636 03-07-2017, 08:06 AM
Last Post: JayRay
   Bizarre issue with Lanzer counter script. Steel Beast 6Beets 2 7,245 10-04-2016, 11:46 AM
Last Post: Steel Beast 6Beets
   Moonpearl script Animated Battlers help!! x(( Starmage 11 15,634 05-21-2016, 05:34 AM
Last Post: Starmage



Users browsing this thread: 2 Guest(s)