Monkey Island questioning control
Blitz3D Forums/Blitz3D Beginners Area/Monkey Island questioning control
| ||
Hi there all, I'm new to blitz, and want to create a monkey island type game, you know when you get near a person then the button "talk to" appears and when you press "enter" a few sentences appear where you can choose from, and you get different feedback on each sentences etc. etc. Anybody knows a technique, esspecially about the sentence control Rick |
| ||
Are you using blitz plus or blitz3d? |
| ||
i'm using blitz3d |
| ||
Hey, i'll try something when i get in from college :) |
| ||
Hey, Thanx a lot! . I tried something with putting the questions into 2 dimensional arrays, and use the dimensions as a parent,child handler for the questions. like: sentence(1,0) = "question 1" sentence(2,0) = "question 2" sentence(1,1) = "answer to question 1" but i think i'm really completely off track here, because if i want to go deeper into questioning(like a question on an answer) it gives me troubles. |
| ||
maybe by adding a kind of header in each sentence you can get rid of the problem. i'll use 4 digit values style to store the sentences headers LEN NQID NBR R(1) R(2) R(3) 0000 0000 0000 0000 0000 0000 sentence in LEN you store the length of the text in NQID you store the question relative to this choice in NBR you store the numlber of replys for this sentence if it's a question in R(x) you store the number of the reply x then you store the sentence itself here an exemple: of how you can store a simple dialog in a one sized array like dialog$(xx) i just show you the strings content at the start of the line in brackets i'll show the array position of each string i use the character | in my example to separate the header parts but it's not used in the real string stored ap len nqid nbr R(x)|sentence [1]0017|0000|0003|0002|0003|0004|what's your name? [2]0011|0005|0000|ford escort [3]0022|0006|0000|it' not youre business [4]0012|0007|0000|i don't know [5]0024|0000|0000|nice name,ford escort!!! [6]0015|0000|0002|0008|0009|are you fool ?? [7]0028|0000|0000|damn, another amnesic people [8]0003|0000|0000|yes [9]0002|0000|0000|no now how use this ? here a really not optimised code example!!! you'll have to write an editor for the datas Graphics 800,600,32,2 Dim sentence$(100) Repeat z=z+1 Read sentence$(z) Until sentence$(z)="END" ret=1 Repeat If ret ret=quest(ret) EndIf Until ret=0 End Function quest(id) curent=id l=unformat(sentence$(curent),1) ; get the lenght of the curent sentence nbc=unformat(sentence$(curent),3); get the number of choices proposed as reply ; ;show the questions and replys ; Color $ff,0,0 Text 0,0,Right$(sentence$(curent),l) If nbc<>0 Color 0,$ff,0 For reply=1 To nbc Text 5,10+reply*12,"["+reply+"] "+Right$(sentence$(unformat(sentence(curent),3+reply)),unformat(sentence$(unformat(sentence(curent),3+reply)),1)) Next EndIf Flip ;---------------------here the keyboard test (in my example) but you can do whatever mouse or keyboard test you want Repeat key=GetKey() choice=0 If key>48 And key<49+nbc choice=key-48 EndIf Until KeyDown(1) Or choice<>0 newq=0 If choice newq=unformat(sentence$(unformat(sentence$(curent),3+choice)),2) EndIf Return newq End Function Function unformat(strin$,pos) Return Mid(strin$,((pos-1)*4)+1,4) End Function Data "001700000003000200030004what's your name?" Data "001100050000ford escort" Data "002200060000it' Not youre business" Data "001200070000i don't know" Data "002400000000nice name,ford escort!!!" Data "00150000000200080009are you fool ??" Data "002800000000damn, another amnesic people" Data "000300000000yes" Data "000200000000no" Data "END" hope this help you :) it's just an idea but i'm sure there's other way to do this |
| ||
Thanx!, i will experiment a little with it :), but is this a working code example, cause at a first look it doesn't do anything on my machine. But it's something to crack my mind on:) |
| ||
cause at a first look it doesn't do anything on my machine does it don't work ?? this works fine on my machine... oops, add a cls command after the flip command Flip Cls ;---------------------here the keyboard test (in my example) but you can do whatever mouse or keyboard test you want the exemple is not too deep if you choose the [it' not your business] reply the program ask you if your fool with a yes/no reply choices. this is the deepest dialog i made in the exemple because i don't have the time to code a longer exemple .i'll try to make a deepest dialog and maybe an editor if i have the time to next week |
| ||
so did you achieve something, or use a totaly different system ? i'm interested on your progress with tat stuff :) |
| ||
i finnaly do it, a monkey island style dialog editor, with an exemple dialog and source code to load a dialog made with it. http://perso.wanadoo.Fr/case/texted.zip note that the editor is at a really early stage no tree view, no sorting, no link back to previous part of the dialog no delete function... feel free to post your comments about it |
| ||
This is one of the areas where a scripting engine is perfect. FYI, Lucas Art adventure games were using a scripting engine called SCUMM (revolutionary in its time), you can find plenty of sites on the net talking about it. <pimp>So... I'm sure BVM is really ideal for this, because it will allow you to not only define the dialog scripts, but also the rest that goes with it, like making a character face another one, pick up an object, making complete cut scenes, and so on. All that in external scripts (that is, not hard coded in the main application. Just like with SCUMM :)</pimp> |
| ||
Hey, Try www.dead-code.org for an ideal engine for Lucasarts type of games. It uses direct3D in "the background". We use it for project Joe (http://projectjoe.synthetix-interactive.com |
| ||
@jeroen thanks for the link, interesting stuff but i guess the point for Real is to make such an engine in blitz :) |