Author Topic: [XP] Message Choice Window  (Read 15476 times)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
[XP] Message Choice Window
« on: August 06, 2010, 06:27:55 PM »
Message Choice Window
Authors: ForeverZer0
Version: 1.0
Type: Message Add-on
Key Term: Message Add-on

Introduction

This script will allow you to set up more than the 4 choices that RPGXP limits you to. The window will behave much like the default window and is very easy to use.

Features

  • Set up as many choices as you need (within reason)
  • Custom width, x, and y, or use the auto-center feature
  • Uses a single script call
  • Does not effect the Window_Message class.

Screenshots

None.

Demo

None.

Script


(click to show/hide)

Instructions

Single script call. (See script)

Compatibility

Should be highly compatible, even with exotic message systems.

Credits and Thanks

  • ForeverZer0

Author's Notes

Please report any bugs/issues.
Enjoy!
« Last Edit: August 06, 2010, 08:17:36 PM by Blizzard »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline stripe103

  • Astral Trancist
  • *****
  • Posts: 570
  • LV: 18
  • Gender: Male
    • View Profile
Re: [XP] Message Choice Window
« Reply #1 on: August 06, 2010, 09:27:49 PM »
Finally, we can get more options without having to have special Custom Message Systems!
Good job. As always. :D

By Axerax

Offline WhiteRose

  • Trying to code in Ruby
  • Moderator
  • Lexima Warrior
  • ***
  • Posts: 2341
  • LV: 127
  • Gender: Female
  • <3
    • View Profile
Re: [XP] Message Choice Window
« Reply #2 on: August 06, 2010, 10:18:28 PM »
Though I'll probably stick to the UMS, this is a great option for those who want to stick with other message scripts yet still want this option. Well done - great work like always.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Message Choice Window
« Reply #3 on: August 06, 2010, 10:27:14 PM »
Thank you.
I intended for it to be used those who didn't use a custom message system, such as the UMS, but still wanted this feature.

Glad you like.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Message Choice Window
« Reply #4 on: August 06, 2010, 11:43:32 PM »
For the cancel thing, add a cancel choice index like RPGXP does.

In the show choices command it says Cance Index or something.

Offline SBR*

  • Chaos User
  • ******
  • Posts: 1195
  • LV: -7
  • Gender: Male
    • View Profile
Re: [XP] Message Choice Window
« Reply #5 on: August 07, 2010, 12:50:41 PM »
Very nice! I haven't tested it, but I'm sure it works perfectly! I can't level you up right now, since I did just level you up for that awesome comment in the Garbage Collection topic, but I'll probably do that later today.

I'd prefer to use a script call in a conditional branch that returns the choice that's chosen by the player over finding the right variable and checking it then. Maybe a good (optional) future?

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Re: [XP] Message Choice Window
« Reply #6 on: August 10, 2010, 09:11:57 PM »
I like this script. It'd be useful for making games like Knight of the Old Republic. There are a couple suggestions I have though. First off, it'd be nice to control the height of the window. You'd still be able to have as many options as you want (since window_selectable scrolls if the contents are too big for the window), but it'd look prettier. (you could have 20 options, but only show 4 in the window at a time). You should allow the default values for width, height x, and y to be configurable in the configuration section. That'd make it so we don't have to set X, Y, width, or height unless we want it different than the default. It'd make the script more snazzy.

Again, great script. Just pointing out some ways I think you could make it even better :D

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Message Choice Window
« Reply #7 on: August 10, 2010, 11:07:52 PM »
For the cancel thing, add a cancel choice index like RPGXP does.

In the show choices command it says Cance Index or something.

@g_g
All you have to do is not set a condition for the option you want to be the "cancel". It will not do anything and have the exact same effect. For example, say you have 2 options (yes and no), only set a condition for "yes" if you want it to be a cancel if the player selects "no". Thats why there is no "Cancel Option".

@legacyblade
I spent more time applying the script template than I took to write the script, so it is lacking in a few areas. Your suggestions sound pretty good. I'll add them in a future version sometime here... :wacko:
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline lonely_cubone

  • Transcended Spirit
  • ***
  • Posts: 227
  • LV: 6
  • Gender: Male
  • OMG IT'S A CUBONE
    • View Profile
Re: [XP] Message Choice Window
« Reply #8 on: August 11, 2010, 05:29:11 PM »
For the cancel thing, add a cancel choice index like RPGXP does.

In the show choices command it says Cance Index or something.

@g_g
All you have to do is not set a condition for the option you want to be the "cancel". It will not do anything and have the exact same effect. For example, say you have 2 options (yes and no), only set a condition for "yes" if you want it to be a cancel if the player selects "no". Thats why there is no "Cancel Option".

I don't think that's what Game_Guy was getting at. With the event command, you can have a different branch for when you press the Cancel button, which is different from each of the choices. So, with the event command, you could have the choices "Cow", "Sheep", and "Albatross" show up on the screen, but when you press Escape, it acts as a fourth choice that isn't visible to the player. I'm not positive, but I think that's what G_G was referring to.

Anyways, this looks like a great script, and I'm going to use it in the game I'm working on right now.

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Message Choice Window
« Reply #9 on: August 11, 2010, 06:37:05 PM »
I hope this is the proper place to make requests as additions to this idea of script (or this script directly)
You've created now the ability to essentially make a useful number of choices (4 often just doesn't cut it)

Do you have any eventing method that I've overlooked that can enable this to say...
Produce certain choices only if an item is in inventory? If a switch/variable is active?

