Status
Not open for further replies.

MetalZelda

Villager
Member
Joined
Nov 15, 2012
Messages
10
Reaction score
0
First Language
French
Primarily Uses
Hi :)

I was editing a script for my project (Zelda Eternal Struggle) and I need your help !

I tried every wait command (wait(frame); frame.time { Graphic.update }) but don't work eigher,

frame.time freeze the game while it plays the Sound Effect.

Hum, I need some help ...

The SE works in game, but they are repeated so many times in 1 seconds, that I need to make a wait commant to delay the se playing frequency

Here's the script  (look def update, I turned the lines that makes me mad into comments)

#===============================================================================# ■ LOW_LIFE_ANIMATION#===============================================================================module LOW_LIFE_ANIMATION #Suffix of the spriteset LOW_LIFE = "_LOWANI" #Wait count when he's standing still and seems hurt WCOUNT = 15 #Here, add the sound when Link is suffering SE = RPG::AudioFile.new('Link_Huff1', 100) #-------------------------------------------------------------------------- # ● Character Name #-------------------------------------------------------------------------- def character_name filename = super for i in 0...$game_party.actors.size actor = $game_party.actors if @breakacting and not $game_system.map_interpreter.running? & if actor.hp * 100 / actor.maxhp <= 30 new_name = filename + LOW_LIFE filename = new_name if RPG_FileTest.character_exist?(new_name) endendend return filename end #-------------------------------------------------------------------------- # ● Breakact #-------------------------------------------------------------------------- def breakact=( @breakacting = b @step_anime = b end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update super if controllable? if @breakact_count.to_i > 0 @breakact_count -= 1 else self.breakact = true# $game_system.se_play(LOW_LIFE_ANIMATION::SE)# 14.times do# Graphics.update end else @breakact_count = WCOUNT unless self.action != nil or $game_map.starting? or self.knockbacking? self.breakact = false end end endend#===============================================================================# ■ Game_Player < Game_Character#===============================================================================class Game_Player < Game_Character include LOW_LIFE_ANIMATIONend#===============================================================================# ■ Game_Player#===============================================================================class Game_Player < Game_Character #-------------------------------------------------------------------------- # ● Controllable? #-------------------------------------------------------------------------- def controllable? return false if @actor == nil return false if moving? return false if @move_route_forcing or $game_temp.message_window_showing return false if $game_system.map_interpreter.running? return false if self.action != nil return false if self.battler.stop return false if @character_name != @actor.character_name return false if terrain_tag == XAS::FALL_TERRAIN return false if terrain_tag == XAS::SWIMMING_TERRAIN for i in 0...$game_party.actors.size actor = $game_party.actors return false if actor.hp * 100 / actor.maxhp > 30 end return true endend$LOW_LIFE_ANIMATION = trueThat's the first time this happend to me ... And if someone can check and correct what was wrong (cf : XAS ABS is used)

Thx
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,737
Reaction score
15,310
First Language
English
Primarily Uses
RMMV
You should not be adding your own loops and Graphics.updates to your scripts. That all happens by default with the scene manager. You simply use the update method to say what you want to happen with each update.


When @breakact_count reaches 0 it will play the sound effect, but nothing changes @breakact_count after the sound effect has been played. So every time the update method runs, @breakact_count is still going to be 0, so the SE will still play. Updating the graphics 14 times does nothing - graphics only needs to be updated once per frame (and already is by default).


What you need to do is to reset @breakact_count, or use a different counter, so each time the SE plays, it starts counting down again from the beginning, and only plays again when it reaches 0.
 

MetalZelda

Villager
Member
Joined
Nov 15, 2012
Messages
10
Reaction score
0
First Language
French
Primarily Uses
Woah ... Whoah ... Thanks a lot Shaz ! it really helped me :D

*praising the lord*
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,737
Reaction score
15,310
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

You look like you had a rough day...Here, have a Baby Panda!

A certain person better sell his stock while he still can, because it looks like it's going to take an unrecoverable nose dive.
7 years of trying to plan this project... and it got an official plotline today. 7 years. I really just have no concept of order huh GHJGSJHGVGHASFH.
Doing RPG Maker News for 24th October 2021

I'm not sure how to do this so I'll just ask here, Wheres a good place to post your game (for free) once its done?

Forum statistics

Threads
116,064
Messages
1,095,454
Members
151,428
Latest member
marsmason
Top