Posts: 45
Threads: 13
Joined: Apr 2016
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!
Posts: 4,615
Threads: 548
Joined: Dec 2009
02-23-2020, 02:57 AM
(This post was last modified: 02-24-2020, 04:43 AM by kyonides.)
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.
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!
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
Posts: 45
Threads: 13
Joined: Apr 2016
02-24-2020, 12:07 AM
(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
Posts: 11,243
Threads: 650
Joined: May 2009
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
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 45
Threads: 13
Joined: Apr 2016
(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
Closer, but still not it
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.
Posts: 11,243
Threads: 650
Joined: May 2009
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...)
Above are clickable links
Posts: 4,615
Threads: 548
Joined: Dec 2009
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.
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!
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
Posts: 11,243
Threads: 650
Joined: May 2009
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...)
Above are clickable links
Posts: 45
Threads: 13
Joined: Apr 2016
02-24-2020, 05:21 PM
(This post was last modified: 02-24-2020, 05:25 PM by Whisper.)
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
Posts: 4,615
Threads: 548
Joined: Dec 2009
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.
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!
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
|