Simple example:
(click to show/hide)
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Message Choice Window
« Reply #10 on: August 11, 2010, 07:48:30 PM »
Could do this. Call this in an event first of all.
Code: [Select]
$songs = []
Then have a parallel process check if player has an item. If so add the choice to songs. Something like this.
Code: [Select]
Item in inventory
  $songs.push("Battle Theme")
else
  $songs.delete("Battle Theme")
end

Then just call the window like you would normally except use $songs as the choices.

statesman88

  • Guest
Re: [XP] Message Choice Window
« Reply #11 on: January 15, 2011, 09:42:44 AM »
I was really excited to find this... I spent several hours looking for a script like this. I want to have choices only show up in certain situations, like jragyn00 and game_guy were talking about. So, thanks for making it, and thanks to game_guy for showing the basics of how to use the script that way. :) I have had a lot of fun pushing this script to its limits.

Anyway, three questions/suggestions:
First, this script isn't 100% compatible with the Multiple Message Windows (non-SDK) script (by Wachunga & revised by ForeverZer0). Whenever I use this choice script as the last text window of an event, pressing the action button or Back/Esc/X button not only registers the choice, but it also performs whatever function it would perform if the choice was not present. So, if I exit your choice script menu using Esc, it also brings up the menu, and if I choose a choice with the action button, then I also reactivate the event. Again, this only happens when using both this script and the Multiple Message Windows (MMW), and when the choice is the last text window of the event. Also, the bug does not occur with RMXP's native Show Choices command.

Second, would it be possible to get this choice script window to show up as a speech bubble, like the MMW script's default?

Third, if all of your choice options are conditional on switches or variables, it is possible that your Choices array will be empty, which crashes the game. Currently, I program a check for this into my events. However, it might make this script better to check for an empty array automatically.

Finally, just in case anyone else is interested in how to have choices that only show up under certain conditions, here's how I've done it--there are several complications beyond what game_guy showed above. All of this is event processing/scripting. It's written for somebody who knows as little about scripting as I did a few days ago--all I knew was what variables, switches, and strings are. Now, the only thing I don't know is which variables/objects/arrays to use to discover if an item is in the inventory/equipped or what a character's current stats are.
(click to show/hide)
« Last Edit: January 16, 2011, 07:39:17 PM by statesman88 »

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Message Choice Window
« Reply #12 on: May 06, 2011, 09:43:08 PM »
Holy crap, I was about to ask about exactly what statesman88 answered, and not only did I get an answer, but I got a full lesson on arrays/variables/switches via scripting 0-0

Damn.

Of course, Zer0, if you have a more efficient/alternative method to make this script work like he is talking about, by all means, share. :D
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Message Choice Window
« Reply #13 on: May 06, 2011, 11:49:34 PM »
I suppose I could redo the script real fast. It was originally just something I did for a specific need, then felt with a minor edit or two I could release it. I didn't really put a lot into it at the time, but it won't be hard to improve it.

I may even throw in a couple new features, who knows.  8)
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Message Choice Window
« Reply #14 on: May 07, 2011, 01:39:10 AM »
I like features.
With the main desire being conditional choices  :ninja:

Of course, it seems like most your scripts were developed to accomplish a purpose of your own, haha.
What other scripts have you developed but not released... yet?
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Message Choice Window
« Reply #15 on: May 07, 2011, 02:06:15 AM »
Probably a whole bunch.  I used to write scripts left and right, some useful, some not.  I only released anything that could be compatible with other scripts, or that I thought were worthy.  Many of them, although they are "scripts", are quite worthless unless used for a single specific purpose.  A good example would be the little intro you may see in some of my demos where the letters all come together from off-screen. It may be cool, but what else would you ever use that for?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Message Choice Window
« Reply #16 on: May 07, 2011, 05:28:12 PM »
inbattlecutscenes, advertisements(story-game-related), puzzles (see half the letters and guess what it says? idk, creativity beckons that) or... well, I dunno.

I just like messing with scripts and their functionality parts(usually below the "don't edit past here" line) and seeing what I can do with it. :D And though I understand what the scripts do, and what each segment does, its a whole other story trying to put one together on my own. >.<
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Offline Rolandojis

  • Trained Member
  • *
  • Posts: 25
  • LV: -1
    • View Profile
Re: [XP] Message Choice Window
« Reply #17 on: October 14, 2011, 05:05:05 AM »
My script call was like this:

I dont really know if its correct or what do I have to change but when I get to the part of the game where it should appear it shows this:


Please help  :'(

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Message Choice Window
« Reply #18 on: October 14, 2011, 05:48:01 AM »
The choices are not in an array.
Simply add a [ before the first choice and a ] after the last choice (before the comma).
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Eriah

  • Guest
Re: [XP] Message Choice Window
« Reply #19 on: March 24, 2012, 12:43:22 AM »
I know this script is old by now, but I wanted to point something out, since I'm currently using it in my game.

I made a demo event that triggers with the action button. When selecting a choice, it's supposed to start a track, and then the event ends automatically. I select the choice, the track plays, and the event ends like it should. But when selecting the choice, since the action button was pressed to select it, the event triggers again. Thus meaning the action button reads on the map even after the choice window is closed. I'm not sure if that's only my game doing it or not, but it may become a bit of an inconvenience for some others.

What I'm doing is setting it to go to another event page with an action button trigger after selecting the choice, which makes it go back to the original page. Thus the trigger doesn't restart the event. So it's not much of a problem to me, personally, since I can get around it.

I'm thinking the reason no one pointed this out before is because they had commands go on after the choice is selected, which would negate the press of the action button, and so nothing happens to them. But for events that close right after the selection, it'll be an issue.