The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: shintashi on May 16, 2010, 02:16:30 AM

Title: How do you break a parallel text loop?
Post by: shintashi on May 16, 2010, 02:16:30 AM
I'm trying to get a list of options to display like

option 1
option 2
option 3
option 4
option 5

and rotate through them using

conditional event command>conditional branch>tab 4>button is being pressed>X

and

conditional event command>conditional branch>tab 4>button is being pressed>Z

using a variable with base 0,

X (A on the keyboard) increases the number by +1

Z (D on the keyboard) decreases the number by -1

If the number exceeds my total options the number will be set to 0
if the number drops below 0, the variable will be set to the max value


This normally isn't a problem in a parallel process, as I placed a "wait 5" in between each jump.

The real problem is displaying text.

As soon as the first option is reached, it loads text, and waits for a prompt (like space bar) to close.
Once that option is loaded, it appears to keep loading that option, ignoring X and Z button codes.

I was able to override this interference by holding onto the spacebar while pushing the X/Z buttons, but this is both irritating and not entirely functional.

Is there a simple way of fixing this using a kind of script to fade out the text after ~20 frames,
or some method of using event code to stop the loop and keep listening for the X and Z?

Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 16, 2010, 02:22:37 AM
Use a label. That's probably the only way you could do this.
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 16, 2010, 03:22:57 AM
I've been having quite a bit of trouble causing the text window to close. In fact, outside of using the default button, I don't know how to target it at all. I tried something like
 $game_temp.message_window_showing = false

but nothing happened.
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 16, 2010, 03:26:15 AM
Could you show me your eventing?

EDIT: Also, why are you using $game_temp.message_window_showing = false?
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 16, 2010, 04:06:52 AM
Spoiler for:
@>Conditional Branch: The X button is being pressed
@>Wait: 5 frames(s)
@>Conditional Branch: Variable[0041] 5 zones] >= 1
@>Control Variables:[0041:] 5 zones] -= 1
@>Play SE...
@>
:Else
@>Control Variables [0041: 5 zones] = 4
@>
:Branch End
@>
:Else
@>
:Branch End
@>Conditional Branch: The Z button is being pressed
@>Wait: 5 frames(s)
@>Conditional Branch: Variable[0041] 5 zones] <= 3
@>Control Variables:[0041:] 5 zones] += 1
@>Play SE...
@>
:Else
@>Control Variables [0041: 5 zones] = 4
@>
:Branch End
@>
:Else
@>
:Branch End
@>Conditional Branch: Variable [0041: 5 zones] == 0
@>Change Text Options: Top, Hide
@>Text: First Choice
: :Press Shift to Select
@>Change Text Options:Bottom, Show
@>
:Else
:Branch End
@>Conditional Branch: Variable [0041: 5 zones] == 1
@>Change Text Options: Top, Hide
@>Text: Second Choice
: :Press Shift to Select
@>Change Text Options:Bottom, Show
@>
:Else
:Branch End
@>Conditional Branch: Variable [0041: 5 zones] == 2
@>Change Text Options: Top, Hide
@>Text: Third Choice
: :Press Shift to Select
@>Change Text Options:Bottom, Show
@>
:Else
:Branch End
@>Conditional Branch: Variable [0041: 5 zones] == 3
@>Change Text Options: Top, Hide
@>Text: Fourth Choice
: :Press Shift to Select
@>Change Text Options:Bottom, Show
@>
:Else
:Branch End
@>Conditional Branch: Variable [0041: 5 zones] == 4
@>Change Text Options: Top, Hide
@>Text: Fifth Choice
: :Press Shift to Select
@>Change Text Options:Bottom, Show
@>
:Else
:Branch End
@>Conditional Branch: The A button is being pressed
@>Show Choices: Choose a Location, Cancel
:When [Choose a Location]
@>Call Common Event...
@>
:When [Cancel]
@>
:Branch End
@>
:Else
@>
:Branch End
@>

This is the basic outline, the rest of the code is called through common events and works, more or less.
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 16, 2010, 05:04:52 PM
Dunno if you still need it, but here ya go. (http://i42.tinypic.com/11t753n.png)

A bit long-winded, but it's the VX equivalent of what you need (Should work for XP).

EDIT: Please move this, mods -.-
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 17, 2010, 02:55:08 AM
it was pretty clean and looked function, but it led to a really wild loop glitch where the sound effect played infinitely except when I was pushing buttons. I ended up rewriting my original too, so I'll post a semi functional version later.

For now I'm still looking for a way to auto-hide the text window after so many frames (like 20). I really appreciate the giant image though, it got me thinking.
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 17, 2010, 03:43:47 AM
Lol, I appreciate your question. It got me thinking.

And doesn't \^ work for instantly closing the window? If you want to wait 15 frames before it closes, use \.\^
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 19, 2010, 02:53:32 AM
no actually those commands don't do anything. They display as text in the text window and crash if put in the script box.
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 19, 2010, 03:34:18 AM
Oh, I had no idea that XP didn't incorporate those methods. Never mind, you could always use Ccoa's UMS, or Dubalex's AMS for those commands.
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 20, 2010, 03:05:15 AM
Oh, I had no idea that XP didn't incorporate those methods. Never mind, you could always use Ccoa's UMS, or Dubalex's AMS for those commands.

you are absolutely correct. It took some doing to get UMS working but it seems to be functional. Do you know how to toggle off the "one letter at a time" effect? I find it nice but irritating for the moment, and it appears to be built in to Ccoa's system.
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 20, 2010, 03:12:08 AM
Text Mode

This is whether or not the text is written one letter at a time or all at once (note that in battle, text is written all at once to avoid the very noticeable lag).

By Default
By default, text mode is one letter at a time. To change this, find this line:
@text_mode = ONE_LETTER_AT_A_TIME
and change to:
@text_mode = ALL_AT_ONCE

The full tutorial can be found here (http://www.rmxpunlimited.net/index.php/rmxp/rgss-scripts/system-enhances/147-ccoas-ums.html?start=1).
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 20, 2010, 03:23:52 AM
yep, line 224 of UMS changed to "@text_mode = ALL_AT_ONCE" ^_^

by the way, this is my first time using right-click "insert" to add a new option list in Script editor. It makes me think things like Monster Summons, castles and pets are possible  ;D
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 21, 2010, 12:32:49 AM
hey, I noticed this ccoa code has some weirdness to it, like my option menu is half way off the screen in combat. Is there a way to move it over?
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 21, 2010, 12:52:20 AM
I'm having a hard time understanding what you're trying to say.

Screenshot please.
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 23, 2010, 02:44:28 AM
Spoiler for:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg62.imageshack.us%2Fimg62%2F245%2Fmenuerror.png&hash=ddc18a8615b818ac4149205d0cc55a0126a9fe45) (http://img62.imageshack.us/i/menuerror.png/)

Here you go. The menu problem is circled in red. I think it's a window formatting issue along the X axis. If I knew which lines governed the X axis of the choice menus in ccoa's code i could probably just subtract 50.


Edit:

I think I need to modify these lines

Code: [Select]
# justifications
RIGHT  = 4
CENTER = 1
LEFT   = 6

# positions for extra objects (face graphics, choice box, etc)
ABOVE  = 0  # place the object above the top of the message box
CENTER = 1  # center the object vertically inside the message box
BOTTOM = 2  # place the bottom of the object on the bottom of the message box
SIDE   = 3  # to the side of the message box (which side depends on justification)

particularly the one that says "SIDE = 3" but I don't really know what the number range means.
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 23, 2010, 04:31:36 AM
That doesn't really look like a default battle option. If it is, could you specify what it is, and what it does? I'm still drawing a blank. Sorry about this.

Oh, and changing these:

Code: [Select]

# justifications
RIGHT  = 4
CENTER = 1
LEFT   = 6

# positions for extra objects (face graphics, choice box, etc)
ABOVE  = 0  # place the object above the top of the message box
CENTER = 1  # center the object vertically inside the message box
BOTTOM = 2  # place the bottom of the object on the bottom of the message box
SIDE   = 3  # to the side of the message box (which side depends on justification)


will just screw up your code. They're constants.

Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 23, 2010, 07:16:18 AM
That doesn't really look like a default battle option. If it is, could you specify what it is, and what it does? I'm still drawing a blank. Sorry about this.

Oh, and changing these:

Code: [Select]

# justifications
RIGHT  = 4
CENTER = 1
LEFT   = 6

# positions for extra objects (face graphics, choice box, etc)
ABOVE  = 0  # place the object above the top of the message box
CENTER = 1  # center the object vertically inside the message box
BOTTOM = 2  # place the bottom of the object on the bottom of the message box
SIDE   = 3  # to the side of the message box (which side depends on justification)


will just screw up your code. They're constants.



that's an option menu called through a script inside a common event of an item.

so say you are in combat, and you have an item, a rock to be precise.

You go to your inventory and select your rock, and it presents the option to throw the rock, or cancel.
if you throw the rock it triggers "auto attack" and reduces the rocks in your inventory by 1. I used the 'sling' weapon as my base and used the code

: $data_weapons[37].atk = 140

to change my sling (weapon number 37) to 140 attack power. After the rock is used, the damage of the sling is set back to zero.

: $data_weapons[37].atk = 0

this is part of an early experiment with projectile weapons and ammunition, and it's not yet perfected (else it would be a tutorial). Unfortunately, the ccoa code does mad crazy things with my option menus.

I recently noticed during playtest the INPUT NUMBER option doesn't display the text with this code either. It only displays the window. These two errors appear to be directly related (to option menus). If one can be fixed, the other can probably be fixed.

I also figured out for my system at least, changing this line:

(UMS, ~line 227)
@window_width = 480

to

@window_width = 520

was a good idea because the text would often run outside the box. The advantages of UMS are far too many to abandon it for a few glitches, especially if they can be fixed.
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 23, 2010, 07:42:46 AM
i think it might be something in this mess, but i'm probably mistaken.


Code: [Select]
  #--------------------------------------------------------------------------
  # * Input Number
  #--------------------------------------------------------------------------
  def command_103
    # If text has been set to message_text
    if $game_temp.message_text != nil
      # End
      return false
    end
    # Set message end waiting flag and callback
    @message_waiting = true
    $game_temp.message_proc = Proc.new { @message_waiting = false }
    # Number input setup
    $game_temp.message_text = ""
    $game_temp.num_input_start = 0
    $game_temp.num_input_variable_id = @parameters[0]
    $game_temp.num_input_digits_max = @parameters[1]
    # Continue
    return true
  end


This isn't the first time this happened.
 in 2008 someone named mouse had the same problem


Quote
I had a input number script for a random number game common event I scripted, since I installed UMS the input number hasn't worked properly as the input number box is blank.
Something I'm missing?


Solved, I just had to add a text box.

but I don't understand this last line about adding a text box.

Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 23, 2010, 03:46:29 PM
I've solved this input problem....
you have to have an input text immediately before each input text, with no other code inbetween, or the code inbetween, such as reseting variables, will cause the input window to appear without a display number.

so basically,

Quote from: MADE OF WIN
@>text: something
@>Input Number: [Variable...]

Quote from: FAIL
@>text: something
@>ANYTHING ELSE...
@>Input Number: [Variable...]
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 23, 2010, 04:02:28 PM
Glad you have it working.

Also, I have an idea for your slingshot system. Would the event "Force Action" do you any justice? Because right now, your events seem to be working fine.
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 23, 2010, 07:25:49 PM
Glad you have it working.

Also, I have an idea for your slingshot system. Would the event "Force Action" do you any justice? Because right now, your events seem to be working fine.

Yep,

been using "force action" in conjunction with "Execute Now",
what I need to do though is find a way to distinguish between in battle and out of battle with events. If I could do that, a lot of stuff would work way different. With the sling, I'm planning on having it work outside of battle.
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 23, 2010, 07:29:59 PM
Go to the items tab (or skills tab, not sure which one you want). Change Occasion to "Only in Battle".

Not sure why that isn't working for you.

EDIT: Sorry, I misunderstood some stuff.

Try Conditional Branch: If $game_temp.in_battle
 then Blah blah blah
else
 Blah Blah Blah
end
Title: Re: How do you break a parallel text loop?
Post by: shintashi on May 23, 2010, 08:52:51 PM
Go to the items tab (or skills tab, not sure which one you want). Change Occasion to "Only in Battle".

Not sure why that isn't working for you.

EDIT: Sorry, I misunderstood some stuff.

Try Conditional Branch: If $game_temp.in_battle
 then Blah blah blah
else
 Blah Blah Blah
end

once the if is gone, it Works like a charm! Thanks. I've noticed some subtle differences between XP and the other codes I presume are VX.
Title: Re: How do you break a parallel text loop?
Post by: cozziekuns on May 23, 2010, 08:57:54 PM
Actually, that was just a mistake on my part :P