Hello everyone; I've been having alot of trouble finding any information on this problem so I thought I'de ask here;
How do I make a ballon icon vanish without waiting until the end of its animation cycle?
Heres some background - My game has lots of little character building moments and background info available if the player examines various objects about the place - book cases, pictures on the wall, that kind of thing. However, when I watched people playtesting my game they would usually walk right past all of these without knowing they were there. This isn't helped by the fact that a bookcase is sometimes just a bookcase, so who is going to go around examining every possible object in every room?
I decided to do what Final Fantasy 9 did and have a little alert for when the player is next to and facing an object they can interact with. A Balloon Icon will loop above the players head for as long as they are doing so.
Everything works pretty much the way I want it to except that the Balloon Icon stays above your head until its animation is finished, even once you have looked or walked away. It doesn't sound like much, since the wait is only about a second, but in practace it makes it a little confusing about what is actualy prompting the alert in the first place.
Any information would be much apriciated! I'm a bit inept at scripting so a solution that doesn't involve scripting would be preferable, but if there is no other solution I will bite the bullet and try it.
Thanks!
(I should mention I am using RMVX Ace)
Ending a Balloon Icon Animation Prematurely?
● ARCHIVED · READ-ONLY
-
-
class Sprite_Character < Sprite_Base
#--------------------------------------------------------------------------
# * Update Balloon Icon
#--------------------------------------------------------------------------
alias drs_spritechar_updateballoon update_balloon
#--------------------------------------------------------------------------
def update_balloon
@balloon_duration = 1 if Input.trigger?:)C)
drs_spritechar_updateballoon
end
end
I realize this is scripting, but it works, and all you have to do is paste it into the materials section of your script. -
Thanks alot for the help! I'm sorry if this is a stupid question, but once I have this pasted into materials, how do I 'activate' it to do its job?
-
It's already being called by the game interpreter. It will do it on it's own :) Also, there are no stupid questions.
-
I may be missing something obvious - I've pasted it into materials and, having done nothing else besides that, it apears to be having no effect. Is there something I have to do to tell it when to cut out the animation?
-
Sorry, you have to hit the enter button whenever you want it to end.
-
Ah-ha! Would it be possible to make it so that the balloon vanishes when the direction buttons are pushed as well?
-
Yes, give me a few seconds.
class Sprite_Character < Sprite_Base
#--------------------------------------------------------------------------
# * Update Balloon Icon
#--------------------------------------------------------------------------
alias drs_spritechar_updateballoon update_balloon
#--------------------------------------------------------------------------
def update_balloon
# Determines if Enter, Left, Right, Up, or Down is pressed
temp_bool = true if Input.trigger?:)C)
temp_bool = true if Input.trigger?:)UP)
temp_bool = true if Input.trigger?:)DOWN)
temp_bool = true if Input.trigger?:)LEFT)
temp_bool = true if Input.trigger?:)RIGHT)
# End balloon if above is true
@balloon_duration = 1 if temp_bool
# Call to original method
drs_spritechar_updateballoon
end
end
Paste this over top of the previous code, and not alongside. Then, let me know if it works :) -
Thats wonderful! :D It works exactly how I wanted it to now. Thanks very much for all your help!
-
You're very welcome. I believe this thread has been resolved moderators lol
-
This is the same, but more efficient:
class Sprite_Character < Sprite_Base#--------------------------------------------------------------------------# * Update Balloon Icon#-------------------------------------------------------------------------- alias drs_spritechar_updateballoon update_balloon#-------------------------------------------------------------------------- def update_balloon @balloon_duration = 1 if Input.trigger?:)C) || Input.dir4 <> 0 drs_spritechar_updateballoon endendThis 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.