
ThePentiumGuy
Avatar/Signature-
Posts
1152 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by ThePentiumGuy
-
A "GoTo" command... they had this in QBASIC
ThePentiumGuy replied to ThePentiumGuy's topic in General
After sitting down for about 30 minutes, I got this: Dialogue.txt Hi. I'm some guy. Here is the story of my life. Blah blah blah blah blah. Choice:2,Yes,No:Would you like some money? #Choice Yes: 2 Here's some money Do whatever you want with it. No: 2 Fine, be that way. Go away. #EndChoice Go Home This works like so: OR I have no idea how to read something like this (above) and parse it. I could first try: If you wish to see the code in a much more orderly fashion, please visit http://www.xtremevbtalk.com/showpost.php?p=922655&postcount=1 and scroll down. The VB tags are messed up on this forum. line = reader.readline If Not line.contains(":") Then 'Read it like normal 'This is easy Else s =line.split(":") if s(0) = "Choice" then LookAtChoice(line) End If End If Public Sub LookAtChoice(line as string) Dim colonSplit() as string Dim commaSplit() as String Dim numberofchoices as integer colonsplit = line.Split(":") 'Split "Choice:Yes,No:Would you like some money?" texttodisplay = colonsplit(2) ' "Would you like some money" commasplit = colonsplit(1).Split(",") numberofchoices = commasplit(0) ' I'll create a DisplayChoiceList function somewhere else. ' The game will only be able to hold 2, 3, or 4 choices if numberofchoices = 2 then DisplayChoiceList(numchoices, commasplit(1), commasplit(2)) if numberofchoices = 3 then DisplayChoiceList(numchoices, commasplit(1), commasplit(2), commasplit(3)) if numberofchoices = 4 then DisplayChoiceList(numchoices, commasplit(1), commasplit(2), commasplit(3), commasplit(4)) UpdateTextToDisplay() End Sub 'Later, when the player chooses a choice: Public sub CheckForChoices(myChoice as String) Reader.readline() 'The #Choice line is just for cleansiness Dim numLines as string loop until reader.readline = myChoice & ":" 'The line looks like " Yes: " numlines = cint(reader.readline) ' the 2 in the line after Yes: .. or No: for x as integer = 1 to numlines texttodisplay = reader.read UpdateTextToDisplay() next Loop until reader.readline = "#EndChoice" 'Skip the rest of the choices Wend Wend End Sub By the way, that's pseudocode(this was originalyl a post I made in Xtreme VB Talk). So please excuse any errors. Do you guys think that this will work? Now about GoTo, I figured it out. to GoTo a place in the text: Close the file open the file loop until you get to that place. Please post any input. As well as anything you see that might go wrong (ex: Nested Choices...etc) -The Pentium Guy -
A "GoTo" command... they had this in QBASIC
ThePentiumGuy replied to ThePentiumGuy's topic in General
Is there a way to "Declare" a goto ? I'm trying to do some scripting (to read dialogues) and I want to be able to go back and forth adn back and forth. Since it will be scripted, how am I supposed to.... oh man this all seems confusing now. anyone have some tips? I'm guessing my "dialogue" file will look like this: -say stuff PointA: -say more stuff ... this line will automaticall get split into 1 or more dialogue boxes ....etc... this line will get split. C: Yes, No, Repeat Conversation; Do you want some money? +Yes: Thank you for taking my money........ +No: JUST TAKE MY MONEY +Repeat Conversation: GoTo PointA -Thank you for talking to me See I have absolutely no idea how to get started. I don't even know if that's how I should approach the text file. Any tips? -The Pentium Guy -
A "GoTo" command... they had this in QBASIC
ThePentiumGuy replied to ThePentiumGuy's topic in General
Oh. See I enver tried this before ;) (this comp doesn't have .NET and the idea popped up just now). I'll give this a try. -The Pentium Guy -
How woudl you use a GoTo command like in QBASIC, in VB.NET. For example: GotoPoint Beginning <-- I wish this existed msgbox("story") msgbox("more story") if msgbox("Woudl you like to repeat") = messageboxresult.Yes Then GoTo Beginning <-- I wish this existed end if (I'm not sure of the QBASIC syntax for "GotoPoint"). So is there any way to do this without creating your own functions -TPG
-
Same. -The Pentium Guy
-
Pretty nice ;). I haven't deleted a single mail yet. -The Pentium Guy
-
Heh. I got hacked once. Wasn't as bad as I thought when I stopped freaking out. Glad you didn't get hacked ;). -TPG
-
AudioVideoPlayback cannot play different files
ThePentiumGuy replied to georgepatotk's topic in DirectX
Hmm. I wonder how the compiler liked that code. :) -TPG -
How about trying to raise the lines a little higher than the polys? Then maybe it won't interfere. Or, if you have zbuffer (and depth buffer) turned off, then simply render the lines after you render the poly and you won't get a problem :). I know I know, cheap solution but I guess it works. -TPG
-
How bout using collections? They start at 1 and they're easy to work with. Dim c as new collection c.add(myclass) But you can't control where that item goes unfortunately, it goes "on top". So c.Item(1) would be myclass. Those were the good old days.... :D. -TPG
-
Hmm. This brings up another point: What are the advantages/disadvantages of each type? (I'm writing a tutorial on Collections/ArrayLists/Hashtables/Stacks/Queues. I know stacks and queues are different from the rest so please ignore that). From my experience: ArrayLists are faster. You can specify a "default" bound. (ex dim x as new arraylist(75)). The default is set to make it more optimized. If you go over the bound it will be slower, as per IcePlug. Collections are basic. They're simply used to add/remove objects. Hashtables are more advanced in that you can store anything you want as the Key value (it can be any Object). Therefore, you can have class-class 'pairings', in one hashtable. -TPG
-
Heh "OH NO IT FIGURED OUT WHAT MY PICTURE IS! IT CAN FIND MY LOCATION BY SCANNING THE SURROUNDINGS!" -TPG
-
It seems people are concerned with privacy ("OH NO A COMPUTER IS READING MY MAIL!!"). But I do understand now that since hotmail/yahoo have upgraded people aren't seeing the need for gmail anymore. Hey, all I needed was roughly 10 MB. 2 MB was torture for me. So I guess people are now saying "Why the hell do I need 1 GB when I can keep my existing account which has enough, 250 MB". -TPG
-
Yeah. I think I'll stick with a hashtable, thanks. It seems like a "higher-end" version of a Collection. -The Pentium Guy
-
Hey, After I installed XP on my dad's PC, I signed in on MSN to check my mail or whatever. However, I think I accidentally .... erm.... made that account be associated with my MSN screenname. So now my dad can sign on to my MSN whenever he wants (simply by hitting sign in!!). Um. How can I undo this? I don't exactly want him going through my mail and all. So I've changed the password to that account (apparently, he wants to be the 'Owner' though, I told him I'll do it for him later beucase there's a virus on the Owner account that I need to fix). Someone please help? I know there's a simple solution to this, but I can't seem to find it anywhere. -The Pentium Guy
-
Are you serious? I swear to god it worked for me in VB.NET. I guess this is one of those things which seperates VB.NET from C#? Judging from what you said, Dim c as new Collection() is improper code, and should not be written (even though VB.NET allows this). -The Pentium Guy
-
So it seems as though they're the same. But HashTable has a little extra 'features'. -The Pentium Guy
-
Thanks for the replies (I was under the impression that the forum was dead and lifeless for a while). See when I first read it, I waited for the webserver to contine talking (it says ... ... ... at the end and I thought it would continue ><) so I waited a full 5 minutes before I gave up. Great page though. -The Pentium Guy
-
Heh. I guess the gmail craze has died down huh? I wonder what will happen if gmail starts offering a terrabyte. -The Pentium Guy
-
Ah thanks. Bt that brings up another question: What's the difference between a Collection and a Collection.HashTable. -The Pentium Guy
-
aClass1 adn aclass2 are instances of a class. x.Add("key1", "value1") x.Add("key2", "value2") Judging from what you wrote it seems as though in a hashtable you can only add strings (value1 and value2) instead of classes. Is there any way to retreive the key based on the number (index) -The Pentium Guy
-
Check out the following link. http://allianceradio.com/oops.html -The Pentium Guy Edit: Someone please reply. I've posted a bunch of stuff on this forum with no replies (but only views). Comment on this.
-
That's what I said ;).