Balloon Scripting

vertex

Villager
Member
Joined
Apr 27, 2014
Messages
15
Reaction score
3
Primarily Uses
I need a script to help me with a minigame I'm making. You serve drinks in a bar and to show which drinks customers want and which drink you hold at the moment, I use balloons. I only have a few problems: balloons only get replaced by a new balloon when the animation is done. This creates a bit of lag between the drink you actually hold and what drink the game shows you you're holding. The other is that I'm using an parallel process to show the drink you're holding, but the balloon's animation loops, which looks odd.

So is there a way, though script or command, to have the ability to dispose a balloon immediately and stop their animation from looping somehow?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
As long as you have it in a parallel process event, it's going to loop. You should be rethinking your event logic, not trying to find a way to change scripts to overcome a problem you've introduced by your methods.


Show us a screenshot of the event that controls everything so we can see how you've got it set up. There might be a better way.
 

vertex

Villager
Member
Joined
Apr 27, 2014
Messages
15
Reaction score
3
Primarily Uses
As long as you have it in a parallel process event, it's going to loop.
I'm very aware. If you have an idea to do it another way, I'm all ears, but I'm afraid I don't have a clue how to make the balloons stay any other way. The event looks like this:

 
Last edited by a moderator:

vertex

Villager
Member
Joined
Apr 27, 2014
Messages
15
Reaction score
3
Primarily Uses
It's been some days, a bump is in order I suppose.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I will see if I can write a script for you tomorrow. Post back in 48 hours if I haven't given it to you.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Alright. This will allow you to keep a balloon animating over a player/event/vehicle/follower for as long as you want.

Insert into a new script slot.

class Game_CharacterBase #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :loop_balloon # Balloon looping #-------------------------------------------------------------------------- # * Initialize Public Member Variables #-------------------------------------------------------------------------- alias shaz_rb_init_public_members init_public_members def init_public_members shaz_rb_init_public_members @loop_balloon = false endendclass Sprite_Character < Sprite_Base #-------------------------------------------------------------------------- # * Update Balloon Icon #-------------------------------------------------------------------------- def update_balloon if @balloon_duration > 0 @balloon_duration -= 1 if @balloon_duration == 0 && @character.loop_balloon @balloon_duration = 8 * balloon_speed + balloon_wait end if @balloon_duration > 0 @balloon_sprite.x = x @balloon_sprite.y = y - height @balloon_sprite.z = z + 200 sx = balloon_frame_index * 32 sy = (@balloon_id - 1) * 32 @balloon_sprite.src_rect.set(sx, sy, 32, 32) else end_balloon end end endend
To make a balloon repeat on an event, do this:

Script: $game_map.events[id].loop_balloon = trueShow Balloon Icon: EVID, BalloonWhen you're ready for it to stop, do this:
Code:
Script: $game_map.events[id].loop_balloon = false
If you want the balloon on the player instead, just say $game_player instead of $game_map.events[id]You can also do this:

Set Move Route: This Event (or Player, or whatever) : Script: loop_balloon = trueNow you can get rid of your parallel process event, and just have the action triggered by Action Button whenever you serve a customer or pick up an item.
 
Last edited by a moderator:

vertex

Villager
Member
Joined
Apr 27, 2014
Messages
15
Reaction score
3
Primarily Uses
I appreciate your effort, but it still has the problem I had with the parallel process, that is the balloon's animation loops, which looks weird. I also can't seem to dispose of a balloon when loop_balloon is true.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
No, that's why I said you have to do the call to turn it off (set loop_balloon to false) when you want to get rid of it.


If you don't want it to loop, what frame should it show all the time?
 

vertex

Villager
Member
Joined
Apr 27, 2014
Messages
15
Reaction score
3
Primarily Uses
So did you get it to work, or?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top