TAB - thinBasic Adventure Builder

T.A.B. is an interactive fiction/text adventure program for Windows and made with thinBasic.
 
HomeFAQSearchUsergroupsRegisterLog in
Latest topics
» TAB Version 66 Available
Mon Sep 26, 2016 12:02 pm by catventure

» TAB Version 65 Available
Mon Feb 23, 2015 12:04 pm by catventure

» Incubation pt 1
Wed Apr 24, 2013 9:24 am by Kabrinski

» Charecter movements - doors
Wed Mar 20, 2013 2:55 pm by garethfx

» Member feedback on game planning
Sun Mar 03, 2013 1:47 pm by garethfx

» Still alive - just!
Thu Feb 28, 2013 11:34 am by catventure

» TAB 64 crashes ...
Mon Aug 20, 2012 11:31 am by acko

» Idea on addition to object being container
Sat Aug 18, 2012 3:49 pm by catventure

» sizex=y action ...
Thu Aug 09, 2012 11:29 am by catventure


Share | 
 

 Alternative Location Descriptions

View previous topic View next topic Go down 
AuthorMessage
catventure
Admin Adventurer
avatar

Male
Number of posts : 376
Age : 64
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 52
Registration date : 2008-06-08

PostSubject: Alternative Location Descriptions   Tue Dec 29, 2009 8:38 pm

Hi,

Other members have mentioned and I was thinking today that although we have cyclic and random location descriptions possible in TAB it would be great if it were possible to change the location description only at will and at certain points during a game via the coding editors eg: print out a slightly different location description as a result of some player action or particular event happening etc.

In other words the game designer would have more control as to just when an alternate room text was going to be shown to the player... (not just limited to random/cyclic output)

To implement this there would need to be a way of telling TAB to print out a *particular* alternate room description instead of the one it was currently printing. Not all rooms would need or require alternative room descriptions of course.

The way I have been able to figure out that this very useful feature *could* be accomplished is by taking advantage of the existing user FLAGS (1-600)

There would also by necessity need to be a means of indicating in the Location Editor main room description EditBox the different location texts for a particular room - so that TAB could grab out the chunk of the alternate text it needed to when required.

What I am thinking is this:

A location can have up to 100 alternate descriptions. (individual elements in a location text)

You pick any unused flag to be linked to the location that you wish to assign alternate room descriptions. Obviously this flag could not be used for any other purpose in the game.

This User Flag would then be loaded with a special numerical value to indicate to TAB that this location contained alternate location descriptions and that when doing a location describe to simply print out a particular numbered alternate description instead of the whole of the location text for that room (if such a text segment existed in the location text)

EXAMPLE
=======

Room 5 is required to contain ALTERNATE descriptions.
We will also use a spare flag say... flag 31

At the start of the game we decide that we want to print the FIRST alternate description of room 5 when the player arrives in it - until, that is, we decide otherwise...

Because it's room 5 we load flag 31 with 5000 + THE NUMBER OF THE ALTERNATE DESCRIPTION!

In this case it will thus be set with the value: 5001

The formula is:
Flag Value = (room number * 1000) + THE NUMBER OF THE ALTERNATE DESCRIPTION

So we go to Script1 or Script2 and put in an entry early on to put in an ACTION #flag31=5001# like so:

[start]turns=0[acts]flag31=5001[end]

(We need also to set there any further flags relating to OTHER alternate description rooms too that we might be using in a game so TAB "knows" what to do)

Now we go to the Location Editor to enter our room description(s) for Location 5. We have decided beforehand that there will be 4 alternate scenes for room 5. (although most will probably use only 1 or 2 usually to reflect little changes in the room atmosphere etc) We will use bracketed number tags to make plain to TAB the starting and ending points of each individual segment...

Location 5
==========
[1]This is the first room 5 description.[1]

[2]This is the second room 5 description.[2]

[3]This is the third room 5 description.[3]

[4]This is the fourth room 5 description.[4]

=========
You can use whitespace to space them out for clarity. The tags are important and *MUST* be present for correct textual output.

TAB will grab the chunk it needs from between the number indicators BEFORE it goes on to do the checks for cyclic/random formatting etc. - so it would be perfectly possible to include cyclic/random elements within each alternate room description too!


Little recap here:

If the location were 16 and the spare flag used 56 we'd need to set an action such as:
#flag56=16003#
which would cause TAB to only print alternate description 3 of room 16

If the location were 500 and the spare flag used was 1 an action such as:
#flag1=500002#
would always print the second alternate description of room number 500.

========

The only slight 'issue' is with the opening location (start room) of the game and this will only ever apply if you wish to have alternate room descriptions in the game START ROOM only. So best to think about that right at the start of planning your game...

Start room locations are printed before any script processing is done, so there is no way of telling TAB via a flag that a starting room location may contain alternate descriptions.

However there is a workaround for that. We can erase/delete the start location so it is blank and then re-insert the text and directions into another room... then we can go to Script 2 and set the relevant flag and do a "gotoX" action to show the new start room...

For example if the Start Room = 1, we delete location 1 and reinsert it to say an unused location, say 100. Let's imagine we are using a spare flag 22 and have 3 alternate descriptions for our room 100. (new opening start room)

Script 2
========
[start]room=1[acts]flag22=100003#goto100[end]

If in start room, set the flag 22 then describe the third alternate description of room 100.



I have coded this into TAB for next version and it is working beautifully!
I am sure you will think of times when it may be handy to use alternate descriptions after certain puzzles or changes in a game etc. Now it will be possible.
eg:

room description says "There is a closed cupboard" in the text.

Player opens the cupboard (if successful then use action to set "alternate room flag")

alternate room description now tells player somewhere in text "The cupboard door has been opened"

Regards,
catventure.

_________________
http://tab.thinbasic.com ; Home of the TAB I.F. project.
Back to top Go down
View user profile http://adventure.rpgdynasty.com
 

Alternative Location Descriptions

View previous topic View next topic Back to top 

 Similar topics

+
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
TAB - thinBasic Adventure Builder :: TAB FORUMS :: Suggest New Features-
Jump to: