this blog will show what an inept programmer i really am, so i apologize in advance. i'm hoping some of you might have helpful suggestions; if you do, please leave a comment or send me a PM!
this week i added the talkbox element to my contest entry: it's reminiscent of Shadow of the Beast in that you strike up conversation with an npc, type a keyword to ask about, press enter and get the npc's reply (if it has one). i thought this would be more involving and a helluva lot more interesting than the original plan: giving the player an extremely limited list of conversation topics (reply A, reply B, or reply C).now, i use GM7, and i'm mostly a drag-and-drop programmer, but i know a few advanced tricks and i actually consult the help file BEFORE asking help on the internet. but the way i accomplish certain effects in a game tends to be on the convoluted side, maybe because i'm a bad programmer, or maybe because i just prefer things the hard way. i dunno.anyway, i'm wondering if other game maker users have successfully made text adventure games. if they have, i'd love to know how to tackle the following two issues: 1) an easier way to group keywords togetherthe talkbox draws keyboard_string as you type, and when you press enter it goes down a list of valid keywords and checks them against keyboard_string. for example, the player wants to know where to get healing when he's hurt, so he types "healing"; and if the npc knows where the hospital is, he/she gives a valid reply ("there's a hospital on the north side of town!")but the player might also type heal, healer, cleric, church, rest, or any number of things. the way the game is currently set up, i'd have to make an entry for every single one of those.if keyboard_string = "heal", set reply to "x";if keyboard_string = "healer", set reply to "x";if keyboard_string = "cleric", set reply to "x";etc, etc…i've used functions like "choose" before in GM, and i was sure that there'd be something similar that would check everything on a list rather than picking one at random, but i haven't found it. 2) an easier way to implement an "i don't know" reply from an npci want the npc to give an "i don't know" reply when keyboard_string doesn't equal ANY keywords on the built-in list, and my current method for accomplishing this is…well, cumbersome. because after checking whether keyboard_string equals x for every valid keyword, i then have to make one looonnng "if not" argument for every valid keyword that ends with "set reply to 'i don't understand'". there HAS to be a better way to do it…at least being unemployed has ONE benefit when you design indie games as a hobby: you sure get a lot of work done.——–apart from the above issues, the project's been shaping nicely and it's really captured my interest. that's what these contests are all about, right?i just realized i've been developing games for more than ten years. i realized this while going through my old RPG Maker 2000 projects this week. why do i keep doing this to myself…?i also do a webcomic, and i also have arthritic elbows….so hopefully i'll be able to finish this thing by the deadline while still working on the comic.EDIT: screenshot
It's not really more complicated, it just doesn't help because the whole point is reducing the amount of repetition. The '{reply="x"}' bit is repeated, as '"x"' is the same for each case.
Maybe he just used X as filler and wanted to give each case its own text.
Nope, his problem is grouping all the keywords which mean the same thing. "Heal", "healer" and "cleric" all have similar meanings.
You could also just not have a break for every case
Apart from languages which don't allow switch statements with strings.
Thanks colseed, that's pretty damn useful.
wow, didn't expect to get many replies on this. thanks, guys – i'll experiment with this stuff a bit and see how it turns out. that'll help me decide whether to stick with this idea or scrap it in favor of a more traditional dialogue thing.
@JuurianChi: yeah, he kinda does. or an 8-bit elton john.1) Switch statements
Thanks for repeating colseed.
IIRC you can also do: