Author Topic: Question about creating blocks  (Read 1941 times)

0 Members and 1 Guest are viewing this topic.

Offline johnblood

  • Newbie
  • Posts: 15
Question about creating blocks
« on: October 01, 2020, 12:03:29 pm »
Hi,

I'm working on an interactive fiction game for a game jam (https://itch.io/jam/dos-games-fall-jam). This is the first time I have created something with QB64. Basically, I would like to create blocks of code that print out text. Then the reader/player gets to choose how the story will progress. In Just Basic, you can assign labels to blocks of code and tell the program to goto a block of code based user input or whatever. Is there something similar in QB64? I'd rather use QB64 than JB. Thanks.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: Question about creating blocks
« Reply #1 on: October 01, 2020, 12:12:08 pm »
Yes same thing in QB64 only a label looks like this

label:

IamAlabelBecauseIendINaColon:

GOSUB label ' no colon and a RETURN in the GOSUB

GOSUBs must be placed between main code block and SUBs and FUNCTIONs usually after END or SYSTEM of main code.

« Last Edit: October 01, 2020, 12:25:23 pm by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: Question about creating blocks
« Reply #2 on: October 01, 2020, 12:49:45 pm »
I should warn there is huge code management problem when you start developing a monster like this:
https://www.qb64.org/forum/index.php?topic=3017.0

Then you must start thinking about handling text blocks smarter. I recommended one way but there are many other.


Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
Re: Question about creating blocks
« Reply #3 on: October 01, 2020, 12:53:30 pm »
But if you like a more flexible manner you can use a SUB plenty of LOCATE+ COLOR+ PRINT | _PRINTSTRING instructions or a FUNCTION plenty of ....

If my memory is not full out I remember that Steve has something that does this task like a text RPG game.
Waiting that Steve posts his masterpiece... posted some years ago on www.[abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
Programming isn't difficult, only it's  consuming time and coffee

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: Question about creating blocks
« Reply #4 on: October 01, 2020, 01:54:54 pm »
But if you like a more flexible manner you can use a SUB plenty of LOCATE+ COLOR+ PRINT | _PRINTSTRING instructions or a FUNCTION plenty of ....

If my memory is not full out I remember that Steve has something that does this task like a text RPG game.
Waiting that Steve posts his masterpiece... posted some years ago on www.[abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]

I had it on Dropbox, but those BEEPERS deleted a ton of old content off their servers a while back, to “protect users information”...   Checking now, it’s gone from there.  I’ll have to dig to see if I still have a copy tucked away on some archive somewhere, and if so, I’ll share it in a few days, when I get back home.  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
Re: Question about creating blocks
« Reply #5 on: October 01, 2020, 03:33:08 pm »
Your files got dropped from Drop Box? Hmmm, if only there was some clue in the company name to dissuade a person from using their storage service. I know, it's nice to have a backup outside of a premises, but honestly, thumb drives in a safe deposit box are the way I rolled. I wouldn't take the chance of some country like China hacking Drop Box, and using all my SCREEN ZERO programs to rule the world. Oh the horror!

Hope you find it on an old back up. Too much good stuff was also lost when [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] went down, too.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
Re: Question about creating blocks
« Reply #6 on: October 01, 2020, 05:23:27 pm »
This is the first time I have created something with QB64.  May I ask what programming language do you normally use and is this also the first attempt at writing interactive fiction? Just curious...
Logic is the beginning of wisdom.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Question about creating blocks
« Reply #7 on: October 01, 2020, 06:05:19 pm »
Quote
I had it on Dropbox, but those BEEPERS deleted a ton of old content off their servers a while back, to “protect users information”...

That is INSANE. Let me contrast to godaddy for a second. A few months ago I uploaded a directory like 500 folders deep and the server shut my site down and banned me temporarily. Some kind of lie about "unlimited storage" actually being limited... Anyway, I called them like 9 times, just saying "fine, delete my damn folder"... but they refused flatly. Apparently godaddy never deletes anything... So I had to do it myself from a banned account... Taught me more about hacking than I needed to know. Anyway, the fux with dropbox. Boycott.
You're not done when it works, you're done when it's right.

Offline johnblood

  • Newbie
  • Posts: 15
Re: Question about creating blocks
« Reply #8 on: October 03, 2020, 09:43:30 am »
This is the first time I have created something with QB64.  May I ask what programming language do you normally use and is this also the first attempt at writing interactive fiction? Just curious...

This would be the first time I ever created an application with any programming language (except for the usual tutorial stuff). I usually make  interactive fiction games with Twine. Since the point of the game jam is to imitate the look and feel of DOS games, I thought I'd try QB64.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
Re: Question about creating blocks
« Reply #9 on: October 03, 2020, 07:50:06 pm »
I have dabbled in Twine, Inform and Squiffy in the past and are fun to use. I also favour twine...  I suppose that either program would work if you choose the right font...

Most of the "old style" adventure game books/tutorials are made using Basic (with line numbers). Be warned... A descent IF game, in Basic, is a LOT of work. Admittedly, your first Basic IF game should not be like Zork or Colossal Cave, but not too small either... lol

"Creating Adventure Games On Your Computer" by Tim Hartnell is quite good. Published in 1984... definitely 'old school'....
https://www.dropbox.com/s/8wqtac26cg9gwxd/Creating%20Adventure%20Games%20On%20Your%20Computer%20%5BUK%5D%20%281984%29.pdf?dl=0

If memory serves correctly, the 'jam' you are planning to compete in, closes in about a month... You definitely have your work cut out for you... Best of luck! I do not know if I can offer much help... I am still learning how to code IF in Basic, using tutorials and Tim's book, but would be keen to know how you are progressing...

If the above link does not work, Google is your friend...

J
Logic is the beginning of wisdom.

Offline johnblood

  • Newbie
  • Posts: 15
Re: Question about creating blocks
« Reply #10 on: October 03, 2020, 08:11:09 pm »
@johnno56 I signed up for two jams: the one I mentioned and one to commemerate the 10th anniversary of Twine. I could create one game with Twine and submit it to both. That would be eaiser.
« Last Edit: October 03, 2020, 08:53:26 pm by johnblood »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
Re: Question about creating blocks
« Reply #11 on: October 03, 2020, 11:24:19 pm »
Ah. Divide and conquer... Excellent strategy... Let me know when you are done. I would like the opportunity to "test" your game... lol  Good luck!
Logic is the beginning of wisdom.